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 Library) 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") 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 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 Distributions
Built Distributions
Hashes for python_rtmidi-1.2.0rc1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4987cceac538b96dd5345f0f648c13458cae1fc405eb12de1d55d7411df6f10 |
|
MD5 | 7acc1f2fd386a3353e15ea9ea5a24369 |
|
BLAKE2b-256 | 3ed3e6d84483899c6a22f4b1c5ba3d29a139de0049418b2990008ca475906595 |
Hashes for python_rtmidi-1.2.0rc1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf75496c4c9abe0c8524395532a19068d859f2f3fbe5eb693ebefced84edbd49 |
|
MD5 | 0712d4e451432bf5a96c4b4bfea11cbc |
|
BLAKE2b-256 | e5a1109a5b7edfd55ec671c7953e03546486a9ec09fc1a63865cb0b19f6899bb |
Hashes for python_rtmidi-1.2.0rc1-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea5211974dd2ad6980758e320ec408aeaabad458a33264d7f65305d607c375c |
|
MD5 | bf832cfba68127d04843473a8ee4e525 |
|
BLAKE2b-256 | 2854f5c53e13cb68ee53173b96ebb0f49a5f192c77c23783801dd9477e27e06c |
Hashes for python_rtmidi-1.2.0rc1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 191c9c6ac05e27d1cf11b7428f0c078ff773ea1994eee1ddc4b2fc24cffdec1a |
|
MD5 | 51a6a8ad306e7b68c2bb5dac0cad3ea3 |
|
BLAKE2b-256 | 2e0ed5f127f4c8bb24ffc8f04b07203989a66280cc84c93392f1ba411de689af |
Hashes for python_rtmidi-1.2.0rc1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52863195500a10d8cc44727da47fd706e26524526b00d477149ac1bd42afd3d5 |
|
MD5 | b2d4ad526e10e638af5528c807334ee5 |
|
BLAKE2b-256 | 276c504917ee68613877c3e5080634c9ba61e4bac12ec20f42cc31d78f3ad128 |
Hashes for python_rtmidi-1.2.0rc1-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74e01f197e0b63e36cc8097aaebd94abb7990c1b962bf852abf90828768d549b |
|
MD5 | e5a8f60118c49ba339f6806e92ac86f6 |
|
BLAKE2b-256 | 96dc539b3391e6520042809c8fb901973eb3d6617719fd08ff538170edb45e9a |
Hashes for python_rtmidi-1.2.0rc1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e68dea1a1748577fe963c66bfef75532ebe1efcd5992633455f3d051f47bc9e |
|
MD5 | c6729b052b32223cb99ff5c5695800b0 |
|
BLAKE2b-256 | 420e8b9f7b72a7e8925f2fb4b5793d7ace856a9809c851662e54911824bf6530 |
Hashes for python_rtmidi-1.2.0rc1-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea2f2625bb95998775490c8ee3c73e3a5f18d85a5e7fc2437cd8cba4f872f967 |
|
MD5 | 28c0fdb88126d4e5a2f0b1dca28f240b |
|
BLAKE2b-256 | 4e13155920f69e72087d67e55c4447234fe131d3f82fc899f33616ee98bbb2a9 |
Hashes for python_rtmidi-1.2.0rc1-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4926c1c267eb5f870e2442e129aa45af93bf0a0ed634d08739dacaf94bb2ca95 |
|
MD5 | 14764a39ebd301c628f6457ce80c257b |
|
BLAKE2b-256 | 7cb93776fe48ffeedd18cda0437756d8a4bd05f2d186a1136d94c0ef37cfe6ea |
Hashes for python_rtmidi-1.2.0rc1-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc690c3a7d9899fdc4caaba5a62e41b6378134d81f9c554fd32d0101a3ec5228 |
|
MD5 | 4cee13ac77a03cdc599918f0d2a11ebb |
|
BLAKE2b-256 | 3ecb5f30874624f4b9ff052ab96a87daec20d052b9381ab65fa98410e1867063 |
Hashes for python_rtmidi-1.2.0rc1-cp27-cp27m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fc844a5b09cde8a4804cf699f39dd10db36b04a21e55f9b5ccf1a0da67fe96b |
|
MD5 | cc5eebd2bf03d955892f3e732594460d |
|
BLAKE2b-256 | 50da3d35f0ed6ddb89ca0312832c6f39d838e428b73b4e489207253e4ca27d99 |