LOM: Set focus to this device- Possible?

Michael DeFiore's icon

Hi,

I'm pretty good with Max, but despite trying for several hours I can't get my head around the LOM at all.

I'm making a patch that sets focus to a specific device based on an incoming MIDI cc (not using the MIDI Map feature of Live but actual incoming MIDI CC on the track).

I have the MIDI CC part done but I can't figure out how to make Live set focus to the device itself. Can the LOM be used to issue a command like "Set focus to the device that this patch is part of"?

Is this possible?

Thanks
Mike

Namakemon's icon

There are select_device and select_instrument functions.

Not sure M4L devices have the concept of "this device/patcher", I think you always have to find out the device's id and use that.

Michael DeFiore's icon

Thanks Namakemon. Got it working.

Select Device 4.amxd
amxd 13.51 KB