Q: Best Way To Get At The Currently Selected Automation?

Here’s how I’m doing it, but this can’t be right.

pattern = renoise.song().selected_pattern_index  
track = renoise.song().selected_track_index  
if renoise.song().selected_parameter.is_automated then  
 for _, automation in ipairs(renoise.song().patterns[pattern].tracks[track].automation) do  
 if renoise.song().selected_parameter.name == automation.dest_parameter.name then  

That finds the first automated parameter that has the same name as the one I’m looking for, which in the case I’m using this for is good enough. But if automation.dest_parameter had an index and not just a name, as well as the index of the device it belongs to, then I could compare that to renoise.song().selected_parameter and could be sure it’s the right one… names are like sand on the beach, we need more numbers, or Prince wins!

And regardless of that: is there a direct way from (the index of) the currently selected parameter to its automation, without having to loop through anything?

I wish the API had diagrams! :lol:

– returns the automation for the given device parameter or nil
– when there is none
-> [renoise.PatternTrackAutomation or nil]

Should do the trick?

heh you’re right, thanks! got a bit lost there ^^