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 3 (3.5, 3.6, 3.7, and 3.8).
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.4.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6f96ce85032f4ea78ba91c641e6d910b5847c9a429b7ef4242478e2960079ff |
|
MD5 | f568c2a798220eea9d1d11770e5ae0d4 |
|
BLAKE2b-256 | add6c91ee40a1c774005214d7e677387e37ba684d95459ee34ef98e888f1e14f |
Hashes for python_rtmidi-1.4.2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9bf63fd93a2fca54781a6f1a5dc5a5e7fc965d0cf7b4c794abea28b600fbc55 |
|
MD5 | 07948176097b34138725aacdfc43fde0 |
|
BLAKE2b-256 | bacca28a0036bdc730c2c35efb359a2892246775edb5aaf8302cc4549aeebdb4 |
Hashes for python_rtmidi-1.4.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75e59b7be66afaa94976d0395efb22a2977be9ff0fae6bdb1ed9ce0f42b69595 |
|
MD5 | 895aeaaa32d1c922f34a6f60a91a81ac |
|
BLAKE2b-256 | 5ae932efedbf7dc404e7271aeacd7c13ad0ff1de3137ffbf1cfc819fba012b29 |
Hashes for python_rtmidi-1.4.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a3cc68f9d4ed4b258b229700567d4a1a337024b617a6ae52079fdd9c16af8a4 |
|
MD5 | 3ae4b24115ebb1e9af75c0a995fbb39f |
|
BLAKE2b-256 | ead81eeeaeb847abc408909d0b4af1df7cf26fddea79adb0e350772342e976f3 |
Hashes for python_rtmidi-1.4.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fda10b2847dffdcc440225ac8e6e5c9ce0e4834a1c5e63a760e5cac08598df3b |
|
MD5 | 52bdfded54c8e6d5c6d532e67ec51038 |
|
BLAKE2b-256 | 9f8dcdc77a49a89ed325eb76833f68e8e7cf04bddd03246758a26ae13a2cb5c4 |
Hashes for python_rtmidi-1.4.2-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32fedd6dfc78023b5765221d1aa1f9fecc4c69e7c27fa06b091f4c4174219119 |
|
MD5 | 74dc8fce3978f05d48dd5377a65cccb3 |
|
BLAKE2b-256 | 1e451b9482dd8d7a2a36964f84a6f677b27849e4f9dd0d7d12e7ddf9c733efcd |
Hashes for python_rtmidi-1.4.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 180fea4d35323e6dc2de397e15e213262aba1eb92f35d765ff9dda0978b764ec |
|
MD5 | 9c8bfb570155c12740bd1dbacf92645f |
|
BLAKE2b-256 | d09730fa5e686f5c2cb10b40988f589d6b1b5b3212c79db3174d58b47246922c |
Hashes for python_rtmidi-1.4.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4bad65e004fcbd7059a8557cb918f74bb8268e9704beae01b2881114e801552 |
|
MD5 | fc08dbec5131cb8d7a0160fb77480f9a |
|
BLAKE2b-256 | bdd2a1df69ea6a28fa78e397c1dca688511d62c2f4c86b2d65c2772a8ff54543 |
Hashes for python_rtmidi-1.4.2-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bfa18894d154b038f7f1f873c05fa0cfc75614c6ba6171ae1d3a784e197fb16 |
|
MD5 | 6ef72bcedaac31bdfeb6018ddc26a9b8 |
|
BLAKE2b-256 | 189a9ea8a89cb8f6bd80d44119b79e3740c3693213a00b6d1f71a4cb8636b330 |
Hashes for python_rtmidi-1.4.2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb2b0ff69dcecaf73710073bded9e7cc39ab5f95105d59004f1e881ce3b6ae90 |
|
MD5 | dfdbb78db42f70632d8c0cc979957066 |
|
BLAKE2b-256 | c2bd86b69f528bd26427213451de133df1ef60d8e45ce7a3d7a6d665cb54e85d |
Hashes for python_rtmidi-1.4.2-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0a3a73ef42170ae074d0689c52af44a556d24feee7f264c93e589bc37737da7 |
|
MD5 | 50a0ee95e275e45fcb8d2b8b143c4262 |
|
BLAKE2b-256 | 9ec3c028e389de54aa94aa4f86b2634f90cfc2542d29039bce0b51117408b226 |