RtMidi is a set of C++ classes which provides a concise and simple,
cross-platform API (Application Programming Interface) for realtime MIDI
input/output across Linux (ALSA & JACK), Macintosh OS X (CoreMIDI & JACK),
and Windows (MultiMedia Library) operating systems.
python-rtmidi is a Python binding for RtMidi implemented with Cython and
provides a thin wrapper around the RtMidi C++ interface. The API is basically
the same as the C++ one but with the naming scheme of classes, methods and
parameters adapted to the Python PEP-8 conventions and requirements of
the Python package naming structure. python-rtmidi supports Python 2
(tested with Python 2.7) and Python 3 (3.3, 3.4, 3.5).
Here’s a quick example of how to use python-rtmidi to open the first
available MIDI output port and send a middle C note on MIDI channel 1:
More usage examples can be found in the tests and examples directory
of the source distribution. API documentation is available by looking at the
docstrings in the Cython source code src/_rtmidi.pyx or using tools like
pydoc or IPython and by reading the (somewhat terse and inaccurate)