Send MIDI
Sends a MIDI note, controller change or raw message to your MIDI devices.
Send MIDI kind
Keyboard Maestro: SendMIDIMessage
Details #
Sends one MIDI message to a destination through CoreMIDI. kind chooses the message:
noteOn and noteOff use
channel,noteandvelocity.controlChange uses
channel,controllerandvalue.packet sends the bytes in
packetas they are, for example90 3C 40. Spaces and commas are ignored; each byte is two hex digits.
Channels count from 1 to 16 as musicians count them. Notes, velocity, controller and value are 0 to 127. Defaults: channel 1, velocity 64, everything else 0. The numbers can come from variables.
port picks the destination by its name or unique ID. Without it the message goes to every MIDI destination.
The output is the bytes sent as hex, such as 90 3C 40. The Trace note says how many destinations got it.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
kind | one of | Yes | noteOn noteOff controlChange packet | Required. noteOn, noteOff, controlChange or packet. |
channel | any value | 1 to 16. Default 1. | ||
controller | any value | The controller number, 0 to 127. | ||
note | any value | The note number, 0 to 127. Middle C is 60. | ||
packet | text | Hex bytes for kind: packet. | ||
port | text | A destination name or unique ID. Optional. | ||
value | any value | The controller value, 0 to 127. | ||
velocity | any value | 0 to 127. Default 64. |
Every step also accepts label, onFailure, timeout and dryRunSafe.
Examples #
- Send MIDI note on
- Show “Note sent”
Gotchas #
A value out of range fails, for example
MIDI note must be 0 to 127, not 200orMIDI channel must be 1 to 16, not 0.A packet that is empty, has an odd number of digits or contains non-hex characters fails with
the MIDI packet must be hexadecimal bytes, like 90 3C 40.A note on does not stop by itself. Send a
noteOfffor the same note when you want it to end.Fails with
no MIDI destination is available, orno MIDI destination called "<port>"whenportmatches nothing.portmatches a destination's display name (any case) or its unique ID exactly.In a dry run the step is simulated and nothing is sent.