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.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 922cdcf677e845750d763c114dd334d8ee54bd89f4729bf02bc6a8d3afe6456d |
|
MD5 | fc945e380ebbb7cb68fdcd8e4689d001 |
|
BLAKE2b-256 | 94ae67fe37d3203404b8efcef69f34ad13cbecb2ad3350b2d446838e7cc834f0 |
Hashes for python_rtmidi-1.4.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96b1ca04b4aea71320d71fae81ab882767bd8d801763a54b20ef7e56d4d39a07 |
|
MD5 | 25e5a961ff559c31a10c7a64206488b8 |
|
BLAKE2b-256 | 0af97c3ae23ddc34036d4ec5c11c6cb41b5ef259497389c8ef735c656754838f |
Hashes for python_rtmidi-1.4.7-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1288a0faf12735afd842edba2362ec696f56b4b86917fa4e3113aee3976c84d |
|
MD5 | e94e7dc4312b7a07ddaf13fdb5937b1c |
|
BLAKE2b-256 | 377a71fb4f2615a11387c02c4ea69f3cebe7ad8165478375264bdf018cd416b8 |
Hashes for python_rtmidi-1.4.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 266ad15fbd97713d4bef07a31ff72ff13cc8cdecc9f4518d2537b01d3f53e47d |
|
MD5 | 33ee6c7373b0267890159e9e6bd3d137 |
|
BLAKE2b-256 | f2b87b90b12d8e7b5ae10c30564c5d32248ee29b91505d1f3021515f6e97aff5 |
Hashes for python_rtmidi-1.4.7-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 179b2acaa3b2498f71633988799fc392a77bfe983a66b94f70bd35615c94fa33 |
|
MD5 | 3613fd058651978fbc1e124bac2b9fb4 |
|
BLAKE2b-256 | 63c47338f8a06cf8f710c62c2c084362e6c116a6a95c4d4ee7d8c1ac7cd9d12c |
Hashes for python_rtmidi-1.4.7-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd57b90b28728b6781fdbac78f71b2538b127db5d0fd8aa9304efc7b58daf994 |
|
MD5 | 918849a459ab9cd3074b71bb7682ea10 |
|
BLAKE2b-256 | 3f1528a6b23f53b8c76ac296aaeef8af7d145878cbaed4500f9bde9a31a6fab6 |
Hashes for python_rtmidi-1.4.7-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de321ee7c68485563a0777b72ea9db5fc8bee6d413ddc125dc881e904bf9c602 |
|
MD5 | 36ef63938af6626042b8a27db22be139 |
|
BLAKE2b-256 | bad9c61c3c5e47ff4e9419c52948dde8355abf7a54a663558ec36f68be6dca27 |
Hashes for python_rtmidi-1.4.7-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a2bf0a9526fadbe4de8e438899f0932e497b03f0b549eaf329cb05217b76cfa |
|
MD5 | f5534a1ef5d62233a116721447f58a4c |
|
BLAKE2b-256 | fa7eb619a97a954e1ee31bdb25806ca298a3b17714b8667a94f9c9fc5be4a877 |
Hashes for python_rtmidi-1.4.7-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18f1d2873f9514fd3f2de3ca9a1722c470fad0505f79738d03ee1d13ec3a846c |
|
MD5 | 1a95b6ffc16d1446e205959311447bf4 |
|
BLAKE2b-256 | 6164b418f6b82437204ebb62eb8410d6823c5a4f2c3fb15b1fcd130fffb0781a |
Hashes for python_rtmidi-1.4.7-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac61260bd0d63c9bde5b5c9f3585f0fffbca427cc381a99a3cdbb9a5503f48d0 |
|
MD5 | 442aa79f10ec99f2c38254db2209473d |
|
BLAKE2b-256 | 395cd3c408c7618f3132450dd0181fd332919802592e7c323780e9c6e58f4917 |
Hashes for python_rtmidi-1.4.7-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3cc68264297c9ef4e3d02a45a698c4ca88d4ad1415d009fbf740e4a5ff0bbdb |
|
MD5 | cf8f1669100571e2334ff2625a9aecc0 |
|
BLAKE2b-256 | cf0ff0bf1eb332452cf39ec7ccc1b05bcc01626c8d6d7807828ed641369d30f7 |