I have successfully changed the toggle state of buttons by using the following script:
if (value ===1){
set ('legato',0)
set ('spiccato',0)
set ('staccato',0)
set ('marcato',0)
set ('tremolo',0)
set ('sustains_mute',0)
set ('legato_mute',0)
set ('spiccato_mute',0)
set ('spiccato_tap',0)
set ('pizzicato',0)
set ('bartok',0)
send('midi:OSC','/program',1,1)
}
So when I press the sustains button, for example, it lights up, and the legato button (or whichever button is currently lit) goes dark. It works beautifully.
But here's the problem. I tried doing the same with my transport buttons and got strange behavior.
Record
Play
Pause
Stop
I used the same script, but modified send to /control as follows (this one for the 'record' button):
if (value ===1){
set ('play',0)
set ('pause',0)
set ('stop',0)
send('midi:OSC','/control',16,1')
}
Unfortunately, this gets no response from my DAW. If I put the "send" command values in the OSC section, the DAW responds, but the buttons sometimes send out the wrong CC values.
Basically what I'm trying to do is get Record to light up when I'm recording, play to light up when I'm running playback, while the others go dark. I'm not sure why it works for the first set of buttons using the /program command, but not with the second set using the /control command.
Hopefully this all makes sense.