florian wrote:As fanboi proposes, using Rules is probably the most straight forward way:
the scheme would work like this:
1) define a global variable (say "ga") as a counter that always increments when you press a MIDI button.
2) the counter wraps, i.e. when it reaches 4, it is reset back to 0
3) 4 individual translator entries check the counter. Each translator entry outputs a different keystroke, and they only trigger if the counter equals the keystroke
how to do it in MT:
Code: Select all
Translator 1: Output NUM1 if ga=0
INCOMING: MIDI <midi message for the MIDI button>
RULES:
if ga!=0 then exit rules, do not execute action
OUTGOING: KEYSTROKE NUM1
Translator 2: Output NUM2 if ga=1
INCOMING: MIDI <midi message for the MIDI button>
RULES:
if ga!=1 then exit rules, do not execute action
OUTGOING: KEYSTROKE NUM2
[...]
Translator 5: Increment Counter
INCOMING: MIDI <midi message for the MIDI button>
RULES:
ga=ga+1
if ga>=4 then ga=0
OUTGOING: <none>
Hope that helps!
Florian
just stumbled over this one, and it's great! just what i needed to flip through my fx bank.
now, i tried to make a preset to have another button cycle the opposite way:
Code: Select all
Translator 0 :New Translator
Options: 1 rules
Incoming: MIDI 90 3C 7F
Rules:
if ga!=0 then exit rules, skip Outgoing Action
Outgoing: MIDI Bf 17 00
Translator 1 :New Translator
Options: 1 rules
Incoming: MIDI 90 3C 7F
Rules:
if ga!=1 then exit rules, skip Outgoing Action
Outgoing: MIDI Bf 17 06
Translator 2 :New Translator
Options: 1 rules
Incoming: MIDI 90 3C 7F
Rules:
if ga!=2 then exit rules, skip Outgoing Action
Outgoing: MIDI bf 17 0e
.......
Translator 15 :New Translator
Options: 1 rules
Incoming: MIDI 90 3C 7F
Rules:
if ga!=15 then exit rules, skip Outgoing Action
Outgoing: MIDI Bf 17 80
Translator 16 :New Translator
Options: 2 rules
Incoming: MIDI 90 3C 7F
Rules:
ga=ga-1
if ga!=0 then ga=15
Outgoing: (none)
(please don't mind the messy midi messages
).
it works fine, but if use both presets together, i get strange behavior from mt.
if i cycle forward and then backward i get a forward jump on the first press of the backward key, and vice versa. for example:
forward 1,2,3,4,5 backward 6,5,4,3 forward 2,3,4,5
any clues on what's going on?