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.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3006afc54ffecb265549df6898efa6deed36d8668994f499a64f40cf4c5917cf |
|
MD5 | 0603d3f275cf983cb9699fda8d4361cb |
|
BLAKE2b-256 | 74385607e7d24830ac14bfdc08db56c184551f9b42a782ead8e9ca756cb3b8d6 |
Hashes for python_rtmidi-1.4.5-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fba08576d03782f2392091d84755c7ffef31ec7a343a7341451a5375cca1d1b6 |
|
MD5 | 8bf0ba8686efbf5ed35ce352915812ad |
|
BLAKE2b-256 | 6e3baeb35cee6d38cb7ea212e74cfc1ef595c5a3745846d818f43883c2a6aa79 |
Hashes for python_rtmidi-1.4.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a69da4aad75f21d44e82cf908c78f76b7aae8f3f4a297c97b867c12dc34abef4 |
|
MD5 | d96f5ca73cf37ed31a6548d470405a80 |
|
BLAKE2b-256 | b207dd97562503046cd01103b538bfb981ce475362d3ffe6a2c417f343277b2d |
Hashes for python_rtmidi-1.4.5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b222eaa0bf0d45a406883de54f8a77fd2c3daac195ff7f9acd49dcdb915b490a |
|
MD5 | 1c24e10ecc329d94592a282ca631da26 |
|
BLAKE2b-256 | 9faa3d69f5dd6444214960afd293e4abb71bed69d437442458df9e6ba4e42ef6 |
Hashes for python_rtmidi-1.4.5-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4415e3ae6eea6b10d7b40b4b57f22e62a2b09679a22b27cfa2789144ef3805a2 |
|
MD5 | e1a8ba2f801af28827b2775728851e2e |
|
BLAKE2b-256 | 36badbaadf4865df5127544100f3e144618b8155ff3b29be44bdd2165eb44d96 |
Hashes for python_rtmidi-1.4.5-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29712778c99e33f37062533969788e80435f304cea5b4cbbcea18f8d12755373 |
|
MD5 | a7f7243addf4c3e0505d6384f025f5a3 |
|
BLAKE2b-256 | 4bcedaf060eb8c988801abe45f817d41f05eee580477f7dceca40935a05c4cf9 |
Hashes for python_rtmidi-1.4.5-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 202c23f02968756a025938b1cd7f8bb89ecc9fe59be7c1707f781a0cfebd86e0 |
|
MD5 | ed4fd227e9d126749664511423b4a88c |
|
BLAKE2b-256 | 968bb2e1d55d8a28e6eb05534445f55344692c040c41cef57ef34344fbb92e86 |
Hashes for python_rtmidi-1.4.5-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81df6909a1ecbae8d88552b5d24ea4d711fc5afc6a57e704a949e4da0ee2dd89 |
|
MD5 | 8ecb39a668dee41ec30fc3268dec5c1a |
|
BLAKE2b-256 | 052f596e86eaeafc64c3f3122ae0c92fe0e6cbbf9308e091f545d92307c22f2f |
Hashes for python_rtmidi-1.4.5-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99781c7ab4d36d75c08b8d03545bb649fbc9babf665032ed9d76f6ebf35a6fa1 |
|
MD5 | 4b4d54bff86369fd0d552535f18e6d0a |
|
BLAKE2b-256 | 4837daa2e5231a6d3fa9e596e0461c829a1e970b5cc522e645f61a10c0cbf2e8 |
Hashes for python_rtmidi-1.4.5-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76d6007c9ecb9bf7e8292981ed3142ede6658c82cde8da76d8114e4d5d624a6d |
|
MD5 | e8d5a897a74d03c4402d11108c409efd |
|
BLAKE2b-256 | cf71939be97cde1f6b676c38db199aa8f16b00279e4bdfb8edcea8c93d8c0210 |
Hashes for python_rtmidi-1.4.5-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 763a5b55787d7ed3f02145a5b419b162d87f852c31080f8b6cae098f7356d735 |
|
MD5 | 7f38fe5be141d5af4f5c3f0188aad231 |
|
BLAKE2b-256 | 470d94c466a91a7d42e507a4a23fb1e86762c97cebf9da1faa6ea56d7d87e33a |