Change song position per midi (like pressing F9,F10,F11,F12)

Hi Renoise-Forum!!

The attached script “MidiCtrldSeqTransp.lua” (copied together from sample scripts) is changing the song position pointer, but in an unpredictable way and producing glitches. Maybe "renoise.song().transport:start_at() is not the right method in my use case?

I figured out that the the actual line of the playback position could be read out by

print(renoise.song().transport.playback_pos.line)

That works perfectly fine for me.

This property is declared in Renoise.Song.API.lua as playback position from line 516 to 520.

-- Playback position.
renoise.song().transport.playback_pos
 -> [renoise.SongPos object]
renoise.song().transport.playback_pos_beats
 -> [number, 0-song_end_beats

Because it’s not explicitly declared as read-only (in contrast to other properties) I assume that it could be also set to a specific value.

Unfortunately I can’t figure out how to do that. Could anyone support me in that?

Help would also be very appriciated, if I am trying to control the song position via MIDI in the completely wrong manner.

Thanks in advance!!

Because it’s not explicitly declared as read-only (in contrast to other properties) I assume that it could be also set to a specific value.

Unfortunately I can’t figure out how to do that. Could anyone support me in that?

Are you trying to set it as a number? It wants SongPos. Ie.

local new_pos
new_pos = song.transport.playback_pos
new_pos.line = 13
song.transport.playback_pos = new_pos

Look at this script’s code for more info:

https://www.renoise.com/tools/custom-pattern-navigation

https://github.com/renoise/xrnx/blob/master/Tools/com.renoise.CustomPatternNavigation.xrnx/main.lua

There may be some useful code in my OSC Jumper tool:https://github.com/Neurogami/renoise-ng/tree/master/lua/com.neurogami.OscJumper.xrnx

I could see respective fix my error based on your answers :slight_smile:

Thanks a lot for your support guys!