Hi there,
So I have got a row of buttons that behave on the same way, to simplify lets just think that they are 2 buttons.
buttonOne
modButton
buttonOne
sends different MIDI messages depending if modButton is hold pressed or not (that is already achieved).
"type": "button",
(...)
"id": "buttonOne",
(...)
"colorFill": "JS{{
// colorWidget property
var c = globals.midmixLedColors1(OSC{/note} || [0 , 87]);
return 'hsl(' + c[0] + ',100%,' + c[1] + '%)';
}}",
(...)
"on": 127,
"off": 0,
"mode": "tap",
"doubleTap": false,
(...)
"address": "/note",
"preArgs": [
1,
4
],
(...)
"target": "midi:virtual-midimix",
"ignoreDefaults": false,
"bypass": false,
"script": "if((get('modButton') == 1)) {
send('midi:virtual-midimix', '/note', 1 , 5 , 127);
} else {
send('midi:virtual-midimix', '/note', 1 , 4 , 127);
}"
And the modifier button is achieved like this
"type": "button",
(...)
"id": "modButton",
(...)
"on": 1,
"off": 0,
"mode": "push",
"doubleTap": false,
(...)
"address": "/note",
"preArgs": [
1,
27
],
(...)
"target": "virtual-midimix",
The issue is that , I want upon holding press the modButton
, to alter the colorWidget
of buttonOne
straightaway , according to the veloctiy it has received in the other note that is sending (in this case note num 5)
I have thought on creating a variable Widget , with its address , preArgs and target setted to listen to those alternative noteins events such as
"type": "variable",
"id": "solo01",
(...)
"address": "/note",
"preArgs": [
1,
5
],
(...)
"target": "midi:virtual-midimix",
Then re-write the colorWidget
property of buttonOne
with the following syntax
(...)
"colorFill": "JS{{
// colorWidget property
if((get('soloButton') == 1)) {
var c = globals.midmixLedColors1(get('solo01') || [0 , 87]);
} else {
var c = globals.midmixLedColors1(OSC{/note} || [0 , 87]);
}
return 'hsl(' + c[0] + ',100%,' + c[1] + '%)';
}}",
It looks to be not working for probably obvious reasons. Do you figure out a way to achieve this?
Thank you