Keystroke Question

mrseven

2012-12-12 21:51:09

Hi, I am new to MT and I'm trying to program a midi key to a keystroke sequence to extend a region in Pro Tools. That much I have accomplished. How do I make the command "hold" so I don't have to re-trigger the command to further extend my region? Thank you for any help!

florian

2012-12-14 12:11:33

you can use the separate "Key Down" and "Key Up" types in the
Keystroke outgoing action, e.g. for emulating pressing and separately releasing the key A, with repeat upon pressing and releasing note 64 (hex 0x40) on a MIDI controller:

Code: Select all

Translator Entry 0:
Incoming: MIDI 90 40 7F
Outgoing: Keystroke, Key Down   "A"  [repeat active]

Translator Entry 1:
Incoming: MIDI 90 40 00
Outgoing: Keystroke, Key Up    "A"
Things to consider:
1) Note Off
The example above uses "Note On with 0 velocity" as a Note Off. Your controller may send a Note Off (e.g. 80 40 00) instead. Use MIDI Capture for that.

2) Note On velocity
If your controller is touch sensitive, it will not always send "7F" as velocity in the Note On message. You can deal with this by using a local variable and a rule:

Code: Select all

Incoming: MIDI 90 40 pp
Rules:
 if pp == 0  then exit rules, skip outgoing action
Outgoing: Keystroke, Key Down   "A"  [repeat active]
This way, all Note On's with non-zero velocity will cause the Key Down action.

florian

2012-12-14 12:20:20

Enhancing the above solution, how to use keystroke combinations, e.g. Ctrl+A where A is repeating as long as the MIDI button is pressed down?
One sort of obvious way would be to map another MIDI button/key to the key "Ctrl" and use it to press and release the Ctrl key separately from the MIDI button that presses A. But you can easily do both with MT:

Code: Select all

Translator Entry 0: Ctrl Down
  [ ] stop processing
Incoming: MIDI 90 40 7F
Outgoing: Keystroke, Key Down   "Ctrl"  [repeat disabled]

Translator Entry 1: A Down
Incoming: MIDI 90 40 7F
Outgoing: Keystroke, Key Down   "A"  [repeat active]

Translator Entry 2: A Up
  [ ] stop processing
Incoming: MIDI 90 40 00
Outgoing: Keystroke, Key Up    "A"

Translator Entry 3: Ctrl Up
Incoming: MIDI 90 40 00
Outgoing: Keystroke, Key Up    "Ctrl"
Notes:
- Do not activate Key Repeat for Ctrl. It would be of no use.
- both the "MIDI note on" and "MIDI Note Off" messages cause 2 translator entries each to get executed. For this to work, make sure to uncheck "stop processing" for the translators.