Need to build simple device for selecting scene index via MIDI CC value

Andre Griffin's icon

Hello. I am new to MAX, and was previously using hacked remote scripts, but have found them unreliable.

I am in need of a device that will select a scene when given a MIDI CC with a specific value. For example, an input of CC#112 value 0, selects the first scene in my set, CC#112 value 5 selects the 4th scene, etc... This can almost be done by just mapping a control to the scene select button in Ableton, but it does not work with absolute values. Any help to get me pointed in the right direction would be greatly appreciated.

Lee's icon

Hi, use the midiin and midiparse objects to process midi messages. Create a 'path live_set scenes X' message where X is your scene number and pass that into a live.path/live.object pair. Then send a 'call fire' message into the live.object

Evan's icon

But what if he wants to select a scene but not fire it?
I know you can do this via js/python scripts, but I couldn't find an easy way using just live.objects.

S4racen's icon

Set_highlighted_scene i think, it's in the LOM and theres an example in the help options that can be used to achieve this...

Cheers
D

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

Ah!Found an easy way.
I didn't know that you can dynamically set children. i.e. you can call 'set selected_scene id X' on the live_set view object to change the selected scene.The trick here is that you will have to get the id of the scene you want to select:

I overlooked this before because getinfo doesn't report selected scene as a property anywhere, just a child. I thought that you can only 'set' properties. Perhaps children and properties are just different names for the same thing? In any event, thanks for pushing me in the right direction. I learn something new every day here.

Andre Griffin's icon

Thank you all! All I needed to do was add a "ctlin 112" to the front of your example and patch the value output to the index value and it works perfectly. I'll have to figure out how to set the ctlin cc to a dial for flexibility at some point, but you've saved me a huge amount of time and have made me real excited about Max!