Radio Button/Matrix Help

makerprofaze

2012-06-06 05:49:07

Hi all. I've set up a 'matrix' or 'radio button group', but in order to deactivate the presently activated button, I have to bang/deactivate All the buttons. I'm wondering how I could add a variable to discretely turn off the active button then activate the next in a simpler manner.

Here is a short form example.

Translator 0.0: Btn 0 In
Options: stop=false
Incoming: MIDI 90 00 7F
Rules:
ga=0
Outgoing: Select Timer

Translator 0.1: Btn 1 In
Options: stop=false
Incoming: MIDI 90 01 7F
Rules:
ga=1
Outgoing: Select Timer

Translator 0.2: Btn 2 In
Options: stop=false
Incoming: MIDI 90 02 7F
Rules:
ga=2
Outgoing: Select Timer

Translator 0.3: DeActivate LED
Options: stop=false
Incoming: One-shot timer "Select Timer"
Outgoing: MIDI 90 00 00 90 01 00 90 02 00

Translator 0.4: Activate LED
Options: stop=false
Incoming: One-shot timer "Select Timer"
Outgoing: 90 ga 7F


The thing is that I have 64(+) nodes in some matrices and, while this method does work effectively, sometimes it causes audio to hiccup as multiple matrices are switching at the same time and sounds are simultaneously being triggered from the same core event.

I've been trying to formulate a second global variable to hold the active global variable numeric, but I can't figure out the order/timing to make it work.

Any input is greatly appreciated.

metastatik

2012-06-06 15:13:00

Your ga variable stores the note number that needs to be deactivated, so just deactivate it (or temporarily store it) before storing a new value in ga. There are several ways to do that. Here’s an example using a temp variable (pp):

Code: Select all

Translator 0.0: Btn 0 In
Options: stop=false
Incoming: MIDI 90 00 7F
Rules: 
pp=ga
ga=0
Outgoing: MIDI 90 pp 00 90 00 7F
Also, you don’t need translators for each note. To handle all three in a single translator:

Code: Select all

Translator 0.0: My Button Group In – Notes 0-2 on ch1 – (ga)
Options: stop=false
Incoming: MIDI 90 qq 7F
Rules: 
if qq > 2 then exit rules, skip Outgoing Action
pp=ga
ga=qq
Outgoing: MIDI 90 pp 00 90 ga 7F

makerprofaze

2012-06-08 05:50:26

Wonderful. Storing a global variable in a temporary one to move it around in the rules- I missed that - and so simple.

This helped me with one matrix perfectly, but the more important one has a whole layer of input and output timers to allow simultaneous trigger events from software and hardware, but I think I've got the concept down enough to rebuild the mess.

Many thanks, if I need more I'll be back...