Hi @peternlewis, hi all... Having today looked into how %TriggerValue% can be used with MIDI, I have some suggestions about the Wiki's coverage.
On token:TriggerValue [Keyboard Maestro Wiki]
Replace:
MIDI trigger A comma separated list of
channel,note,velocity,device.
with
MIDI trigger Data from note, controller or packet. See MIDI.
Reason: the entry currently only applies to MIDI note triggers, but full details appear on the appropriate page.
On trigger:MIDI [Keyboard Maestro Wiki]
The %TriggerValue% token will hold
channel,note,velocity,devicefor press and release (just the velocity was included prior to version 8.0). You can easily access the individual parts using the token array notation, eg%TriggerValue[2]%will be the controller (8.0.4+).
Huh? I think that last sentence must have been copied and pasted from the "Controller Change" section below it. Anyway, that would all be clearer using a little table such as:
| Trigger index | Value |
|---|---|
| %TriggerValue[1]% | Channel |
| %TriggerValue[2]% | Note |
| %TriggerValue[3]% | Velocity |
| %TriggerValue[4]% | Device |
Typo: there are no spaces in "channel,note,velocity,device".
For the Controller Change section, the corresponding table would be:
| Trigger index | Value |
|---|---|
| %TriggerValue[1]% | Channel |
| %TriggerValue[2]% | Controller |
| %TriggerValue[3]% | Value from controller |
| %TriggerValue[4]% | Device |
For the Raw Packet section (rename it just "Packet"):
| Trigger index | Value |
|---|---|
| %TriggerValue[1]% | Packet |
| %TriggerValue[2]% | Device |
The %TriggerValue% token will the space-separated hex values representing the packet, followed by a comma, followed by the source device.
I don't see that a comma is used.
If you extract just the bytes (ie, everything up until the first comma), then you can easily access the individual parts using the token array notation, eg
%TriggerValue[3] %will be the third value (8.0.4+) — note the[space]in][space]%, the space is the separator for the array, instead of the default comma.
Is that all perhaps to do with an earlier version of KM?