Passing Variables

AndrewS

2016-11-12 20:45:06

I have an issue I've been trying to solve for some time now. While researching online I found out about the Midi Translator. I've spent some time with the demo copy but can't seem to find a way to do what I want. Hoping I can find some guidance here :)
First I need to store the incoming preset number and perform an action - then whenever a subsequent CC#34 (val=0-4) message is received evaluate it with respect to the stored preset number and send out the derived PC#.

Say a preset PC#007 message is received on midi channel 1 - store this value and transmit a program change PC#31 on midi channel 2 (I can get this part working)
Next in a separate event also received from midi channel 1 - CC#34=3 is recieved
Now I need to recall the current PC# value and do something like this
IF current preset=007 AND CC#34=3 send on midi channel 2 a program change PC#33

The incoming CC#34 vals are always between 0-4

Here is a bit of a map - I'd need to repeat this for about 50 presets
PC#001 in on midi ch1 >send out> PC#000 on midi ch2
CC34#0 in on midi ch1-> Evaluate stored PC#001 & CC34#0 – send out> PC#000 on midi ch2
CC34#1 in on midi ch1-> Evaluate stored PC#001 & CC34#1 - send out > PC#001 on midi ch2
CC34#2 in on midi ch1-> Evaluate stored PC#001 & CC34#2 - send out > PC#002 on midi ch2
CC34#3 in on midi ch1-> Evaluate stored PC#001 & CC34#3 - send out > PC#003 on midi ch2
CC34#4 in on midi ch1-> Evaluate stored PC#001 & CC34#4 - send out > PC#004 on midi ch2

PC#002 in on midi ch1 >send out> PC#005 on midi ch2
CC34#0 in on midi ch1-> Evaluate stored PC#002 & CC34#0 – send out> PC#005 on midi ch2
CC34#1 in on midi ch1-> Evaluate stored PC#002 & CC34#1 - send out > PC#006 on midi ch2
CC34#2 in on midi ch1-> Evaluate stored PC#002 & CC34#2 - send out > PC#007 on midi ch2
CC34#3 in on midi ch1-> Evaluate stored PC#002 & CC34#3 - send out > PC#008 on midi ch2
CC34#4 in on midi ch1-> Evaluate stored PC#002 & CC34#4 - send out > PC#009 on midi ch2

... and repeat (each time the outgoing PC# are incremented by 5)

Any pointers would be greatly appreciated :D

Andrew

sjcaldwell

2016-11-12 22:54:16

just make sure it is a global variable and it should work. Try ga.

Variables with same letters (ie pp,qq,rr) are local variables and do not retain their value after leaving the given translator.

From the manual
Local Variables are defined by character combinations in the following
range:
oo-xx (example: pp, ss, ww, etc...)...

Global variables are defined by two-character combinations in the following
ranges:
ga-gz/g0-g9, ha-hz/h0-h9, ..., na...n9, and ya-y9, za-z9
Variable names where both letters are the same are local variables.

AndrewS

2016-11-13 05:21:44

Thanks so much for you r advice - I have the first 2 presets working now - next step print the manual and go thru it with a marker pen!! :D