Selected tracks in pattern sequencer matrix: How to get?

Hi,

I would like to expand theTuned Shortcutstool for selections in the pattern sequence matrix. So if the matrix is focused and some tracks are selected there, I want to target those tracks. But how to do this, esp.

  • How to get selection in the matrix/sequencer? Let’s say I selected three tracks over 4 patterns… Don’t really understand the song API docs here…

  • How to know if the user has the sequencer or the pattern focused?

Thanks for help!

renoise.song().sequencer:track_sequence_slot_is_selected(track_index, sequence_index)

I’d iterate all tracks per all sequences and check if above is true. When true insert into a custom table (with a fitting structure). This table now contains references to all selected patterntracks and can be iterated for processing them.