Global variable for defining MIDI input doesn´t work

akamed

2013-02-14 15:30:18

Hello,
I´m trying to use a variable to define the MIDI events triggers at the beggining of the code, but I can´t make it work.
I define global variables on the first translator for the triggers I want to assing later, something like "gg=69" and so, after this, I can use this variable in multiple lines.
But It doesn´t work. The trigger input used later is something like...Incoming trigger: "99 gg pp"
The "pp" works but the "gg" doesn´t.
Anybody have any idea?

metastatik

2013-02-21 19:29:30

If you use a global variable in an Incoming message, the incoming message will set the value of the global variable. It doesn’t sound like that is what you’re trying to do.

If you want to use a global variable to define the note number a translator should respond to, use something like this (assuming you’ve set the value of the global variable elsewhere):

Code: Select all

Incoming: 90 qq pp
Rules:
if qq != gg then exit rules, skip Outgoing Action
Outgoing: whatever

akamed

2013-02-24 15:29:52

Thanks and sorry, metastatik. :)
I had the problem working on the outgoing events, not with the incomig events.
I was confused about the hex and dec in variable´s results and the outgoind midi events... because the variables results are in dec and the midi outgoing notes are in hex.
Thanks!