automatic reverse roule formula

ghibson

2009-05-22 15:37:33

I have recently used Midi Translator 1.7 trial it's great!. I'm not one midi expert user , make one roule like this:

Translator 1: on off cue ch 1-8
Options: stop=true
Incoming: MIDI F0 43 10 3E 0F 03 3D 05 01 00 00 00 00 vv F7 F0 43 10 3E 0F 03 3E 01 qq 00 00 00 00 ww F7 F0 43 10 3E 0F 04 48 01 03 00 00 00 00 ww F7
Rules:
if qq>=9 then exit rules, skip Outgoing Action
xx=qq+8
Outgoing: MIDI B0 xx ww

The reverse roule :

Translator 2: rev on off cue ch1-8
Options: stop=true
Incoming: MIDI B0 oo xx
Rules:
if oo==9 then Goto "f1"
if oo==10 then Goto "f2"
if oo==11 then Goto "f3"
if oo==12 then Goto "f4"
if oo==13 then Goto "f5"
if oo==14 then Goto "f6"
if oo==15 then Goto "f7"
if oo==16 then Goto "f8"
exit rules, skip Outgoing Action
Label "f1"
qq=1
Goto "assww"
Label "f2"
qq=2
Goto "assww"
Label "f3"
qq=3
Goto "assww"
Label "f4"
qq=4
Goto "assww"
Label "f5"
qq=5
Goto "assww"
Label "f6"
qq=6
Goto "assww"
Label "f7"
qq=7
Goto "assww"
Label "f8"
qq=8
Label "assww"
if xx==0 then Goto "0"
if xx>=1 then ww=1
vv=2
exit rules, execute Outgoing Action
Label "0"
ww=0
vv=0
Outgoing: MIDI F0 43 10 3E 0F 03 3D 05 01 00 00 00 00 vv F7 F0 43 10 3E 0F 03 3E 01 qq 00 00 00 00 ww F7 F0 43 10 3E 0F 04 48 01 03 00 00 00 00 ww F7

the first Roule is easy, the second is the reverse, and it is much more complicated, I would write only the first and automatically BMT make the opposed Roule
Thank you

Alessandro



Also I would like to see a way to define global variables using a table.
The table would display all of the variables available, indicating which ones are in use, and allow me to enter a description for any variable so they're easier to keep track of.

Thank you

Chris

florian

2009-05-23 10:22:58

Hi Alessandro,

although I see that it would be very useful to have a "reverse Rule", it would be mathematically impossible to implement it...

Anyway, there is a way to make your inverse rule set much easier. Check this out:

Code: Select all

Translator 2: rev on off cue ch1-8
Options: stop=true
Incoming: MIDI B0 oo xx
Rules:
qq=0
if oo==9 then qq=1
if oo==10 then qq=2
if oo==11 then qq=3
if oo==12 then qq=4
if oo==13 then qq=5
if oo==14 then qq=6
if oo==15 then qq=7
if oo==16 then qq=8
if qq=0 then exit rules, skip Outgoing Action
if xx==0 then Goto "0"
ww=1
vv=2
exit rules, execute Outgoing Action
Label "0"
ww=0
vv=0
Outgoing: MIDI F0 43 10 3E 0F 03 3D 05 01 00 00 00 00 vv F7 F0 43 10 3E 0F 03 3E 01 qq 00 00 00 00 ww F7 F0 43 10 3E 0F 04 48 01 03 00 00 00 00 ww F7 
And if there is such a "simple" relationship between oo and qq, you can just calculate it:

Code: Select all

Rules:
qq=oo-8
if qq<1 then exit rules, skip Outgoing Action
if qq>8 then exit rules, skip Outgoing Action
if xx==0 then Goto "0"
ww=1
vv=2
exit rules, execute Outgoing Action
Label "0"
ww=0
vv=0
Hope that helps!
Florian