Get pattern position in sequencer

song.selected_pattern_observable:add_notifier (TEST)

function TEST()
  print("TEST cur_pat_seq_pos", song.transport.playback_pos.sequence)
end

So, this function runs when I move up/down in pattern sequencer, but it usually prints previous pattern position. Am I doing it wrong?

Perhaps because Renoise editor counts from 0 but Lua starts lists/arrays at 1.

I meant that it prints the position of pattern that was selected before selection changed.

Or is Renoise wrong? :slight_smile:

Curiosity, does it work better if you change:

print("TEST cur_pat_seq_pos", song.transport.playback_pos.sequence)

to read the selected sequence index?

print("TEST cur_pat_seq_pos", renoise.song().selected_sequence_index)

(manually moving between patterns)

1 Like

Yes, it does. Thanks!

Ok (so long as the user hasn’t decoupled the playback from the editing position (i.e. hit the scroll lock key) etc…) But there is still a problem returning incorrect values with your first example

renoise.song().transport.playback_pos.sequence (SongPos object)

that Renoise needs to look at(?)

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.