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
Shortcut:
(2.6/2.7)
“Set Track Width To Active Columns”
(2.8)
“Set Current Track Width To Active Columns”
“Set All Track Widths To Active Columns”
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()
end
}
renoise.tool():add_menu_entry {
name = "Pattern Editor:Set Track Width To Active Columns",
invoke = function() set_track_to_active_columns()
end
}
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()
end
}
function set_track_to_active_columns()
--renoise.app():show_status("`Set Track To Active Columns` Tool : (Busy...)")
local pattern_index = renoise.song().selected_pattern_index
local track_index = renoise.song().selected_track_index
local pattern_length = renoise.song():pattern(pattern_index).number_of_lines
local all_patterns = #renoise.song().patterns
--currently selected track--
local current_pattern_track = renoise.song():pattern(pattern_index):track(track_index)
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
renoise.app():show_status("`Set Track To Active Columns` Tool: (Checking Column in Song: ".. note_col..")")
if note_found == true then
break
end
for pattern = 1, all_patterns do --each pattern
if note_found == true then
break
end
current_pattern_track = renoise.song():pattern(pattern):track(track_index)
if not renoise.song():pattern(pattern):track(track_index).is_empty 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
renoise.song():track(track_index).visible_note_columns = note_col
column_adjusted_to = note_col
break
end
end
end --for line_index
end --for pattern
end --for note_col
--status
if found_pattern then
renoise.app():show_status("`Set Track To Active Columns` Tool : (Completed. Right-Most Note found in: Column: "..column_adjusted_to.." / Pattern: "..(found_pattern - 1)..")")
else
renoise.song().tracks[track_index].visible_note_columns = 1 --set columns
renoise.app():show_status("`Set Track To Active Columns` Tool : (Completed. Set To 1 Column , No Notes Were Found)")
end
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.
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!
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
[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 Alltrack 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!).
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.