Help: Chain Selector Auto On/Off Device

lemmings's icon

Hey Everyone,

I just made a m4l patch for the instrument rack chain, but I was wondering if you could help me simplify it or offer some advice. It's just a patch that automatically turns off the devices that are not a part of the selected chain in an instrument rack. It is built for just a 6 layer chain, but ideally I want it to work for a 64 layer instrument rack chain. But the thing is I couldn't use the uzi object, even with the defer object and get it to work. So I just made a more cumbersome patch, but I have like a patcher for each layer, which seems silly, I would like it to be more automated.

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

The way it works now is that the patcher at the top observes the chain selector value. Then that value gets sent to the patchers below to be compared. Each patcher below is for a respective chain layer. So it would be weird to have like 64 of those patchers.

Any suggestions?

broc's icon

I think the [poly~] object provides an elegant solution for this.

Here is a thread with a related example and discussion of specific limitations.

lemmings's icon

Maybe I am wrong, but I don't think that will work. Because even though I need 64 instances of those patchers at the bottom, each patcher has a different value for the live.object to control. And live objects can't be changed dynamically.

Could you explain a bit further how I would implement the poly object here if I am wrong?

broc's icon

You are wrong because poly~ creates multiple copies of the patcher. So internally there will be a separate live.object for each chain, ie. no dynamic changes.

Anyway, I like your idea of optimizing the instrument racks and thus have implemented it for my own usage (see attachment). It's a MIDI effect device to be placed directly in front of the instrument rack and can be set to any number of chains from 1 to 127. Note that the device is frozen to include the poly~ patcher. So for editing you need to click the freeze/unfreeze button.

4689.OptiRack.amxd
amxd
lemmings's icon

Cool, this is really helpful. I am trying to understand the specifics in your patch, I understand how it works overall, but there are a couple of spots which are stumping me right now because I am new to max. There are three inputs in the poly object. Why is there an uzi object to set to the 2nd input on the poly? Because it will uzi out id's before any values into the first input are even sent. Also why is "target" placed in the message boxes?

broc's icon

The 2nd and 3rd input of poly are used for initialization, ie. calculating id's for the live.object instances. This must be done before values are sent to the objects (1st input).

The 'target' message specifies to which instance subsequent messages will be sent. For example, [target 3, 5] means that the number 5 is sent to instance 3.

lemmings's icon

ahhh right, because it's a poly object. ok cool, thanks again for posting up your patch. this is helping me a lot.

Alejandro Tomsic's icon

Hi, I am using your optirack effect and it's really cool. Thanks for sharing. Would it be possible to add a feature that selects the instrument currently active ? For a push user this would be great to control the parameters of the selected instrument.

Sapo's icon

Hi @Broc !
What a clever and useful device !
Is it possible to make the same thing for audio effect rack ?
I can't figure how to do that myself... and it would be awesome !