Help: Auto-Reorder Effect Rack Chains to Match Scene Names

Filip Sowa's icon

Hi all,

Max Patch
Copy patch and select New From Clipboard in Max.

Long time forum surfer but relatively new max coder here. I'm working on a Max for Live device that reorders chains in an audio/MIDI effect rack based on a name match between chains and scene names. Each scene in my Live Set represents a song. Each track has a MIDI rack with chains named after those scenes, used for MIDI processing presets.

The idea is:

  • If a chain named "Greyscale" exists and scene 1 is also called "Greyscale", the device should move that chain to position 1 and set its zone to match.

  • I’m aiming to auto-align chain order and zones based on scene name/index as the setlist evolves.

So far, I can pull individual scene and chain names and do some comparing using [zl.compare], but I’m looking for help with:

  • Comparing single entry with a list entry and identifying where there is a match, for example in an index list like 0, 0, 1, 0 or in words: fail, fail, match, fail

  • Making the device dynamic for whichever track its loaded onto

then eventually....

  • Reordering chains

  • Reassigning chain zones

  • General structure suggestions

Any tips, patches, or API guidance would be hugely appreciated!

Thanks!
Filip

Left of Green Matrix are INs, Right of Matrix are OUTs
Chains in one order
Scenes in another