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.9-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54d40cb794a6b079105bfb923ab0b4d5f041e9eef5dc5cce25480e4c3e3fc2f6 |
|
MD5 | 99f9584c9155dc917d5181bb3f4edeb6 |
|
BLAKE2b-256 | 2eb5e118bf9d210ffdf82b58b9f2bd30219621e19256296d01a60fac84441063 |
Hashes for python_rtmidi-1.4.9-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2286ab096a5603430ab1e1a664fe4d96acc40f9443f44c27e911dfad85ea3ac8 |
|
MD5 | fac7b845104b63303ab6a084b734f740 |
|
BLAKE2b-256 | 71066c650c2e21bfa642d13a96f0ee210e705f0b2fdb75a675864f9e450f07fb |
Hashes for python_rtmidi-1.4.9-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04bd95dd86fef3fe8d72838f719d31875f107a842127024bfe276617961eed5d |
|
MD5 | 9c7d64295107e19ad98763f88604cd89 |
|
BLAKE2b-256 | 40466d805e8b145c08294e1bdb19b91133e5e279f86d2048218f178555d455ae |
Hashes for python_rtmidi-1.4.9-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69907663e0f167fcf3fc1632a792419d0d9d00550f94dca39370ebda3bc999db |
|
MD5 | c3473b437f22803d1e4f6083d9788c35 |
|
BLAKE2b-256 | 65e582275aa174bb07123e9154da4feeae901f238dea03e685eaf26ef8f41024 |
Hashes for python_rtmidi-1.4.9-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d27d0a70e85d991f1451f286416cf5ef4514292b027155bf91dcae0b8c0d5d2 |
|
MD5 | 63aa98e1ea20600e0d640ca6a9b16144 |
|
BLAKE2b-256 | f66936256c523b25baf5e02e30d9df2f1ad87403299721c785cd195a43fe7996 |
Hashes for python_rtmidi-1.4.9-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dad7a28035eea9e24aaab4fcb756cd2b78c5b14835aa64750cb4062f77ec169 |
|
MD5 | dac8f451f36b451611477dfde5d50af3 |
|
BLAKE2b-256 | 6f9c00bea0b76417b85afb99eaf8bad54bff0ead587d0f40e7f7c0f0f592f105 |
Hashes for python_rtmidi-1.4.9-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d4b7fdb477d8036d51cce281b303686114ae676f1c83693db963ab01db11cf5 |
|
MD5 | 5bbc388cfc9f7fc1ce45f5d4d1b5e4e4 |
|
BLAKE2b-256 | de671a428f8441142eee88ea03bb9192c5e223e31c543e6ca78d8a2019c40c55 |
Hashes for python_rtmidi-1.4.9-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f5409e1b2e92cfe377710a0ea5c450c58fda8b52ec4bf4baf517aa731d9f6a6 |
|
MD5 | 796faf1b545298d1b9a2a9d1ad545fef |
|
BLAKE2b-256 | 90bd0e3446978f4a3cd0635a321c01c3d3c84d7266976b4c7c0ff050103ae188 |
Hashes for python_rtmidi-1.4.9-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d201516bb1c64511e7e4de50533f6b828072113e3c26f3f5b657f11b90252073 |
|
MD5 | 033af13947057dccf642339e1b854ac0 |
|
BLAKE2b-256 | 9924fc843187a27c82f833afac3c1379e9b8dd596df01666e9cacfcab796d8f8 |
Hashes for python_rtmidi-1.4.9-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d75788163327f6ac1f898c29e3b4527da83dbc5bab5a7e614b6a4385fde3231 |
|
MD5 | 2239421e9aac88f4d90e87c7b2390533 |
|
BLAKE2b-256 | f199d2ca37edc52f0e0755b69cbc44e147e9a1236d87f7d01b00f5bcd27dfe1b |
Hashes for python_rtmidi-1.4.9-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f495672ec76700400d4dff6f8848dbd52ca60301ed6011a6a1b3a9e95a7a07e |
|
MD5 | 679e92bc412e2d8862b8e00fd71b1470 |
|
BLAKE2b-256 | e004a4ca278a58e9823aaedead4567fa84ed54d4f55d26e0848afe9a0903f93b |
Hashes for python_rtmidi-1.4.9-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f7e154681c5d6ed7228ce8639708592da758ef4c0f575f7020854e07ca6478b |
|
MD5 | f58b1dcc0f8c67676d8993cf91d6340d |
|
BLAKE2b-256 | c59aa35b9cd4e12e0d08ba36faa2aad97bac2a193e41bdea8e20372684272ded |