Unexpected "Pattern Navigation" Behavior

I’m not sure where I should post that but it concerns scripting so:

With some help I began to use the sript editor last week & now I control
the pattern navigation with OSC messages.

I ran into a problem that might be a bug, anytime I set renoise to jump to a line
it does but it doesn’t play the content of this line. (for example if I set next line
to be “Line 1” it will jump to line 1 but play sound only once it reached line 2)

Has anyone got an idea of what happens here?

Here is the script I use to navigate:

[b] arguments = { argument(“sequence”, “number”),
argument(“line”, “number”) },

handler = function(sequence,line)
local new_pos = song().transport.playback_pos
new_pos.sequence = sequence
new_pos.line = line
song().transport.playback_pos = new_pos

end,
}[/b]

Hi yogi,

Yes, this is quite the problem. I believe the idea here is that the lua script does not directly play as it is not affecting the playback directly but changing the playhead. When we change the playhead the current line has already fired (played) so the new line we are setting as the current line “has already played”. But as the playhead skips to the next line, the next line will play.

“Technically” this is correct behavior for what it describes, but technically correct is not always most logical. What we want is something like “move playback_pos before next line change” because we want to move the playback_pos on the next line change but before the line is processed. So changing the playback_pos again we don’t want to modify it directly but we want to modify it on the next line change.

Perhaps this might be done with playback_pos_observable if it where implemented. But the event would need to fire before the current line is evaluated (after index change, before processing).

A workaround is just moving to the line before the line you want to play. But this gets complex when setting to the last line of the previous pattern (for first line of current pattern) etc.

Something to think about.
mogue

Hi!
moving to the line before the one I want wouldn’t work!

I found a way around by sending “transport/continue” right after I changed the position. It works fine.
But when I send a position, most of the time the “sequence” change is not taken into account, only line change, I have no idea why… Maybe my script needs some tweaking???