For some reason, I need two latch-style buttons in Touchable to turn an Ableton Live device on and off: one to turn the device on, and the other to turn it off.
Below is what the MTP Log Window shows when I operate these two buttons…
The first button that turns the device on sends this midi data:
1: MIDI IN [touchAble]: 90 70 7F
2: IN 0.0 Note On on ch. 1 with any note set ‘pp’ to note=112 with any velocity and ‘ga’ to velocity=127
3: RULE 0.0 condition satisfied: if pp==112 then rr=57
4: RULE 0.0 assignment: (if pp==112 then rr=57) = 57
5: RULE 0.0 condition satisfied: if pp==112 then qq=127
6: RULE 0.0 assignment: (if pp==112 then qq=127) = 127
7: MIDI OUT [Bome MIDI Translator 2 Virtual Out]: B1 39 7F
8: OUT 0.0 Control Change on ch. 2 with CC#:rr=57 and value:qq=127
9: MIDI OUT [Bome MIDI Translator 2 Virtual Out]: 90 70 7F
10: MIDI IN [touchAble]: 90 70 00
11: IN 0.2 Note Off on ch. 1 with any note=112 and any velocity=0
And the second button that turns the device off sends this midi data
1: MIDI IN [touchAble]: 90 71 7F
2: IN 0.0 Note On on ch. 1 with any note set ‘pp’ to note=113 with any velocity and ‘ga’ to velocity=127
3: RULE 0.0 condition satisfied: if pp==113 then rr=57
4: RULE 0.0 assignment: (if pp==113 then rr=57) = 57
5: RULE 0.0 condition satisfied: if pp==113 then qq=0
6: RULE 0.0 assignment: (if pp==113 then qq=0) = 0
7: MIDI OUT [Bome MIDI Translator 2 Virtual Out]: B1 39 00
8: OUT 0.0 Control Change on ch. 2 with CC#:rr=57 and value:qq=0
9: MIDI OUT [Bome MIDI Translator 2 Virtual Out]: 90 71 7F
10: MIDI IN [touchAble]: 90 71 00
11: IN 0.2 Note Off on ch. 1 with any note=113 and any velocity=0
I’m hoping there is a better way to do this that involves only a single latch style button that: turns the device on when pressed the first time; and when pressed the second time, turns the device off.
Any thoughts on what to do differently to make this work with a single button? If not, could we use the IF statement to solve this? When the button is pressed the first time, MTP sets a variable flag that indicates the device is on; and when the same button is pressed the button a second time, MTP sees that the flag is set, and so sends the right code to turn the device off, and then clears the flag?
Many thanks.