alternate between 2 keys depending on a CC increase/decrease

mliuzzi

2009-05-05 10:17:43

I've been pulling my hair out to get this working, tried rules, tried timers with different variables set, can't figure it out...anyways

My goal is really simple, I have a foot pedal, which is sending channel volume (MIDI CC)...

I want MT to send the closed bracket when I increase the value, and the open bracket when I decrease it.



my strategy so far is get MT to assign and evaluate 2 variables, one that is from the previous message, and one that is from the present message. I can't freakin figure out how to get MT to do this.

thanks in advance

florian

2009-05-12 00:16:21

Hi mliuzzi, that's the correct strategy. I'm not sure what your pedal sends, I assume CC #7 (i.e. B0 07 xx).

Do it similar to this:

Code: Select all

Translator 1: Calc direction in ga, store last value in gl
Incoming: MIDI B0 07 pp
Rules:
 ga = pp - gl
 gl = pp
Outgoing: [none]

Translator 2: send closed bracket
Incoming: MIDI B0 07 pp
Rules:
 if ga > 0 then exit rules, execute outgoing action
 exit rules, skip outgoing action
Outgoing: Key ]

Translator 3: send open bracket
Incoming: MIDI B0 07 pp
Rules:
 if ga < 0 then exit rules, execute outgoing action
 exit rules, skip outgoing action
Outgoing: Key [
Hope this works!
Florian