Set selected chain in rack?

patrickkidd's icon

I am able to get the id of the selected chain from a device's view, but am unable to set the selected chain. Is this possible? When I get the param id of the "selected_chain" property, and then pass it to [live.remote~], I get this error message:

Max Patch
Copy patch and select New From Clipboard in Max.
live.remote~: set id: only accepts objects of type DeviceParameter

Thanks!

Evan's icon

Well that error kind of answers your question. You cannot control anything other than device parameters with a live.remote, and 'selected_chain' is not a device parameter. There might be a way to set 'selected_chain' via live.objects, but I'd have to dig a little before answering definitively.

patrickkidd's icon

I would dig for it myself, but can't figure out where to start. The 'child' on the rack Device's View is called 'selected_chain', but is it possible to set this value? I don't see this particular child "property" in the LOM reference, and this is my first time really getting acquainted with the LOM.

A [getinfo] on the rack's View returns this:

view: info id 670
view: info type View
view: info description Representing the view aspects of a device.
view: info child canonical_parent Device
view: info child selected_chain Chain
view: info done

Thanks so much!

Jdudeo's icon

In my albeit limited experience M4L doesn't play so nice with chains, if that's all getinfo returns for you then it's probably not possible.

I'm guessing you want to select the chain to just highlight it and see its devices and not to direct MIDI or audio to only that chain right? We're not talking about the chain select ruler are we?

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

actually I just had a look at this and it can be done, the only thing to note is you have to know the id of the chain you want to select. You set a live.object to the view child of your rack and send a message to it [set selected_chain id xx] and it'll select your chain. Here's an example:

Depending on how you're going to use this you might want to set up an additional part of your patch to get the ids of your chains for you automatically then you can just say something like select chain number 1, number 2, last, first etc.

patrickkidd's icon

Ah, crazy how you have to pass "id xxx" as the parameter to the call function. How did you figure that out? Trial and error? I couldn't find a paper trail for this info in the docs or [getinfo] to save my life.

Thanks!

Jdudeo's icon

I think that as a rule anything that's listed as a property can be set with a message that reads [set {property} {value}] sent to its parent. I never had a great time with the documentation and I think I figured that out by reading the C74 forums or trial and error. The live objects also tend to not like anything too relative which is why you have to feed them ids most of the time.

In case you don't know, anything listed as function (I think) which is usually a one off command can be initiated with a message [call {function}]

Glad I could help and this will most likely be useful for my own work as well!

Tim Horne's icon

Hi there, I know this is from a while ago I am having the problem and when I use "set selected_chain id xx" it comes back with error "live.object 'DrumChain' object has no attribute 'selected_chain.'"

Can you tell me how got it working, please?

Would really appreciate this. As I have spent a week on it!!!
Thanks.
Tim.

Jdudeo's icon

You need to have a look at the Live Object Model, the object that you're looking for is probably not a DrumChain

Tim Horne's icon

I got it all working now here it is!

Drum Chain Select.amxd
amxd 41.29 KB