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.5, 3.6, 3.7, and 3.8).
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.
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.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac2a950fb760783d8316e4e4534af4d37a78fc672ee43c6e4666ca4ed62363ca |
|
MD5 | ba21f1c8471b48344099b0b94f1f8c68 |
|
BLAKE2b-256 | 5f579e97fb8fd42830c47b754c27e56e4710a4fd454327918ac836205f329130 |
Hashes for python_rtmidi-1.4.3-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf4e5f7813959ce63d8abfddba7f4a3af944376abd12a4c965e015f9f0aabfc8 |
|
MD5 | 7e6fd14f51ccd3123007a79ac23d253f |
|
BLAKE2b-256 | 34aa0bcdb1b060292d22010631f34b2815320b02231f0b4969f21fff98a391ac |
Hashes for python_rtmidi-1.4.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18242e894b2695711a09451e119cee3084132b00248106d36afd8ea0ef972d32 |
|
MD5 | 12e9692a61c35aa7b00a3c744d1444a5 |
|
BLAKE2b-256 | 7999048838b78098da436781fd2eeda6cd0761861b2de7ea1e9380750018eebf |
Hashes for python_rtmidi-1.4.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bb59bbb12defa28eeb02f48406a92e8c4f58b709effcd23f38c6296f8e081e1 |
|
MD5 | 0214dc13b8eae835b771a014d9c1a9f8 |
|
BLAKE2b-256 | c3b2f4c1d74952541cf7a98697ed2d2398536e97bad5ea1e73c38798fba39372 |
Hashes for python_rtmidi-1.4.3-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81f79b544a16dc5875e8bacc426fe89a2a01719ee533dc5ab6c123241ebd7341 |
|
MD5 | cee4951be57e3e86ca6afe0e66587188 |
|
BLAKE2b-256 | 9ec291f801a2e0bd7bc06de4149863e03f2208b25551430908994cd268144859 |
Hashes for python_rtmidi-1.4.3-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c729ec356d5a0f4ba08cb53a99d60585d3a4094d15a89e4f3bb6e570e84d5a6 |
|
MD5 | 17b8518a9ddaa3d0c5ef96b5678914e9 |
|
BLAKE2b-256 | 41a69933853746715c6cc6c41ae8b2730d4f3ee8826bee393516ab2561e90192 |
Hashes for python_rtmidi-1.4.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 511af06cc36eac4e618ae89fc83e2c63e526b2819ec6016815ca36faaf0f9a13 |
|
MD5 | 0da87aeae729c604a39abe4e231fb2d7 |
|
BLAKE2b-256 | c977d25fdf8e8aace8415567a58017e2f460ca8a32b623baff3069421a29c767 |
Hashes for python_rtmidi-1.4.3-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dc75160fe0805a1e16333ce42edae7332ac81f14e4766dbf9b511fd8e852555 |
|
MD5 | 416346a11f8d63f9bc91021e2c9696fe |
|
BLAKE2b-256 | 28b3ca985b9eb47d25a910f4ee3e8e737b027d6f287a598a7f49b81ff8129c1b |
Hashes for python_rtmidi-1.4.3-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 497d008b3ddd80c680a08ed3c9d5b513fa4ff4bda189909cac5e1b784db94885 |
|
MD5 | 8ec37d17ff96e80d0165096b608a85fe |
|
BLAKE2b-256 | c46e0d5ac0a9dc35ae804b10f856aa30c92727b814cb183ab50a28ab81bc1e14 |
Hashes for python_rtmidi-1.4.3-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4aa5d8109dc5231cd93df85556e2817bfc1612ed473140317d69efccfcc09bb6 |
|
MD5 | 3d4b313983ef7dcea7b3ee601be21a14 |
|
BLAKE2b-256 | d7ee173bcad710e840cbf402dffa3436fbf5ac2251206b920d58ad21deac5b6c |
Hashes for python_rtmidi-1.4.3-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2200684eec87050bca57d8dd9db1a2fa8e49894119757a8cf85c2275d2ed32aa |
|
MD5 | 2e48e44d291e0f5acd4879657cfd4d94 |
|
BLAKE2b-256 | 0d1a26f70efe702b038d8a1d44a2ef3cd58f8d7ef90f91295e16c6af9322c085 |