A Python binding for the RtMidi C++ library implemented using Cython.
Project description
Welcome to python-rtmidi!
A Python binding for the RtMidi C++ library implemented using Cython.
Overview
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.6, 3.7, 3.8, and 3.9).
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.
The source code repository and issue tracker are hosted on GitHub:
https://github.com/SpotlightKid/python-rtmidi.
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.
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.8-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af83f364e4cad53e021c9b4843cf4852810bec21830579ddf5f13c4ca3d2571a |
|
MD5 | 2909ded2527f2f14221792056456c107 |
|
BLAKE2b-256 | ac19b3228e75f9546c052c24955747d418dce8ce7f047e091ed8049217ebc7e8 |
Hashes for python_rtmidi-1.4.8-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 644ad12607f720c5bd0ddd53527f397e0d32bbcc21dd743b2f695cb68607497d |
|
MD5 | cfabe5642307a0abf9aef44797302886 |
|
BLAKE2b-256 | 7b58107004e9107b5d45c52d0052e8011d0abc0d4d43f4339554a698fe943de4 |
Hashes for python_rtmidi-1.4.8-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 192fe6f3c4a830eb3fd6b15c153da175e8d20d6e2c26f47ae45ca275dbef3911 |
|
MD5 | ca518560088005108634910ea66a893a |
|
BLAKE2b-256 | 969d19127e9a635c9494a8a62a282ace601cfa40fd94b4914aa66be52916e4a4 |
Hashes for python_rtmidi-1.4.8-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 001654f1d6aaa770fa5585bc519ac8b064ab8ce7cf44f3aaef912691d7d886b1 |
|
MD5 | 1c62a623c2dc1f6bbcdea6a1c6ada6cf |
|
BLAKE2b-256 | 729bd3fd7d70a5576dd65c6b115c8503e64a00a98862fc7a3ebecee6d199f180 |
Hashes for python_rtmidi-1.4.8-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71de504f117d8fdb686df214dee76937dfff07c4e690409ad3e613e218ab62bf |
|
MD5 | 10f0400de47a1b97a77ce57b454ed269 |
|
BLAKE2b-256 | 4f486f9970042f385725ef2582238ac594636d82f09a5910b56e1e131c07989a |
Hashes for python_rtmidi-1.4.8-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2936699fa127182154b8cc65cbe4e9a4938a79a7b429fb2adce7ce0e4a0b5568 |
|
MD5 | 9769ab93ec9447eba4071e23ca03181a |
|
BLAKE2b-256 | d474d01e2432d3bf41ad71d9fb8c88d72052e29fa1a45aaae25b42634b5bb185 |
Hashes for python_rtmidi-1.4.8-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2b0ac9ef82cfbf1f8f7fa46af8837dbda69736614ee659f27d2ba74f40bf060 |
|
MD5 | 06f6950e78378ccf6f680ffc2e1bc063 |
|
BLAKE2b-256 | dffb52e8ccbcf640b867bd3f7261d345042e5ff860c8fbc4891fcb81baaa7bdd |
Hashes for python_rtmidi-1.4.8-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e802ff7be71e1e5557185b2930a18a5051a7914cec45155a9d1f4d12aefce014 |
|
MD5 | fa2b6c364e85fefa860e92e26c7284d7 |
|
BLAKE2b-256 | 12b90eebd782ab7846a82d34668228cb9fb8d04b64d94d0aab3e6fe68fbc5921 |
Hashes for python_rtmidi-1.4.8-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98931bcaa2538d55776f9f4b6a73021786c8e94d19a313c9485e03ddb29e3ae5 |
|
MD5 | 5d879583683a0dc3bae066bc9a1ec693 |
|
BLAKE2b-256 | 45dcfdf20aac05c7278c20749a4697b1bb98c57dc2b0a8cdc13fdeb801ae744d |
Hashes for python_rtmidi-1.4.8-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73f726f0dd1b14eedb12c5a15ab1bdb4144059861af9ecaa69ba43e7835f04c3 |
|
MD5 | 36f71b307d3e6ee297ebb50d9e3f3942 |
|
BLAKE2b-256 | cbe64737cec05dd6d447406b44ddc24a402678fbc45a56a1843a2ff79ae05cab |
Hashes for python_rtmidi-1.4.8-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25ff79e516d232f48f3f034e9fd93f258432549e55edff02620f39e57cb55d30 |
|
MD5 | b348805b4ccc45565f008b4cd52023df |
|
BLAKE2b-256 | 51ef3fb9779e0db34dfcc7228d7cf4c97753ca4a389ed97b775aef0ed42381dd |