Automatically map midi controller to Live devices/vst of selected Ableton track

Dan Sim's icon

Could someone please point me in the right direction to solve this: I have a midifighter twister that I would like to automatically map to certain device/vst control on the currently selected track in Ableton. Basically I'm trying to replicate the user flow of the Softube Console-1 in a more compact form factor. I have so far spent one night digging into the Live Object Model both with a `js` object and through regular patching but my max experience is next to none. Any help would be greatly appreciated!

Mark's icon

you could have a look in the last patch i have posted in this topic:
https://cycling74.com/forums/is-it-possible-to-focus-view-on-a-live-device-using-m4llom
i'm doing something else but you will need to "get" the selected_track in similar way i am "set"ting it. you can ignore the rest of my patch, as it's not relevant.
hopefully someone else can help you on the controller part of the patch.
good luck!

Jan M's icon

It sounds to me writing a control surface script (they are written in pythen as far as I know) directly for live could be a more straight forward option. Unfortunately I have no experience in that but some fellows here in the forum have...

Dan Sim's icon

Ah interesting. I was under the impression that control surface scripts were a bit of a dark art but I’m making quick progress already. Thanks

Jay Walker's icon

I love doing this with JS, which makes a ton more sense to me than Python personally. However, there's a bit of a learning curve of course. This function accepts the argument 'upDown' which could either be a 0 or 1 to move the parameter up or down, and staticParam, which defines which parameter number to move.

var selectedDevice = 0; // I set the selected device as a separate variable just in case I want to change it manually.

function dialChange(upDown, staticParam) {
var chosenParamTemp;
var paramValue;
chosenParamTemp = staticParam;
//
switch (upDown) {
case 0:
paramPath = new LiveAPI('live_set view selected_track devices ' + selectedDevice + ' parameters ' + (chosenParamTemp));
paramValue = Number(paramPath.get('value')) - 1;
if (paramValue < 0 ) { // loop around back to highest value
paramValue = 127;
}
paramPath.set('value', paramValue);
post('dialChange DOWN, paramValue', paramValue);
break;
case 1:
paramPath = new LiveAPI('live_set tracks ' + trackNumber + ' devices ' + selectedDevice + ' parameters ' + chosenParamTemp);
paramValue = Number(paramPath.get('value')) + 1;
if (paramValue > 127 && ) { // loop around back to lowest value
paramValue = 0;
}
paramPath.set('value', paramValue);
break;
}
}