A Python binding for the RtMidi C++ library implemented using 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), macOS / OS X (CoreMIDI & JACK), and Windows (MultiMedia System) operating systems.
python-rtmidi is a Python binding for RtMidi implemented using 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 3 (3.5, 3.6, 3.7, and 3.8).
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") with midiout: 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) time.sleep(0.1) del midiout
More usage examples can be found in the examples and tests directories of the source repository.
The documentation provides installation instructions, a history of changes per release and an API reference.
See the file LICENSE.txt about copyright and usage terms.
For more information, visit https://chrisarndt.de/projects/python-rtmidi.
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 Distribution
Built Distributions
Hashes for python_rtmidi-1.4.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1791458d0dc4d3dd408b381d0b3613a09a99b1cf38fbe7b0fcb470616423a4b2 |
|
MD5 | a148bd5c6787e7d05e8c37e24b5fed0a |
|
BLAKE2b-256 | 5a944fdb53a7f82545a0c60f6c1f33afc7636405efc0641796c038c6d919418f |
Hashes for python_rtmidi-1.4.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07ef73412820c08d0e5ed15927eb41f986efd5ccb23ad1065e7128d4275fe8b9 |
|
MD5 | c6712294690f396e63e799f3919bce46 |
|
BLAKE2b-256 | d33ddf7f16375e4e8f3f084b96b0e5ada6f9da087a972531583c31e1bf21e11d |
Hashes for python_rtmidi-1.4.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e86fe9951340e10db66c21c5ae9e63d3249e70148e74cbeb37d16257e2f39f53 |
|
MD5 | 3cf995cdd6cb25836a7579e4f833ac04 |
|
BLAKE2b-256 | 71bd455f91e0df09c455c1a13a4c19d058410d262fc65e53c34598e0926c06b6 |
Hashes for python_rtmidi-1.4.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cf3559bc9264d1ae3d85d636271df2a7beea0d6e2582a860513c8b272cfc46a |
|
MD5 | afc406d025acaa4936acc652640b9bb2 |
|
BLAKE2b-256 | 1628559c3f7377cd4ba7c10f2605a429e1493aac44f52c80b1b9cb9b457f9fee |
Hashes for python_rtmidi-1.4.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e74fd4e7fc4c783f41724ecd2b0a17cbd7792795145a654421c46c3bdb292f02 |
|
MD5 | 24c9099af2fee6863a0f5c06d26a3ec6 |
|
BLAKE2b-256 | afdc747f8b34c16c58189cc4226e0d3fa8fdfb8c5d824d4d533edb94bc1c55c7 |
Hashes for python_rtmidi-1.4.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fd151b801128bdedcffa3be4899a68958a0ad5a102d100a3f2bce7e01d42ced |
|
MD5 | ace8ccd1ab204db462f857e652a23213 |
|
BLAKE2b-256 | 509e1f4fc28f2432a5a1206628722700ffe3e9d381b09fdb017c95c39f16e1b6 |
Hashes for python_rtmidi-1.4.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe763f863471b24c24b8d103dd52e4a0d1e55339a2cfde5e06d635a909c08719 |
|
MD5 | 892be2e39146a86cf1eec7ddb082367b |
|
BLAKE2b-256 | b983a29e134d6bc9d11361e347b6c875be7619842a39e13736d60e827530943d |
Hashes for python_rtmidi-1.4.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e97028ae8039fe7d9b802a42105c771268ea8b57533441e5ec46a8dc8229984 |
|
MD5 | 2f0805427ed1edf627f279c6e79e346b |
|
BLAKE2b-256 | 6b61b3fb03284c4edeecdbd50875bc2da4cc32f3d82ee1b23b2229d85cb06aad |
Hashes for python_rtmidi-1.4.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b5913e6a3126788578566312064e73c90b8819673aee9a39dc985fed17099f7 |
|
MD5 | d733d6854c370cdaad5cf2ff00d98684 |
|
BLAKE2b-256 | 834ccb9151e6cfc24ff7cdb4e2c61b6630aea76fb5006700c4aaa2c2db9ba05a |
Hashes for python_rtmidi-1.4.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fce8e85c4c09fd480fb976189c576377293ab120a32e330e7d5489e858dd427 |
|
MD5 | d63a2cac3516242c7f5a4873312fa776 |
|
BLAKE2b-256 | 634f62460bffbd0fb07af906a8288a9e144ba8b49585004392ec3cc21319ee49 |
Hashes for python_rtmidi-1.4.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da22994bef4aec2fd5adb14be80a8cfc3710fd8964204bbf5f33e257ea79442d |
|
MD5 | 3487829ea9ab765a20ba7fea53827ff9 |
|
BLAKE2b-256 | 3976e6cd44f3aa0b455d8981d840ed0f8b55c6dfdddc19ed56fd1c33ca164fc7 |