The following function that I share serves to hide note columns or effect columns that are empty (not used). I do not know if someone has made a similar function for a tool. But it seems to me a very interesting and useful function.
Maybe something like that should be native?
function pre_collapse_col_trk()
local trk = song.selected_track
local var = 2
if ( trk.type == renoise.Track.TRACK_TYPE_SEQUENCER ) then
var = 1
else
var = 2
end
local sti = song.selected_track_index
if song.selected_effect_column then
for e_col = 8, var, -1 do
for seq = #song.sequencer.pattern_sequence, 1, -1 do
local spq = song:pattern(seq)
if not ( spq.is_empty ) then
for lne = spq.number_of_lines, 1, -1 do
if not ( spq:track(sti):line(lne):effect_column(e_col).is_empty ) then
trk.visible_effect_columns = e_col
return
else
trk.visible_effect_columns = e_col -1
end
end
else
if ( seq == 1 ) then
trk.visible_effect_columns = var -1
end
end
end
end
else
for n_col = 12, 2, -1 do
for seq = #song.sequencer.pattern_sequence, 1, -1 do
local spq = song:pattern(seq)
if not ( spq.is_empty ) then
for lne = spq.number_of_lines, 1, -1 do
if not ( spq:track(sti):line(lne):note_column(n_col).is_empty ) then
trk.visible_note_columns = n_col
return
else
trk.visible_note_columns = n_col -1
end
end
else
if ( seq == 1 ) then
trk.visible_note_columns = 1
end
end
end
end
end
end
This function analyzes all the lines within the selected zone (columns of notes or effect of notes) of the whole sequence (all patterns), in search of parameters. If the analyzed column is completely empty, it is hidden, repeating this process iterating between all the columns of the same type.
The final result is that only columns that contain at least one parameter will be visible.First select a note column, to analyze this type. Select an effect column, to analyze this type. It works on any type of track, be it track, group, master or send.I’m sorry not to conform the tool. I only share the function because it is part of a larger tool, and I found it interesting to comment on it.
If you can think of a faster function, you know, share it here…