Program Change Toggle

smokey

2012-02-15 00:55:00

I read through the forums, created some translatore, but no success.

Here is what I would like to do...

My Hardware:

I have a Behringer FCB1010 foot controller with the UnO firmware chip installed. The 10 foot switches on the unit send MIDI program changes C0 00 through C0 09.

My Software:

Reason 6. Buttons in Reason respond to MIDI Control Change messages, 127 (7f) to turn on, and 0 to turn off.

My MT preset:

I have the 10 foot switches outgoing as CC messages. Easy. However, each going message is 7f. Therefore, the buttons in Reason only turn on, but do not turn off.

What rules do I need to create so that the outgoing CC messages toggle between 7f and 0?

Max Oepen

2012-02-15 22:03:40

If you want it to just toggle, I would always favor a keystroke assignment in Ableton Live over midi cc.
So have the "outgoing message" in the tranlator set to keystroke.

If you do want to achieve the same effect with midi cc in MT Pro, it gets a good bit more complicated.

- As a possible example, you could setup up two different presets.
- Each one has that same translator, only one of them with 00 and the other with 7F as "outgoing".
- Then you setup another pair of translators that enables the other preset when the "incoming" message is received and disables the current one.

That would create the toggling effect you describe. But again, keystroke assignments for toggling buttons are so much easier...

Max.

DvlsAdvct

2012-02-16 16:51:31

Hi Smokey.

If you want to do this you can use Rules and Varialbes in MT Pro to cycle through the outgoing messages. It would look something like this:

Code: Select all

Translator Name: CC 0
Incoming Message: B0 00 7F
Rules:
g0=g0+1
if g0==1 then Goto "127"
if g0==2 then Goto "0"
"127"
pp=127
Exit rules, execute outgoing action
"0"
pp=0
g0=0
Exit rules, execute outgoing action
Outgoing Action: B0 00 pp
The outgoing message can be changed to whatever you want it to be, it doesn't need to be 00 pp. For each of the 10 pedals you'll need to use a different variable so they don't overlap, so g0, g1, g2, g3, etc..

Make sense?

Max Oepen

2012-02-17 07:18:45

DvlsAdvct's example makes mathematical sense and does work, IF you add the word "Label" to the jump destinations.
He definitely had the right idea, and it is more elegant than my previous suggestion.
The following does work as well and is even shorter, using the global variable in the outgoing message:

Code: Select all

INCOMING:
C0 00
RULES:
if ga==127 then Goto "OFF"
if ga==0 then Goto "ON"
Label "ON"
ga=127
Exit rules, execute outgoing action
Label "OFF"
ga=0
Exit rules, execute outgoing action
OUTGOING:
B0 00 ga
And as DvlsAdvct he said, use a different global variable for each pedal.

Max

DvlsAdvct

2012-02-17 23:05:07

Yeah, forgot about "Label"

And Max's way will work too. The way I posted was just my personal preference.

hungaristan

2012-02-20 12:24:10

I'm humbly begging for forgiveness, but I'm not an active MT user and I'm not familiar with the rules syntax and being forced to master so many other tools (Max, KSP etc.) I don't even have a chance to study MT. But I have an urgent task nearly identical to the one in this thread, so maybe one of you could help me with that. My FCB1010 sends out Note messages, which then should be translated into key combinations Ctrl(0) and Ctrl(9) in a toggling manner (to change the global quantize value dynamically in Live).

Thanks for any input.

Max Oepen

2012-02-20 20:59:23

hungaristan wrote:... My FCB1010 sends out Note messages, which then should be translated into key combinations Ctrl(0) and Ctrl(9) in a toggling manner (to change the global quantize value dynamically in Live).
You're trying to do it with the default key strokes Ctrl(0) & Ctrl(9), and that won't work in a single translator like in the OP's case since key-strokes don't allow for variables.

Instead do it with MIDI mapping, here's how:
There are 14 values to choose from on the "global quantization" button/menu in Live.
128 / 14 = 9.14
Your two desired values (Ctrl+0="none" & Ctrl+9="1 bar") are positions "1" and "5" on that menu.
SO, for "none" use outgoing value "0", for "1 bar" use outgoing value "40" (between 9.14*4 and 9.14*5)
Try it, it works (I just did). Here is the example code:

Code: Select all

Translator Name: Toggle Global Quantization value
INCOMING: 90 30 pp
RULES:
g0=g0+1
if g0==1 then Goto "none"
if g0==2 then Goto "1 bar"
Label "none"
rr=0
Exit rules, execute outgoing action
Label "1 bar"
rr=40
g0=0
Exit rules, execute outgoing action
OUTGOING: B0 00 rr
:D

Max

hungaristan

2012-02-21 01:59:35

Thanks Max, it really works. In the meantime I tried to get the job done with 2 translators, which both work fine separately, but for some reason the don't work together. Just out of curiosity could someone tell what I'm doing wrong?

Translator 1:

Incoming: a note I press on the FCB.

Rules:
if ga==0 then Goto "Ctrl9"
if ga==1 then Goto "Exit"
Label "Ctrl9"
ga=1
exit rules, execute Outgoing Action
Label "Exit"
exit rules, skip Outgoing Action

Outgoing: Ctrl(9)

Translator 2:

Incoming: the same note as the one used in Translator 1.

if ga==1 then Goto "Ctrl0"
if ga==0 then Goto "Exit"
Label "Ctrl0"
ga=0
exit rules, execute Outgoing Action
Label "Exit"
exit rules, skip Outgoing Action

Outgoing: Ctrl(0)

It switches the global quantize in Live once but then it does nothing more.

metastatik

2012-02-21 03:29:23

The problem is that both translators are being triggered each time the note message is received and your rules are structured such that both outgoing actions will be sent out each time. The process looks like this (with steps 2 and 3 happening nearly simultaneously):

1. ga starts at 0.
2. Translator 1 sets ga=1 and sends Ctrl+9.
3. Translator 2 sets ga=0 and sends Ctrl+0.

So, there is no toggle happening at all. The result is basically the same as just sending Ctrl+0.

In Translator 1, try something like this for the rules:

Code: Select all

ga=1-ga
if ga==1 then exit rules, skip Outgoing Action
Then, in Translator 2, you can just check the value of ga.

Code: Select all

if ga==0 then exit rules, skip Outgoing Action
So now you have:

1. ga starts at 0.
2. Translator 1 sets ga=1 and exits.
3. Translators 2 sends Ctrl+0.

And the next time around:
1. ga is at 1.
2. Translator 1 sets ga=0 and sends Ctrl+9.
3. Translator 2 exits.

The process will continue to alternate in this way.

As an aside, you can also use the toggle rule (ga=1-ga) in the other translators in this thread. For example, the last translator Max posted could be written like this:

Code: Select all

INCOMING: 90 30 pp
RULES:
g0=40-g0
OUTGOING: B0 00 g0