New Tool (2.7 - 3.1): Set Track Width To Active Columns

On Tools Page:


v1.34 includes Joule`s revision with major speed improvements

This tool checks either the ‘selected track’ or ‘all tracks in song’ for notes in hidden columns or excess empty columns. The number of visible columns is then adjusted so all notes are shown and excess columns hidden.

After running the tool only the three active columns will be visible here


Menu Locations:

  • Pattern Menu : Set Track Width To Active Columns
  • Tools Menu : Ledger`s Scripts : Set Track Width To Active Columns


“Set Track Width To Active Columns”

“Set Current Track Width To Active Columns”
“Set All Track Widths To Active Columns”

forum mirror:

Click to view contents

Renoise 3.1

renoise 3.0


Click to view contents


-Compatability update + button reads “busy” while the tool is working


-New GUI

-Now optionally hides empty fx columns; with option to leave at least one if you like the visual track bordering/buffering

-Less Shortcuts + menus for tidyness

Menu : Tools: Ledger`s Scripts: Set Track Widths To Active Columns


Shortcut: Set Track Widths To Active Columns

Compatible with renoise 3.0

–Option added for all tracks at once
–Speed optimisations thanks to joule

v 1.10
– Fixed bug: When different length patterns were present
notes may not have be detected in longer patterns

A few small tidying adjustments and now on tools page:

Very nice

No probs, let me know if you find any issues.

2.7 beta version added

2.7 version on tools page:

2.8 version :

–Added new menu entry under the “tools” menu, under “Ledger`s scripts”

Nice tool. Why not support the effect columns as well?

Here is a speed-up btw

Click to view contents
renoise.tool():add_keybinding {  
 name = "Global:Tools:Set Track Width To Active Columns",  
 invoke = function()set_track_to_active_columns()  
renoise.tool():add_menu_entry {  
 name = "Pattern Editor:Set Track Width To Active Columns",  
 invoke = function() set_track_to_active_columns()  
renoise.tool():add_menu_entry {  
 name = "Main Menu:Tools:Ledger`s Scripts:Set Track Width To Active Columns",  
 invoke = function() set_track_to_active_columns()  
function set_track_to_active_columns()"`Set Track To Active Columns` Tool : (Busy...)")  
local pattern_index =  
local track_index =  
local pattern_length =  
local all_patterns =  
--currently selected track--  
local current_pattern_track =  
local found_pattern  
local found_pattern_shown_number  
local column_adjusted_to  
---line_index `iterate`  
local note_found = false  
for note_col = 12,1,-1 do --each column starting from 12"`Set Track To Active Columns` Tool: (Checking Column in Song: ".. note_col..")")  
 if note_found == true then  
 for pattern = 1, all_patterns do --each pattern  
 if note_found == true then  
 current_pattern_track =  
 if not then  
 local lines = current_pattern_track:lines_in_range(1, pattern_length)  
 for i, line in ipairs(lines) do --each cell  
 if line:note_column(note_col).note_value < 120 then --(120 = note-off, 121 = empty)  
 note_found = true  
 found_pattern = (pattern)  
 --set visible columns = note_col  
 column_adjusted_to = note_col  
 end --for line_index  
 end --for pattern  
end --for note_col  
if found_pattern then"`Set Track To Active Columns` Tool : (Completed. Right-Most Note found in: Column: "..column_adjusted_to.." / Pattern: "..(found_pattern - 1)..")")  
else[track_index].visible_note_columns = 1 --set columns"`Set Track To Active Columns` Tool : (Completed. Set To 1 Column , No Notes Were Found)")  
end --main  

Haven`t done much with this one for a while other than version updates. Have it in mind to expand to fx and all tracks at once. Question of time/ priority though.

Thanks for the speed tip, will take a look.

I was looking for a tool like this one but couldn’t find one. Then, I accidentally stumpled over this one. Nice tool. Wouldn’t a name like “Remove/hide Unused Columns” be more approbiate?

Would also like to use the tool on all tracks (if it is possible to prevent the “Script not responding” dialogs from appearing).

Another idea: it would be great if the tool could remove not just the last unused columns in a track, but also unused columns in between used columns.

Other than that, it works great.
Thanks for sharing!

@Drop Shadow

thanks again for suggestions, at the moment I am not getting much chance for scripting though I will have another burst no doubt soon. I don`t think I will change the name on this as it is already up on the tools site under the current name. The name was chosen as the tool will uncover columns that are hidden aswell as hiding the unused. Maybe a little less obvious title but hopefully not a prob now you have found the tool :)

Hi again,
There seems to a problem with the tool. Try using it on the attached song. Run the tool in pattern 0.

The tool will report that there’s no notes and shrink the track to one column although there’s a note in pattern 1.

The funny thing is, if you run the tool from pattern 1, it will work.

Thanks for the report,

will take a look

Please take a look at version 1.10 for rns 2.8, this should be fixed:


Works just fine. Thanks!

Have just added this here using the process slicer class.

There is now a new menu entry/ shortcut for "Set All track Widths to Active Columns". Released here as a beta for now, bug reports welcome:

[s]Attachment 3395 not found.

[/s]new beta 1.22 below

[quote=“Ledger, post:16, topic:31078”]
Have just added this here using the process slicer class.

There is now a new menu entry/ shortcut for "Set All track Widths to Active Columns". Released here as a beta for now, bug reports welcome:

Attachment 3395 not found.
Very nice addition.
I would like to test this on some of my big and rather complex songs, but practically I can’t due to the “Script not responding” issue.

Could you give me a ballpark figure of how large these songs are? (no. of patterns and average pattern length) The process_slicer is now implemented so should in theory deal with this issue. However if you songs are huge this may need some minor tweaking.

If this should mean that the tool should process the data faster now, it doesn’t seem to be the case here. At least, nothing I can notice.

The one I’m working on at the moment:
66 tracks
144 patterns
Average pattern length: 180.

Of course, all things being equal the tool’s usability increases with the song size. So, I would very humbly argue that the tool ideally should be able to deal with “huge”.

What do I mean, when I say it’s practically impossible to test the “Set all tracks…” function?
I had to click “No” in the “Script not responding” dialog about 20 times before the first track was processed (and 65 still to go!).

No it is more to do with bypassing the pop-ups.

Thanks for figures I have tweaked aiming to cover most extreme 512 length patterns now.
Let me know if this works for you now. Hopefully we can get this optimised to eliminate the popups in all situations.

edit: see 1.23 in next post