Modifier Setup (Shift button)

Padbangers

2015-06-01 21:15:39

Hi guys,
I read through a lot of topics but I'm terrible at programming and hope you guys can help me out.
I have some trouble setting up a variable as a modifier. I know how it works in theory but I can't translate it to the programming language.
So what I'm trying to do is give a button on my controller two functions depending of the condition of the modifier key.

So when I hold down the Shift button (a midi button, not on the keyboard) a variable should go to 1, when I toggle it again it should go back to 0.

Depending on the state I should be able to programm other functions.

Now how do I have to write the condition and how does a "if then" function has to look like?

Thank you in advance!

DvlsAdvct

2015-06-01 21:29:13

Hi PadBangers

There are a few things we need to do, but they aren't very hard. First we're going to have the button toggle a shift, and then you'll need to put a modifier in every translator it effects. So... the shift button looks like this:

Code: Select all

Translator 1: Shift
Incoming Message: 90 30 7F [i]//I am just using this as an example. Use any MIDI signal you want, just be sure the last byte of data (7F here) is the signal the button sends when you press it[/i]
Rules: g0=g0+1
if g0>1 then g0=0
Outgoing Message: None
This way your global variable g0 will cycle between 0 and 1 every time you press it. Then you just reference g0 in the translators you are using with the line

Code: Select all

if g0!=0 then exit rules, skip outgoing action
if you don't want to process the translator when g0=0

Does that make sense?
Thanks
Jared