A Python wrapper for the RtMidi C++ library written with Cython.
Project description
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 & Kernel Streaming) 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).
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 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) RtMidi documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file python-rtmidi-0.4.3b1.zip
.
File metadata
- Download URL: python-rtmidi-0.4.3b1.zip
- Upload date:
- Size: 141.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfe410e715d681078df0a8529eed99c90797b167465a20d27c9167ace05bb6d4 |
|
MD5 | f20e335bf8f72f48a05f15ede167a779 |
|
BLAKE2b-256 | 26ce65ade064fa70814ed23e7482ff1d35b881159b824a6024444bb9f97f370b |
File details
Details for the file python-rtmidi-0.4.3b1.tar.gz
.
File metadata
- Download URL: python-rtmidi-0.4.3b1.tar.gz
- Upload date:
- Size: 122.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 170b527fa5477f5d2da20d19d6a161cb9b3eecbd39dfbd60ba6355bcb6303d41 |
|
MD5 | 5bf7a40fc2c9d14ae73d61253396a36f |
|
BLAKE2b-256 | 7237ab5cf5803441702b5fc40c9f15f5081d9709bf6db53b3e79e588830abf0c |
File details
Details for the file python-rtmidi-0.4.3b1.tar.bz2
.
File metadata
- Download URL: python-rtmidi-0.4.3b1.tar.bz2
- Upload date:
- Size: 98.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4daae838b62fc5edb52f904251d946f611114929138c2316b663881df652bbb7 |
|
MD5 | 0b9f43e3acec4e72bc75d4efb0b0496b |
|
BLAKE2b-256 | c1f167b0975b85f0614c5834033dd9f8b7b8fd6e34059218e63d7b560af5d347 |
File details
Details for the file python_rtmidi-0.4.3b1-py3.3-macosx-10.6-intel.egg
.
File metadata
- Download URL: python_rtmidi-0.4.3b1-py3.3-macosx-10.6-intel.egg
- Upload date:
- Size: 176.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 909692527957257ba7ac49c4802d5304fa9f17e10c61e1884035c9d3121292de |
|
MD5 | 732b05f21b11c1ac4f55d3a2908d5059 |
|
BLAKE2b-256 | f7f11fee78a93ab4a53df46366311009a574ba6e31831c2a673f9d78e372706c |
File details
Details for the file python_rtmidi-0.4.3b1-py2.7-macosx-10.6-intel.egg
.
File metadata
- Download URL: python_rtmidi-0.4.3b1-py2.7-macosx-10.6-intel.egg
- Upload date:
- Size: 176.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 454b1ea82daa7d481cb259f13fe6b26aad8642037c0f1b13a3e6855c4d1334ef |
|
MD5 | 91d66be2be918d32ab7c36705add946c |
|
BLAKE2b-256 | 77653b148eea9a99dc5afec656173491a5e31ba368b96de48fe2c17c68cb3870 |
File details
Details for the file python-rtmidi-0.4.3b1.win32-py3.3.exe
.
File metadata
- Download URL: python-rtmidi-0.4.3b1.win32-py3.3.exe
- Upload date:
- Size: 296.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07ae3ca1952524ab02066b550c179b557b47eae4146e739e72cae1833676c826 |
|
MD5 | dbc53e51a0bb8468c47fbfd3c5d318ec |
|
BLAKE2b-256 | 0418665403f709ab7665224cf98a7b59dded38fec73101db31ee2d3d33dc0203 |
File details
Details for the file python-rtmidi-0.4.3b1.win32-py2.7.exe
.
File metadata
- Download URL: python-rtmidi-0.4.3b1.win32-py2.7.exe
- Upload date:
- Size: 298.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87a849e6dee87488a7bfe097b384d381c3024eb8dcfe5a603f58cc73aeda1b85 |
|
MD5 | dbbaf080550aaf65279210b2705440d8 |
|
BLAKE2b-256 | c015cb79f64af5f0e0fdc531a7fb8494c1a1e3a014d2e1db9ad747774ded2126 |