🔥 Lifetime deal! Get Control Surface Studio for Just £67 👉 Click Here To Get It
Time left... mailtimers.com
⚠️ Lifetime licenses are ending soon, get yours before they're gone ⚠️
Your shopping cart is empty.

Using the LOM to grab control from a script

Submitted by gross9978 on Mon, 09/06/2021 - 18:18
gross9978
Control Surface Studio User

Hi, I’ve made several scripts that have all worked well using CSS, that parts great. My question has to do with using max for live and the LOM to grab parts of my script for use in certain devices. Normally I can grab controls from a script temporarily, on a push 2 it’s pretty straight forward and the controls can be listed in the Max console but when I do the same thing with a script I wrote for a midifighter twister I get a return of “0” controls only component IDs. My understanding is that the controls have to be written into the script in order to show up that way. Finally my question haha- Does CSS write the controls into the script this way or is there an extra step I’d need to take in CSS to enable this? Hopefully that made since, thanks for any help:)

Topic Category: 

1 Responses

Comments

JohnC
Forum Admin
#1

Hi
(sorry for the slow reply, I did write one a while ago but must not have posted it - oops)
Due to the configurable nature of Control Surface Studio, our mappings don't actually get 'attached' to parameters in the same way other scripts do. Each time you press a button/turn a knob etc, our mappings update the value of the parameter - they're not continually connected to the param, this is due to limitations mentioned below.
So its correct that the max console would return 0.

If you want to use the standard (none control surface studio) method of attaching Live parameters to inputs on your midi controller, this should now be possible with Reactions - but note its untested at the moment.
The pros and possible cons of doing this:
Pros - you get the standard bi-directional integration between controller input and Ableton Live parameter. These mappings 'exit' in max4live console (as you mentioned
Cons - the limitations, you can't set max and min values i.e. like with the volume mapping type. you can't set multiple mappings to an input on controller (this was an issue in older versions of Live 9 and possibly 10, not 100% sure this is still the case in 11). Device params are limited to 8 (or possibly 12 in Live 11 - untested tho)

Leading on to a related topic, using Reactions in order to add mappings via Live's 'Framework'...
Taking the above pros and cons into account, if using the Live framework method is the way you want to go, then this can be done within a Reaction like so:
In a Reaction, for the listener select 'script - script is initalised'
In the Action Block's Action section, click the 'switch to custom' button and enter the framework code (see attached image for an example)
This code is attaching a button on my midi controller to the mute on/off of the selected track.
Note: this portion of the code 'self.midi_cc_ch_12_val_3' is the variable name of the button - it must be added/exist in the controller template

This is getting a bit too 'cody' but just wanted to show quick example of how the framework can be utilised reactions :)