get names of chains of a audio rack

Sep 26, 2011 at 5:27pm

get names of chains of a audio rack

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 ?

Sep 29, 2011 at 9:16pm

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

Sep 29, 2011 at 11:51pm

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 “” 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.

Sep 30, 2011 at 3:35pm

yeah I got it.

get chains, get name, does it.


Sep 30, 2011 at 4:28pm


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.

Apr 12, 2013 at 3:23pm


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?

Apr 12, 2013 at 6:12pm

As mentioned above the iteration can be done like this:


  1. Picture1.png
Apr 12, 2013 at 6:57pm

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?

Apr 12, 2013 at 7:24pm

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

Apr 12, 2013 at 7:50pm

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).

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.

– Pasted Max Patch, click to expand. –
Apr 13, 2013 at 2:46am

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

– Pasted Max Patch, click to expand. –
Apr 14, 2013 at 11:46am

Hmm, that doesn’t work.

Apr 14, 2013 at 12:44pm

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

Apr 14, 2013 at 2:43pm

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


You must be logged in to reply to this topic.