Mutually Exclusive Buttons - APC20

Thanks a lot for the quick response and support Steve.

Need another help.
I need to group few buttons.
Ex : 4 Buttons
Button 1 is ON,
When I press Button 3, Button 1 Should go off.
Only 1 Button can be ON at a time.

:blush:

Thank you a lot once again.

Hi, since this is a different request, I’ve moved this to a new topic.

The below project file should help albeit mutually exclusive buttons are a bit more complex.

Here I use the global variable ga to hold the button states of 4 buttons. I use bits 0-3 to hold the state of each button. I then look at the incoming MIDI channel that designates the column and use that to shift the bit into position. Once I’ve update the state of ga, I trigger a timer 4 time (using variable gb) to iterate through the note messages updating all four LED.s

Here are the rules of the first translator:

// Channel number is column number
// We use a bit map to determine each button
// We will use ga
// determine bit
// Only do for first 4 buttons
if oo>3 then exit rules, skip Outgoing Action
// shift it
rr=1<<oo
// Set it
ga=rr
//gb is the timer counter
gb=4
Log "Timer----"

Again it triggers a timer gb times

Here are the rules of the timer translator that iterates through the note messages:

// get bit
gb=gb-1
// get bit
rr=ga>>gb
// Look at only one bit
rr=rr&1
qq=0
if rr==1 then qq=127

Again since I don’t have an APC-20. I used a different controller to test. In the case pressing the same button a second time does not change anything. You need to press one of the other buttons. Then all the other LEDs will turn off.

Mutually-Exclusive-Button-APC20.bmtp (1.6 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thank you very much again Steve.
I’ll give this a try and let you know.

Best regards.