Programming Bank Up or Bank Down

mattz

2013-03-20 05:44:22

Hi,

Is it possible for MT Pro to keep track of a variable (in this case a bank number) and increase it by one with each incoming message? The idea is to turn 2 buttons on my foot controller into bank up and bank down buttons. The foot pedal is an NI Rig Kontrol 3 operating in Midi Mode. The banks being changed are in the Guitar Rig 5 plugin--as mentioned earlier in this forum, these banks are called "Tags."

So, the first time I press the button, I'd want it to give a "switch to Bank 2" command. The next time I press it I'd like it to give the "switch to bank 3" command. The button immediately next to that would give a "switch to one bank lower" command.

Something like this, if I'm starting from Bank One:
Incoming: B0 00 00 B0 20 00 C0 00
Outgoing on the first push: B0 00 01 B0 20 01 C0 00
Outgoing on the second push: B0 00 02 B0 20 02 C0 00

So basically, a "Bank +1" and a "Bank -1" command with 2 buttons on the foot controller. Of course, if NI had been thorough about their programming for this product none of this would be necessary--Patch Up and Patch down is all they support natively. So I have to press the Next button 24 times to get to patch 25. Lousy. (sorry for the rant)

DvlsAdvct

2013-03-22 00:01:21

Hi mattz

What you want to do is totally doable. :) We need to work with Global Variables and a Timer to have MT remember what state it's in.

So your code would look something like:

Code: Select all

Translator 1: Footpedal 1
Incoming Signal: B0 00 00 B0 20 00 C0 00 
Rules: g0=g0+1
if g0>2 then g0=2
Outgoing Signal: Footpedal Timer

Translator 2: Footpedal 2
Incoming Signal: (the second Footpedal)
Rules: g0=g0-1
if g0<0 then go=0
Outgoing Signal: Footpedal Timer

Translator 3: Footpedal Timer
Incoming Signal: Footpedal Timer
Rules: pp=g0
qq=g0
Outgoing Signal:B0 00 pp B0 20 qq C0 00
So, that only works if those variables pp and qq are always in line with 0 for bank 1, 1 for bank 2 and 2 for bank 3, which is what I THINK your example shows. If not the numbers would be a little different but it wouldn't be totally out of the way. Make sense?