How can I query if a song has been upgraded?
I don’t want to run a script if a song has Tick Speed instead of LPB.
Can’t find anything in the API docs.
Ideas?
How can I query if a song has been upgraded?
I don’t want to run a script if a song has Tick Speed instead of LPB.
Can’t find anything in the API docs.
Ideas?
You might also get errors when you attempt to set the TPL higher than 6 in compatible mode.
Bump. Or pro tip?
Right now there is no way to find out if a song uses “speed” or “LPB” from Lua.
But I understand that this can be important for script so let’s think about how to add this:
Internally we are using a “song.playback_engine_version”, which gets increased with any changes in the player that are not backwards compatible. The speed thing is one of them. But probably this is a bit too much info. Its mostly about small things like how to treat volume column values, how some pattern FX behave and so on.
renoise.song().playback_engine_version -> [read-only, number]
alternatively we could only publish the timing model. Something like:
– consts
– tpl is used as speed factor. lpb property unused
renoise.Transport.TIMING_MODEL_SPEED
– tpl is used as event rate for effects only. lpb defines relationship between lines and beats.
renoise.Transport.TIMING_MODEL_LPB
– properties
renoise.song().transport.timing_model -> [read-only, enum=TIMING_MODEL]
or a simple boolean:
renoise.song().transport.speed_timing -> [read-only, boolean]
I do prefer 2) cause its more verbose.
I’ll work with what’s available, I don’t have a preference.