is it possible to extract the note indexes for putting into a table? Currently I am using a pos.line iterator within which I can reference line.note_value
for pos,line in pattern_iter:note_columns_in_pattern_track(pattern_index,track_index) do
print(line.note_value)
--gives for example 60 for middle c
end
This seems to get a bit inefficient when getting ranges at towards the end of a pattern (see tickyroll) as it starts from line 1 all the time. I use a break which is fine earlier in the pattern, but useless towards the end.
local pattern_track = renoise.song().patterns[Y].tracks[X]
-- or local pattern_track = renoise.song().selected_pattern_track
local visible_note_columns = renoise.song().tracks[X].visible_note_columns
-- or local visible_note_columns = renoise.song().selected_track.visible_note_columns
for line_index=range_start, range_end do
local note_columns = pattern_track:line(line_index).note_columns
for column_index=1,visible_note_columns do
local note_column = note_columns[column_index]
print(note_column)
end
end
Not as pretty as the iterator version, but this will be as efficient as a note_columns_in_range would be.
Its important to use “:line(line_index)” and not “.lines[line_index]” to get a single line. Every call to .lines will query ALL lines from Renoise, but only access one of it, which can be a performance bottleneck.