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.
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.6-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 565da90d8e2fc00a7e6c608ea86427c4a2ce69db44adda4be71df95fffe3d262 |
|
MD5 | 56bae398631c5af08060502376fcce04 |
|
BLAKE2b-256 | be632888c2274de9efaba534e1d32483276a1b82bf74b59697e2fd24fc4acecd |
Hashes for python_rtmidi-1.4.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 615eb4426a5df90275616aab8d6382185a7c6be2a09ce44c7f058c4493bdb635 |
|
MD5 | e08d9ab435099ff8c5b98d08c11929cc |
|
BLAKE2b-256 | 54ce5d48008da7f6c8b46676e1208e86a1ba200213fe45bd8415d3dc63339540 |
Hashes for python_rtmidi-1.4.6-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f992685ec4739a51a080069f35355b1769e47b7ed2351008014a6085a08f95f5 |
|
MD5 | 82bd8d70728cc25e884399fb40949191 |
|
BLAKE2b-256 | 507dc368f0a7b47035af513db487addab62a226d26df8455f0abd6542a4c2e38 |
Hashes for python_rtmidi-1.4.6-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9141a328e82ebf59519133f24a630283768ffaf69b5e2ade298d1e6b01f4ab69 |
|
MD5 | 1135ac7f26230e36db9526b6a101ee3e |
|
BLAKE2b-256 | f778ce134d3098c42c048085e94f4cab4a8e562ca39c4f71345583c393be9194 |
Hashes for python_rtmidi-1.4.6-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5821f8726c62b3da00f70c82443eb00ee09f4d905c09954c65869e372d700373 |
|
MD5 | a33b8c0488661c1d6f3f580c5c8ba256 |
|
BLAKE2b-256 | 4ce464f13c0e0ceab980024d4794114f9ce73eb645ddb40c851133cbf4366b2c |
Hashes for python_rtmidi-1.4.6-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 107aa9d57c3b7190e65710e436a1ac2db34f22b2e82f459397ebb14dc6d3f63b |
|
MD5 | 076312c7277543d64058b719ae271daa |
|
BLAKE2b-256 | 467e0e4f0802b36e2f3c6da98c897b85725a6b6610c8da797b90afa9fd76d808 |
Hashes for python_rtmidi-1.4.6-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2151a856964b5a99f823d336102b202b0100cab381aee6582eb7b166cd9672da |
|
MD5 | 312c9d1b757efbe7433638204e781ada |
|
BLAKE2b-256 | 5aa5b268fc1791a8723fdc0ecd5978d2866b4d525612f1155930c1d9a95412fd |
Hashes for python_rtmidi-1.4.6-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87cfac386769a4ad415432d94277ca5526f082050d8bc364bd3038e811ea3511 |
|
MD5 | 86d06845d993e87542cc42cc474a0f22 |
|
BLAKE2b-256 | 1031e07b71fd2b17eac6864976ba3e47d137b2feffa72e838c015d1cc09a7885 |
Hashes for python_rtmidi-1.4.6-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2e8c3a077928ab5996dc6a0ad7d3723235b76458177c2d7297cb9706bedc779 |
|
MD5 | d259a991e7bf50023e5935e3c493e466 |
|
BLAKE2b-256 | c7181ea02c7ee65a4f288e4bc23701b0c4c19a8e4074a447d91d89bbcbfef2be |
Hashes for python_rtmidi-1.4.6-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 919f62b4e4f762064b8e6070f13b76c5490a44405f13f75dd24901658ac370a8 |
|
MD5 | 3af1081dabbe684733e2171238656ded |
|
BLAKE2b-256 | 1854fa1d3aafb642232bfc118dce2ad79351da604673da2530353df6b0374548 |
Hashes for python_rtmidi-1.4.6-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e2eb72986b882605f476cddb4202e95e0aaa7ea33c49b99bc2c8243db864e7f |
|
MD5 | 4bf85ce3803ea44fa87f2953e21af3f5 |
|
BLAKE2b-256 | 2cb16df0b6bde0f0cfb3146157a14a63dbeb5166a1c46c7a7c736b48d7c32f17 |