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 2 (tested with Python 2.7) and Python 3 (3.4, 3.5, 3.6 and 3.7).
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.3.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bee33b8c06431b0f5cfdf500c68e0562e1ec2bd46b8d883b216707f16d51e9a3 |
|
MD5 | 4aed3dd62a19827aefab6948783cfe48 |
|
BLAKE2b-256 | 10e8e56d9c45bf07fa7c2e878a860151ec641b90b6e2ea639c84e92b634d779b |
Hashes for python_rtmidi-1.3.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 977d93ad6b45b48efddb92aed7fd69e1a33ff5d7130399971101133ad673be3e |
|
MD5 | 6a04da0551be8286bd01ffacf72b4cfd |
|
BLAKE2b-256 | 6f7f49ea894b78b01c647d7e594359b4056adef936bc680a705b67cbd58bb7c2 |
Hashes for python_rtmidi-1.3.1-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a47a5e26675fba87fc90917c63139c8b3aa793bcb429f22fc52fffd87853f00 |
|
MD5 | 7bbb0d7ec19db8ee2b60debb9628039e |
|
BLAKE2b-256 | a453606e6e3ffbcf5a32693b624dfa99cbcabee315c3191eedc58baa8d548831 |
Hashes for python_rtmidi-1.3.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30d9fbb0070df100f58f6e93b8149aac2d435ae3b7d368e1fce9fd691184255c |
|
MD5 | ca3e9ba5a9aea805b5b7f793e7d04931 |
|
BLAKE2b-256 | faf5328cea5a679012719e900586670b168d8a0f7df6dd15582cdc6865431a0b |
Hashes for python_rtmidi-1.3.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad2a5f0c14faf9810cc92d919096be7167eff8d4fd63abc5e2d7c20e5da9326c |
|
MD5 | 6cd36acd2a6c66cfbbc1eef0e1ee1ed0 |
|
BLAKE2b-256 | 3bcedf862f93245f4f5e6d0993d894b5cc113c5b17d598b4c08a7b6b44d91058 |
Hashes for python_rtmidi-1.3.1-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7724252c7a2d407c510f089da321755dedbc05a864c1e97c034c807882c3234c |
|
MD5 | aad0382de9509d16f6f6b8d86e581008 |
|
BLAKE2b-256 | ab5e1a9b716465041a7fffdb72c9a8a5cccd946dc2dfcf8a8a79f6bc6d99f405 |
Hashes for python_rtmidi-1.3.1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67405b66ba90f8ef423974904ad12bf92d80fc14e4180d13a69e05d787a72849 |
|
MD5 | 769b2d3ac988daf4b4767db31c0fc956 |
|
BLAKE2b-256 | bc4ef69a595300a0e0b7de386a0fced88008f5ff04321b87c5e651ab66b75b49 |
Hashes for python_rtmidi-1.3.1-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e516a7f876381667eba82417254bb8d138c17dc7666fd70212d839813b60ea19 |
|
MD5 | f503ec77a7709594fdaea198e040d8d3 |
|
BLAKE2b-256 | 9ac1735720c3bf3214f24e13b138f5b505faf079616f8b8cd81f643249d0f669 |
Hashes for python_rtmidi-1.3.1-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 521f2ca02876fae4f3efe7b52dfd2ec7cdba809af07905bd3b25b5aee36eaa50 |
|
MD5 | f72a1e34d4f1552f4189786a4dad6b5d |
|
BLAKE2b-256 | 4f13b1a72cad5022da4dc9517d8696127e6bd84f478e49c43ec193a91228241c |
Hashes for python_rtmidi-1.3.1-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d657e4f4ce4ad5b1c7ee738540889c031344c59159483bdbb65dab6c8459c746 |
|
MD5 | f20bee0d092c2d559c6f6a0b86ab9dac |
|
BLAKE2b-256 | 629552ada9819608e9484252a38422feb4eb4965a3e4b514270aeef279f3e115 |
Hashes for python_rtmidi-1.3.1-cp27-cp27m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffaed4e6654f5b7458e622146f5cd9253b1ca2986a118b9a86546111b1a55731 |
|
MD5 | 2f28db8ba5bc11cddf77c04e11999180 |
|
BLAKE2b-256 | 9a0975d985d8c349d33fa92b081f69af0440cf9c1f3e7300552ee2a5db73b036 |