Skip to content

Instantly share code, notes, and snippets.

@SpotlightKid
Created August 2, 2023 14:21
Show Gist options
  • Save SpotlightKid/2f56d78bf40a791d58ac57e09a44c5fe to your computer and use it in GitHub Desktop.
Save SpotlightKid/2f56d78bf40a791d58ac57e09a44c5fe to your computer and use it in GitHub Desktop.
Send bytes given on the command line as hexadecimal digit pairs to selected MIDI output
#!/usr/bin/env python3
import sys
from rtmidi.midiutil import open_midioutput
if sys.argv[1:]:
midiout, _ = open_midioutput()
midiout.send_message(bytearray.fromhex(" ".join(sys.argv[1:])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment