python-rtmidi
Python binding to the RtMidi C++ library for real-time MIDI input and output.
| Language | Python |
|---|---|
| Category | MIDI tools |
| License | MIT |
| Platforms | macOS Windows Linux |
| Install | pip install python-rtmidi |
| First released | 2012 |
| Maintained | Yes |
| Links | Website · Source |
Strengths
- Low-latency real-time MIDI I/O
- Supports ALSA/JACK, CoreMIDI, Windows MultiMedia
- Permissive MIT license, actively maintained
Limitations
- Low-level: no MIDI file parsing
- Requires backend MIDI drivers/ports
Best for
Sending and receiving real-time MIDI messages to hardware or software ports.
Minimal example
import rtmidi
midiout = rtmidi.MidiOut()
midiout.open_port(0)
midiout.send_message([0x90, 60, 112])