get names of chains of a audio rack

double_UG's icon

how can i put the names of the chains of a audio rack into a M4L menue?

I wanna make a max chain selector and want to select the chains by name from a m4l menue. how can the chain names be read into a m4l menue ?

xanadu's icon

Look for an example at Audio Effects => Max Audio Effect => Tools => API => Max Api Ctrl1LFO

ShelLuser's icon

Its relatively easy.. The Device class has a child called 'chains' which you can get or observe. As such that is your key to getting all the chain id's of a rack. Once you have the id's you can iterate over 'm (go over them one by one) using the 'zl' object (use the 'iter 2' option).

You can then get the Name property and you're done.

You mention "M4L menu" but there really is no such thing; M4L provides several ways of menus. There is a problem though, unfortunately the "live.menu" object isn't the easiest when it comes to dynamic changes.

If you're not looking for something which can be controlled by a control surface (such as the APC40) then I'd recommend using the 'umenu' object instead. This makes it much easier to control the menu contents.

As said; the downside to this is although its perfectly usable in Live you can't map this critter in any way nor will you be able to control it using external devices such as the apc40.

double_UG's icon

yeah I got it.

get chains, get name, does it.

thanx

xanadu's icon

@Shelluser

You can't control a umenu staight away. But you can use a live.numbox that has it's left outlet connected to the inlet of the umenu.

esbenam's icon

Hi.

I know this is and old post, but this is exactly what I need to do. I just don't get the iteration thing..

I got all the chain ids in the device, but how do i make a loop to get the ids converted to names?

broc's icon

As mentioned above the iteration can be done like this:

5414.Picture1.png
png
esbenam's icon

But how do I make it loop it. That just gives me one name and error messages for the once it didn't go through?

broc's icon

If you post your patch (copy compressed) we may see what's going wrong.

esbenam's icon

Hmm, this is my patch.

It finds the name of the scene currently playing and then it will hold that name against the names in the chain to select it (it also renames a track for some feedback).

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

I got it working using some of the docs, but it seems a bit excessive if it can be done with just a few elements.

broc's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I've only looked at the part which creates the list of chain names and made some changes for simplification (not tested).

esbenam's icon

Hmm, that doesn't work.

broc's icon

Sorry, there was a typo in my patch: replace [iter 2] with [zl iter 2].

esbenam's icon

Ahh, yeah. Now it works perfectly. Thank you very much.