skip to navigation
skip to content

python-rtmidi 1.1.0

A Python wrapper for the RtMidi C++ library written with Cython.

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).

Usage example

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:

import time
import rtmidi

midiout = rtmidi.MidiOut()
available_ports = midiout.get_ports()

if available_ports:
    midiout.open_port(0)
else:
    midiout.open_virtual_port("My virtual output")

note_on = [0x90, 60, 112] # channel 1, middle C, velocity 112
note_off = [0x80, 60, 0]
midiout.send_message(note_on)
time.sleep(0.5)
midiout.send_message(note_off)

del midiout

More usage examples can be found in the examples directory of the source distribution.

The documentation provides installation instructions and an API reference.

 
File Type Py Version Uploaded on Size
python-rtmidi-1.1.0.zip (md5) Source 2017-04-21 214KB
python_rtmidi-1.1.0-cp27-cp27m-macosx_10_12_x86_64.whl (md5) Python Wheel cp27 2017-04-27 80KB
python_rtmidi-1.1.0-cp27-cp27m-win32.whl (md5) Python Wheel cp27 2017-04-21 56KB
python_rtmidi-1.1.0-cp27-cp27m-win_amd64.whl (md5) Python Wheel cp27 2017-04-21 66KB
python_rtmidi-1.1.0-cp34-cp34m-win32.whl (md5) Python Wheel cp34 2017-04-21 61KB
python_rtmidi-1.1.0-cp34-cp34m-win_amd64.whl (md5) Python Wheel cp34 2017-04-21 67KB
python_rtmidi-1.1.0-cp35-cp35m-win32.whl (md5) Python Wheel cp35 2017-04-21 59KB
python_rtmidi-1.1.0-cp35-cp35m-win_amd64.whl (md5) Python Wheel cp35 2017-04-21 67KB
python_rtmidi-1.1.0-cp36-cp36m-macosx_10_12_x86_64.whl (md5) Python Wheel cp36 2017-04-27 80KB
python_rtmidi-1.1.0-cp36-cp36m-win32.whl (md5) Python Wheel cp36 2017-04-21 59KB
python_rtmidi-1.1.0-cp36-cp36m-win_amd64.whl (md5) Python Wheel cp36 2017-04-21 67KB