Key Sequence to MIDI

florian

2015-11-17 15:39:54

A user asked how to convert a key sequence to MIDI, instead of only single keys.

For example:

Code: Select all

Translator 1:
Incoming: Key Sequence "1 5 6 RETURN"
Outgoing: MIDI Note On on channel 1 with note:60 (0x3C) and velocity:127 (0x7F)

florian

2015-11-17 15:46:07

As of MT Pro, version 1.8, the behavior you seek is not built in, but can easily be emulated using MT Pro's Rules feature:
  • Use a global variable, e.g. "g0", which records the current position in the key sequence
  • when the next key in the sequence is pressed, increase g0 by one
  • when the end key in the sequence is pressed, and the variable g0 equals the number of total keys in the sequence, execute the outgoing action
By way of MT's translators, it'll look something like this:

Code: Select all

[x] Translator 0: New Translator
Incoming: Physical Keys: 1
Rules: g0=1
Outgoing: (none)

[x] Translator 1: New Translator
Incoming: Physical Keys: 5
Rules: if g0==1 then g0=g0+1
Outgoing: (none)

[x] Translator 2: New Translator
Incoming: Physical Keys: 6
Rules: if g0==2 then g0=g0+1
Outgoing: (none)

[x] Translator 3: New Translator
Incoming: Physical Keys: Return
Rules:
  if g0!=3 then exit rules, skip Outgoing Action
  g0=0
Outgoing: Note On on channel 1 with note:60 (0x3C) and velocity:127 (0x7F)
Of course this is a bit more work than a direct "Key Sequence", but at least it works!
We plan to directly support input key sequences in a future version.

Florian