A) on each button push, send alternating messages
So for the sake of example:
Message sent by controller when you push the button: Note On - 90 20 7F
First message to send out: CC00 - B0 40 7F
Second message to send out: CC01 - B0 41 7F
Approach:
Use a global variable (here I use
g0) to store the state. If it's 0 (the default value at start-up), send the first message and set g0 to 1. If it's 1, send second message and revert it to 0.
1st way: Use two distinct translators
Code: Select all
Translator 0: Convert Button to first alternating CC message
INCOMING: MIDI 90 20 7F
RULES:
g0=1-g0
if g0!=1 then exit rules, skip outgoing action
OUTGOING: MIDI B0 40 7F
Translator 1: Convert Button to second alternating CC message
INCOMING: MIDI 90 20 7F
RULES:
if g0!=0 then exit rules, skip outgoing action
OUTGOING: MIDI B0 41 7F
Note the way I flip g0. It's the simplest way
2nd way: calculate the message to send in the rules, only use one translator:
Code: Select all
Translator: Convert Button to alternating CC messages
INCOMING: MIDI 90 20 7F
RULES:
if g0=0 then pp=0x40
if g0=1 then pp=0x41
g0=1-g0
OUTGOING: MIDI B0 pp 7F
Note the difference of decimal (normal) numbers and hexadecimal notation: in MIDI messages, MIDI Translator always requires hexadecimal numbers. In the rules, you can enter hexadecimal by prepending "0x" to the number. So "pp=0x40" will set pp to the hexadecimal number 40. However, MIDI Translator will automatically convert rules to decimal, so your rule will eventually say "pp=64". 64 is the decimal representation of hexadecimal 0x40.
Florian