OK, this gets a bit more complex. What you are talking about is radio buttons. Although this can be done with multiple global variables, it is a bit of a challenge to using Logic (if, or etc) to make it work. For this reason, I use the global variable ‘ga’ as a button map for buttons 2-4 on the top row. So if the value of ga to 1 then button 2 is lit, ga=2 then button 3 is lit and ga=4 then button 4 is lit.
Binary logic values are 1,2,4,8,16,32 etc. for bit positions 0,1,2,3,4,5 etc.
I initialize the button value the way I want in translator 0.4. Then I trigger a repeating timer 3 times (variable gb) called "Refresh Radio Group 1. This is done in translator 0.5. Then translator 0.6 does all the work of figuring out which bit is set and only lighting the bit that we want.
// decrement counter
//Calculate which note
// get the bit value
// and with 1 to only get the bit
// and set the color
if tt==1 then qq=15
Then after initialization, you press buttons 2.4 on the top row and translator 2.2 kicks in. It looks to ensure the value is 42-44 and if it is outside the range it does nothing. Then it subtracts 42 to get the bit number and sets the value of ga based on which bit is set.
// Look for buttons 42-44 only
if pp<42 then exit rules, skip Outgoing Action
if pp>44 then exit rules, skip Outgoing Action
// subtract to get the bit position
// stuff the single bit into ga
// set counter
Finally it triggers the same repeating timer (translator 0.6) to iterate through the buttons again. Since we are only setting one bit in translator 2.2, this guarantees only one light is lit.
I’m sure there are other ways to do it. It is a bit difficult to set up but it is quite reliable once set up correctly. If you are using other buttons, of course you would need to change the note numbers to trigger the changes and change the calculations on the bit positions.
Rekordbox-LaunchControl-X-Radio-ButtonsL.bmtp (6.6 KB)
Bome Customer Care
Also available for paid consulting services: email@example.com