Personally I have been using the :line(line_index) method with nested loops i.e.
--selected pattern and track values
local pattern_index = renoise.song().selected_pattern_index
local track_index = renoise.song().selected_track_index
local pattern_length = renoise.song().patterns[pattern_index].number_of_lines
--track in pattern object
local current_pattern_track = renoise.song().patterns[pattern_index].tracks[track_index]
--nested for loop
for columns = 1,12 do
for line_index = 1, pattern_length do
print(current_pattern_track:line(line_index).note_columns[columns].note_string)
end
end
but an iterator might be nice aswell, as you need to add another for loop if you want to do each column in song which starts to get messy.
Thanks for the snippet. I don’t think this does what I want, though. My working scenario:
10 Patterns, all unique, numbered 1 to 10 in the Pattern Sequencer.
Iterate over column 1, starting from pattern 1, ending at pattern 10.
Iterate over column 2, starting from pattern 1, ending at pattern 10.
Iterate over column 3, starting from pattern 1, ending at pattern 10.
[…]
Your code snippet iterates over the columns of a single pattern. In general, all available iterators already do this.
The difference is i’m trying to treat each column as a continuous time line.
Yes it needs the other nested “for loop” for that:
EDIT: UPDATED WITH WORKING CODE
--selected pattern and track values
local track_index = renoise.song().selected_track_index
local total_sequence = #renoise.song().sequencer.pattern_sequence
--column
for columns = 1,12 do
--pattern
for sequence_index = 1,total_sequence do
local pattern_index = renoise.song().sequencer.pattern_sequence[sequence_index]
local current_pattern_track = renoise.song().patterns[pattern_index].tracks[track_index]
local pattern_length = renoise.song().patterns[pattern_index].number_of_lines
--line
for line_index = 1, pattern_length do
print(current_pattern_track:line(line_index).note_columns[columns].note_string)
end
end
end
note the " current_pattern_track" needs to be reset in the second “for loop” in order to update the pattern number correctly.
Your code snippet doesn’t work. Or, more to the point, your code snippet does exactly what I already do with .pattern_iterator:lines_in_track(), except it’s a bit buggy as I type this.
Look at this screenshot (each Pattern is 8 lines, made them small for the purposes of this example)
Attachment 1643 not found.
For my request, print should output in this order…
It works perfectly for the way you described here?? I did do a couple of edits on that code just after posting so it might be worth recopying and pasting with all the variables to try again
EDIT: UPDATED WITH WORKING CODE
--selected pattern and track values
local track_index = renoise.song().selected_track_index
local total_sequence = #renoise.song().sequencer.pattern_sequence
--column
for columns = 1,12 do
--pattern
for sequence_index = 1,total_sequence do
local pattern_index = renoise.song().sequencer.pattern_sequence[sequence_index]
local current_pattern_track = renoise.song().patterns[pattern_index].tracks[track_index]
local pattern_length = renoise.song().patterns[pattern_index].number_of_lines
--line
for line_index = 1, pattern_length do
print(current_pattern_track:line(line_index).note_columns[columns].note_string)
end
end
end
--selected pattern and track values
local track_index = renoise.song().selected_track_index
local total_sequence = #renoise.song().sequencer.pattern_sequence
--column
for columns = 1,12 do
--pattern
for sequence_index = 1,total_sequence do
local pattern_index = renoise.song().sequencer.pattern_sequence[sequence_index]
local current_pattern_track = renoise.song().patterns[pattern_index].tracks[track_index]
local pattern_length = renoise.song().patterns[pattern_index].number_of_lines
--line
for line_index = 1, pattern_length do
print(current_pattern_track:line(line_index).note_columns[columns].note_string)
end
end
end
--selected pattern and track values
local track_index = renoise.song().selected_track_index
local total_sequence = #renoise.song().sequencer.pattern_sequence
--column
for columns = 1,12 do
--pattern
for sequence_index = 1,total_sequence do
local pattern_index = renoise.song().sequencer.pattern_sequence[sequence_index]
local current_pattern_track = renoise.song().patterns[pattern_index].tracks[track_index]
local pattern_length = renoise.song().patterns[pattern_index].number_of_lines
--line
for line_index = 1, pattern_length do
print(current_pattern_track:line(line_index).note_columns[columns].note_string)
end
end
end
local rns = renoise.song()
local total_sequence = #rns.sequencer.pattern_sequence
for track_index = 1,#rns.tracks do
if
rns.tracks[track_index].type ~= renoise.Track.TRACK_TYPE_MASTER and
rns.tracks[track_index].type ~= renoise.Track.TRACK_TYPE_SEND
then
for columns = 1,rns.tracks[track_index].visible_note_columns do
for sequence_index = 1,total_sequence do
local pattern_index = rns.sequencer.pattern_sequence[sequence_index]
local pattern_length = rns.patterns[pattern_index].number_of_lines
local current_pattern_track = rns.patterns[pattern_index].tracks[track_index]
for line_index = 1,pattern_length do
local note_col = current_pattern_track:line(line_index).note_columns[columns]
-- Money shot
print(track_index, columns, note_col.note_string)
end
end
end
end
end