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.7+).
The documentation provides installation instructions, a history of changes per release and an API reference.
See the file LICENSE.md 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.5.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9bad6e9a3e025abc5611bd02bbe145f15508d93e88c5a4df352f471f6ee2d95 |
|
MD5 | 320ec74efd18582aeca6be287769deba |
|
BLAKE2b-256 | ce3d0cb749b2b26a5f0136f91d1e6b3eecdd789a4a4a63bc436a80f8c5dff5e0 |
Hashes for python_rtmidi-1.5.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58691cd0ea70865eea5acb70f02983ba756cff00093f4e2a58c7f9e949cb6820 |
|
MD5 | b4854553d29ceceacf387855a19cc0ab |
|
BLAKE2b-256 | ca59a5bc6b5f1b99a243a3e89fe1132ea22e8afd1d8a913a4fac044f3aae4142 |
Hashes for python_rtmidi-1.5.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c211d2150a16e66d6cfe737da9fac58620d5428623ba5fa8722618c690e19512 |
|
MD5 | 76bd8ad10ff1e85ab8f15f71b09c437f |
|
BLAKE2b-256 | 9fe437271c3efebb8b8cda5de1b2ca912389ef93c1d8da0791dbfb1b46b6eb44 |
Hashes for python_rtmidi-1.5.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78d8a20e37bb0b5ab0e6e2c5b46bbdd86a85bdbd807780db9d98b150496f6d21 |
|
MD5 | ddb91ac4aba2edaae5b00dbf8606d6b3 |
|
BLAKE2b-256 | d63ec98d6a6cff5fa720c0210137922526f9811bcde263f4361bd593477a2416 |
Hashes for python_rtmidi-1.5.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a75f42986b0f40a7fd0a7a15444ab9c2ce5f634b0278291736dd49ade651e74f |
|
MD5 | a410c61ad4fe03b94a76ac327fc30e74 |
|
BLAKE2b-256 | d81bf9419ab57e3a80fd2c075274bf11df3f53737950d16e396829df382fcc14 |
Hashes for python_rtmidi-1.5.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81fb2bc98984e20bbd349244eb4c9050d33a536c16121ab31ba1ec86ff85818d |
|
MD5 | 5935ba646b699af51974cc787e5d8103 |
|
BLAKE2b-256 | 1bcb0c401b0534103557485a9f29e3753b02d5ae163deba6a6808ad5d94c56b4 |
Hashes for python_rtmidi-1.5.1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1ed49129573790e407cc3b31f495e355bd3fb7d144834dac5c314019860cba9 |
|
MD5 | 3dcb1823857b3dcf6c7f6885f9316cbf |
|
BLAKE2b-256 | d817cd70c7040224cad50d1aac1fa940bf23b26796e31b490f648bd57390a62c |
Hashes for python_rtmidi-1.5.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18fad149b4db4c41a9c572094de91b8e58febf2eb9303362549dd1dea3554f0d |
|
MD5 | 09ad36805da08309a9280669d2a07e09 |
|
BLAKE2b-256 | 31bed64668aa2a5de62a0a8f7e20fd7b3fc0c2060c5f0e1ff0a5d3b6ef892f12 |
Hashes for python_rtmidi-1.5.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bedf463ba466f055d07b5cc29267855a164ffa4fb2a26373e73455840856def |
|
MD5 | 1b2d42d6d79508524553497451df3315 |
|
BLAKE2b-256 | c4334c10fd4db4dae8e4a3ab3c54c816293cbc0236cefbaad59ca478d9dd40bb |
Hashes for python_rtmidi-1.5.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 675e0065db3494e324a2bd4b7d08c7757ed49a93dc13ca1a01c3c79623386255 |
|
MD5 | 68f8d662520abc2775a61522db88ec1b |
|
BLAKE2b-256 | eca4ddebed757adb71b44ffd8e02ec0bc17953c89f136dca19782762d13facfe |
Hashes for python_rtmidi-1.5.1-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13045d10569e224133b9ab578a1a19d0be853ed712cdc9400c72041f528efdc3 |
|
MD5 | 2baaaa02156acca29dc275dc9c9590f4 |
|
BLAKE2b-256 | c6a900b8b207a8f31f010314ebfafa3e4d02e712520d280317de6d47f960163c |
Hashes for python_rtmidi-1.5.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67a6969e67cb717ae9877ac8de3850cff1ff2096a31220edf345450e6d34213d |
|
MD5 | 292c390d0fddaf132e16042ef99db83d |
|
BLAKE2b-256 | 8db6fb8ff5fa86beffd239153d7ac93150168c93fc61a851d34caa0d52f7a49c |
Hashes for python_rtmidi-1.5.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c430c40dec87d5334dbb3f632766a4725a1e178aec8d32fc1752875f115d15b |
|
MD5 | b17fe8977aed30547d541688d5a3d7b1 |
|
BLAKE2b-256 | aad1b76d93ad1cbd4c0fa405c8fa6d49f28fa6c17c17b06b4508b749390ca03f |
Hashes for python_rtmidi-1.5.1-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2747153d3e832e412d7f639166f83f68e23c6f1f723cb5707a6effc3462f359c |
|
MD5 | e4e256e8941173ca20ee71547daa42d7 |
|
BLAKE2b-256 | bdb505cac5220b198f7457172145303ad4c3e2c950a052147d783f632b7453aa |
Hashes for python_rtmidi-1.5.1-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d38538cfa9594dc0ebbbf37ae5b89e4b4b8754a114ca31f31e62151e11960a6 |
|
MD5 | dd0becf525bb884688f94263b4f3cdf2 |
|
BLAKE2b-256 | 63393ca40ec3b9a54845124d779369fc6a91b7473ec37e4516485259cbdc5d64 |
Hashes for python_rtmidi-1.5.1-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1a974ab1c5295e15d8ff15e2e35693d83d2875c0119e29c819aba356b3c3924 |
|
MD5 | 537a73c4c52d16d876f390cc1f914d92 |
|
BLAKE2b-256 | 47fe72051aaf54483ca420cc4b54785a9ca552410fdbdf4873660b8aaaef8380 |