…I’m expecting “my_test2” to get called when we change to section index 1 during playback, but nothing happens. “my_test2” just does an rprint “hello” or similar btw.
Just wanted to check I’m not using this in the wrong way, basically I need to set up an observable to know when a pattern changes, instead of using the idle to check if we played the last line of the pattern. I don’t think there is a “end of pattern” observable so using section names is an alternative approach.
The “sequence_is_start_of_section” boolean indicates the section looping in the pattern matrix. Your notifier should be called when you set the loop to start from the first sequence to some other sequence. The section loop is marked with the unfilled gray boxes next to the sequence numbers in the pattern matrix.
Sadly I think the best way to what you want is through the app_idle_observable:
local last_playback_pos
function test_for_pattern_change()
local rs = renoise.song()
if last_playback_pos and (rs.transport.playback_pos.sequence ~= last_playback_pos.sequence) then
my_test2()
end
last_playback_pos = rs.transport.playback_pos
end
if not (renoise.tool().app_idle_observable:has_notifier(test_for_pattern_change)) then
renoise.tool().app_idle_observable:add_notifier(test_for_pattern_change)
end
Another option might be to enable pattern follow and use the selected_sequence_index_observables.