Multiple MIDI strings and using rules

soundchicken

2013-01-18 00:52:56

First off this is my first post and I'd defiantly like to say thanks for a great product. The little that I've used it so far already been worth the price.

I am a Software Audio Console user that has a tablet with TouchDAW as a front end. (also both great pieces of software) What I purchased MT for was to assist in turning some of the DAW buttons, stuff that doesn't get used in a live setting, into something that IS usable for me. So far this has consisted in using translators to receive a MIDI triggers and output a hotkey response on my SAC host to do some varied task. My current project is to add some method of a "alt" button being held on the host machine. I have done this already with a Mackie MCU but the MIDI commands that I'm seeing from TouchDAW are a little more complex.

TouchDAW has a button on it labeled (of all things) "alt", when -
Pressed and released the first time it sends: 90 56 7F / 90 56 01 / 90 56 00 and turns on the local "I'm on" indicator on the button.
Pressed while the indicator is on, it sends: 90 56 7F / 90 56 00 and turns the indicator off.

My conundrum comes from the fact that the "off" press MIDI is a complete subset of the "on" press. I could use the 90 56 01 to trigger the on easy enough, but the off is all parts of what I'd see during the on. Could this be a point to use a global variable and just use the 90 56 01 to flip the state? or is there a "mo betta" way?

Since I have absolutely no experience using rules in MT, but lots in Lua and AHK, I was wondering if anyone could point me in a way that they would solve this kind of issue with MT rules.

DvlsAdvct

2013-01-19 16:35:15

Hi soundchicken

I'm not 100% sure I understand the problem. When you press the button down you get an on signal and when you press it again you get an off signal, correct? Are you getting conflicts with the off signal in the initial press? If so we can easily fix that. Would you rather it be a momentary command, where every time you press and release it disengages the Alt command?

soundchicken

2013-01-19 17:41:31

The way that the TouchDAW seems to be set up (push on /push off) is the desired method.

What I'm seeing when I do a MIDI capture when the "push on" action being sent is 3 lines of controllers:
90 56 7F
90 56 01
90 56 00


When the "push off" action is being sent I only see 2 lines of controllers:
90 56 7F
90 56 00


Since the same two sets of controllers are sent with both actions I can't use either to trigger the action like I could with a momentary action button.

What I think I'm looking for is a way to say -
if 90 56 7F / 90 56 01 / 90 56 00 then alt down
if 90 56 7F / 90 56 00 then alt up
but I think that MT only processes one line at a time.

DvlsAdvct

2013-01-19 18:40:34

MT will process all incoming MIDI at the same time unless you tell it otherwise. What you can do is use a combination of global variables and timers to get it that you push it down and you get 7F and you release it and you get 00.

Since 90 56 7F sends every time you can tie it to the global variable and have it work as a momentary command.

Code: Select all

Translator 1: Press Down
Incoming Action: 90 56 7F
Rules: g0=g0+1
if g0>=2 then g0=0
Outgoing Action: Timer, Press Down 0ms delay

Translator 2: Press Down Timer
Incoming Action: Press Down Timer
Rules: if g0==1 then Goto "On"
if g0==0 then Goto "Off"
Label "On"
pp=127
Exit rules, execute outgoing action
Label "Off"
pp=0
Exit rules, execute outgoing action
Outgoing Action: 90 56 pp
Now you get an on/off message whenever you press and it ignores the 00 and 01 the controller is sending.

soundchicken

2013-01-21 21:40:42

Thank you very much for your assistance.

With a little time looking into it I found that the 90 56 01 that I was seeing was the TouchDAW controller sending it's own "turn the indicator on" signal causing the software to flash the ALT button on the tablet.

what I came up with (using your suggestions as a base) was:

Code: Select all

Translator 1: Alt Trigger Press
Options: stop=false
Incoming: MIDI 90 56 7F
Rules: 
  g0=g0+1
  if g0>=2 then g0=0
Outgoing: One-shot timer "Press Down": 0 ms delay

Translator 2: Alt Down
Options: stop=false
Incoming: On timer "Press Down"
Rules: 
  if g0==0 then exit rules, skip Outgoing Action
  if g0==1 then exit rules, execute Outgoing Action
Outgoing: Key down: Alt

Translator 3: Alt Up
Options: stop=false
Incoming: On timer "Press Down"
Rules: 
  if g0==1 then exit rules, skip Outgoing Action
  if g0==0 then exit rules, execute Outgoing Action
Outgoing: Key up: Alt

Translator 4: Press Down Timer Indicator Set
Options: stop=false
Incoming: On timer "Press Down"
Outgoing: MIDI 90 56 g0
This is allowing me to do a toggle from the 90 56 7F input string, based on the state of the g0 variable. I'm also using the g0 to send an activation or a deactivation of the TouchDAW indicator.

Is this a good means to an end? or is there a better way it could be achieved?

DvlsAdvct

2013-01-21 22:37:11

I think that's pretty clean.

hqllwwchi

2013-08-20 10:01:59

soundchicken wrote:First off this is my first post and I'd defiantly like to say thanks for a great product. The little that I've used it so far already been worth the price.

I am a Software Audio Console user that has a dbuying.com tablet with TouchDAW as a front end. (also both great pieces of software) What I purchased MT for was to assist in turning some of the DAW buttons, stuff that doesn't get used in a live setting, into something that IS usable for me. So far this has consisted in using translators to receive a MIDI triggers and output a hotkey response on my SAC host to do some varied task. My current project is to add some method of a "alt" button being held on the host machine. I have done this already with a Mackie MCU but the MIDI commands that I'm seeing from TouchDAW are a little more complex.

I meet the same problem :(