Global Variables + Conditional Functions

Bigchap88

2015-05-10 13:31:20

Hello all,

This is my first post, I have had a read through the forum and you all seem very helpful and patient with the newbies (me being one of them).

The below attachment is my first attempt of mapping. My equipment and software are a Xone K2 midi device, Virtual DJ and a Behringer XR18 with X Air Edit for a PC.

Q1. I have applied a global viable rule (g0) to a mute group with LED feedback from translator 0.23 to 0.29 which is spot on, I tried to apply a similar global variable rule (g1) from 0.30 to 0.34 which doesn't work. I thought the LED feedback was wrong so I have disabled it, but still no joy. Can anyone see where I have went wrong?

Q2. Can I apply conditional logic to certain midi commands?

e.g. Button 1 - When echo is off button will send "on" command, when echo is on button(when momentarily pressed) will send another command, this command will send a "tap beat" message to alter the size of the echo.

Q3. Relates to Q2. Is there any setting I need to adjust to have the midi translator send a sysex OSC command, Behringer haven't gave us a midi command for the "tap beat" but it can be achieved via OSC. OSC via sysex F0 00 20 32 32 TEXT F7, with text being OSC strings in HEX format.

Guys, really hope you can help.

Kind Regards,

Craig.
XR18.txt
(4.02 KiB) Downloaded 159 times

Bigchap88

2015-05-13 20:00:56

OK, maybe too many questions!

Could someone have a look at my coding to help with below:

I have applied a global viable rule (g0) to a mute group with LED feedback from translator 0.23 to 0.29 which is spot on, I tried to apply a similar global variable rule (g1) from 0.30 to 0.34 which doesn't work. I thought the LED feedback was wrong so I have disabled it, but still no joy. Can anyone see where I have went wrong?

DvlsAdvct

2015-05-14 01:51:45

Hi Bigchap88

Sorry for the delay. I've been swamped with various things, but I will try and get to all of your questions.

Question 1: It took me a second but I think I understand what you're trying to do. Since I can't see your MIDI ports here, i'd actually recommend simplifying this quite a bit. Instead of individual translators listening for the outgoing message, have the incoming message just send multiple outgoing actions at once:

Code: Select all

Translator 0.23: Button 2
Options: stop=false
Incoming: MIDI 9E 7E 7F
Rules: Toggle
  if g0==0 then Goto "On"
  if g0!=0 then Goto "Off"
  Label "On"
  g0=127
  exit rules, execute Outgoing Action
  Label "Off"
  g0=0
  exit rules, execute Outgoing Action
Outgoing: MIDI B1 06 g0 B1 04 g0
I THINK that's what you're trying to do. When you press the button you want B1 06 and B1 04 to be sent together, right? This should be cleaner, since it looks like you're having translators communicate to both your controller and back to MT Pro to send out together. Try that for both your g0 and g1 commands.

Question 2: Yes, you can. But the question I have is how will you turn the Echo off? In your example, once you turn the Echo on it will then only control the Tap Beat message.

Q3: Unfortunately, MT Pro cannot handle OSC messages.

Let me know if that helps

Bigchap88

2015-05-14 23:21:29

Thank you so much, I thought that I had to convert by a global variable then receive this from a second translation. A silly mistake, but without your help I would have been lost!

For the "tap echo button", I have a separate button to turn this off. What I (any many other users of Behringer digital mixers) would like to achieve would be the following:

First press would start a count
Second press would stop the count and apply the value of this to a midi message.

From a previous post I found the following rule:

uu=qq/128
vv=uu*128
vv=qq-vv - this calculation was applied to a sysex command at the appropriate parts of the string.

This appears to be quite specific to the users values. I my circumstances I have limited the variables of my own sysex message down to 2 entries, similar to the post which I took the above rule from. Below is the sysex strings which corresponds to the length of the echo, it actual ranges from 3000 down to 0001 but this can be limited to help with the rule.

F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 32 30 30 30 20 56 61 6C 75 65 F7 - 2.000 secs
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 31 39 30 30 20 56 61 6C 75 65 F7 - 1.900 secs
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 31 38 30 30 20 56 61 6C 75 65 F7 - 1.800 secs......as so on
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 31 37 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 31 36 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 31 35 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 31 34 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 31 33 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 31 32 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 31 31 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 31 30 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 30 39 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 30 38 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 30 37 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 30 36 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 30 37 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 30 35 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 30 34 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 30 33 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 30 32 30 30 20 56 61 6C 75 65 F7
F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 30 31 30 30 20 56 61 6C 75 65 F7 - 0.100 secs

I applied the above rule with the command below, with no joy.

F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 uu vv 30 30 20 56 61 6C 75 65 F7

Can you help with correct commands and rules for this please. There has been much work done to get this far, the accomplish this would get them over the final hurdle.

Kind Regards,

Craig.

Bigchap88

2015-05-16 11:16:54

See attached file of what I've applied so far.

Both the variables in the sysex string "F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 tt vv 30 30 20 56 61 6C 75 65 F7" both need to start with 3, then the next digit is the corresponding value for the echo delay time.

e.g. if tt=32 & vv=39 then value sent would give a delay time of 2.9 seconds (2900ms)

What I think I need to do is apply a rule to the timer that will convert it to these values.

If I was using an excel formula to do this it would be as follows:

pp = average value of timer from 4 presses from midi button 9E 4D 7F in seconds (e.g. 2.9)
tt = trunc(pp) + 30 = 32
vv = pp - trunc(pp)*10 + 30 = 39
Outgoing midi message = F0 00 20 32 32 2F 66 78 2F 33 2F 70 61 72 2F 30 32 20 32 39 30 30 20 56 61 6C 75 65 F7

Really hope someone can help! I understand the logic but I'm not experianced enough to apply this to BMT.

Craig.
Attachments
XR18 TAP TEMPO.bmtp
(1.19 KiB) Downloaded 117 times

DvlsAdvct

2015-05-16 16:37:23

Alright, so I threw together quite a little project here, but I'm stumped on the math at this point and was hoping you'd be able to figure it out from here. Pretty much what I did was create 4 timers that are started with the keyboard press.

While I set it up with the spacebar, you can set that Incoming message to be whatever MIDI signal you want and it should work. The way it works is you press the spacebar five times. on the fifth time it takes all the measurements of the timing for each press and then spits out a bunch of math to give you the Sysex command. I have a few safeguards in there. For example, it will only measure an average at the end that's less than 4 seconds. We can expand that, but I figure that It's rare you're going to be measure anything slower than that. It's easy to see how this works if you do the count every 4 beats, but it'll work every 1 beat as well. Then it spits out the Echo values into the sysex string. I'm actually kind of proud of this one.

If you need to test more, the second preset contains some clear commands. Namely, press Tab will reset all global variables, press backspace to end all timers.

Let me know if it does what you want.
Attachments
Counting Timers for Echo.bmtp
(3.81 KiB) Downloaded 131 times

Bigchap88

2015-05-16 20:21:01

You really have done yourself proud on this one! Absolutely amazing!

The rules are working great. The finally reading was giving a value which was roughly 50% more than the GUI tap beat.
i.e. If I did a control test of roughly 1000ms taps it would alter echo to 500ms
Easily fixed by changing the initial average from /4 to /2

I thought I would need to adjust to compensate for latency, PC and human, but it's actually really accurate.

Many many thanks for your work on this, I hope many more people can benefit this function.

What I would say is after the initial 5 taps any taps after this doesn't alter the tempo, but I would probably just want to reset the rule after the 5 taps anyway.

1 word - Legend!


King Regards,

Craig.