SendMIDI is a Nice MIDI CLI from Geert Bevin

18 Jan 2017

Geert Bevin, a prolific developer of music software (e.g., he wrote the firmware for the Linnstrument and has been influential in developing the MPE extension for expressive MIDI controllers) has recently opensourced a utility called SendMIDI, which lets you send MIDI messages from a simple command line interface.

For example, using SendMIDI, I can send the following commands (using Iterm2 on my Mac) to experiment with changing the pad LED colors on my Minim Bluetooth controller from Livid.


11:53 $ sendmidi list
Livid Minim Bluetooth
✔ ~
11:53 $ sendmidi dev "Livid Minim Bluetooth" ch 15 cc 17 5
✔ ~
11:54 $


The first command above (i.e, list) displays connected devices.  The second command sends a cc message on channel 15 to the "Livid Minim Bluetooth" device.  But that's not all!  You can also save command sequences in a file and instruct sendmidi to execute the commands from the file.  Here's how you'd do that.


$ cat sendmidi.input | sendmidi --


The command above prints the contents of the sendmidi.input file and pipes the output to sendmidi, which is instructed (via the "--" parameter) to read from standard input and execute the commands contained in the sendmidi.input file.  And here's what the sendmidi.input file looks like.


$ cat sendmidi.input
dev "Livid Minim Bluetooth"
ch 15
cc 14 3
cc 15 3
cc 16 3
cc 17 3


When executed by sendmidi, those commands make the top row of pads on my Minim blink green.

An alternate way (TMTOWTDI) to accomplish the same thing is to run:


$ sendmidi file sendmidi.input


The net effect is the same either way although in the latter case you can continue to chain commands after the file is processed, making this approach more flexible overall.  For example:


$ sendmidi file sendmidi.input cc 10 3 cc 11 3 cc 12 3 cc 13 3


Executing the commands in the file, followed by the additional CC messages, makes all eight of the Minim's pads blink green.

So if you've got some MIDI gear and want to experiment with how it responds to different MIDI messages give SendMIDI a try.  Get the latest release at (Geert's been pumping out a steady stream of updates over the past several days).  Or read more over at CDM or Synthtopia.  And thanks, Geert!