Skip to main content

A Python wrapper for the RtMidi C++ library written with 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), Macintosh OS X (CoreMIDI & JACK), and Windows (Multimedia Library & Kernel Streaming) operating systems.

python-rtmidi is a Python binding for RtMidi implemented with 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 2 (tested with Python 2.7) and Python 3 (3.3).

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")

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)

del midiout

More usage examples can be found in the tests and examples directory of the source distribution. API documentation is available by looking at the docstrings in the Cython source code src/_rtmidi.pyx or using tools like pydoc or IPython and by reading the (somewhat terse and inaccurate) RtMidi documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

python-rtmidi-0.4.2b.zip (140.2 kB view details)

Uploaded Source

python-rtmidi-0.4.2b.tar.gz (121.6 kB view details)

Uploaded Source

python-rtmidi-0.4.2b.tar.bz2 (97.3 kB view details)

Uploaded Source

Built Distributions

python-rtmidi-0.4.2b.win32-py3.3.exe (296.8 kB view details)

Uploaded Source

python-rtmidi-0.4.2b.win32-py2.7.exe (298.1 kB view details)

Uploaded Source

File details

Details for the file python-rtmidi-0.4.2b.zip.

File metadata

  • Download URL: python-rtmidi-0.4.2b.zip
  • Upload date:
  • Size: 140.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-rtmidi-0.4.2b.zip
Algorithm Hash digest
SHA256 679b2e45b4c2d86086c7650d82d4bc1eb935205443bcab2ecd35c88a21cc343d
MD5 8a054134560557ab239d557ee93d62e8
BLAKE2b-256 ac7597ddef2d6298c2d89b038a7aa22715df4fd41ee39e1cd00f0889ed5e4e65

See more details on using hashes here.

File details

Details for the file python-rtmidi-0.4.2b.tar.gz.

File metadata

File hashes

Hashes for python-rtmidi-0.4.2b.tar.gz
Algorithm Hash digest
SHA256 a7226cc6d621ac6b20c89463dbcc25f2b42a830981c667fa3de229ef6c6a5743
MD5 1e556ab757581d4422dbf252e7ebfb00
BLAKE2b-256 b4e4a7faf78b5d6bc431603d13aae5e7aa9d3853c5556d120618d1fb94c461bf

See more details on using hashes here.

File details

Details for the file python-rtmidi-0.4.2b.tar.bz2.

File metadata

File hashes

Hashes for python-rtmidi-0.4.2b.tar.bz2
Algorithm Hash digest
SHA256 676f79426801d09ac0eded4fded67626500745e21b972793d8da730994273e7f
MD5 dc8a07f248e32b542b39de3e561b845c
BLAKE2b-256 45e0220da778c6f6ac6e540d8ea40f51a15b2313c8e73e1f5a23b72deaec6faf

See more details on using hashes here.

File details

Details for the file python_rtmidi-0.4.2b-py3.3-macosx-10.6-intel.egg.

File metadata

File hashes

Hashes for python_rtmidi-0.4.2b-py3.3-macosx-10.6-intel.egg
Algorithm Hash digest
SHA256 3ae4e3d2b4b7f9268b6db8024774c558f45e700b168a016499e656ce8965d632
MD5 3e3c178a1de4d2ec27194543a0d56632
BLAKE2b-256 058fd82016e4737f220c2c6589825866ed9727ae6bb692d19b76c0c801310549

See more details on using hashes here.

File details

Details for the file python_rtmidi-0.4.2b-py2.7-macosx-10.6-intel.egg.

File metadata

File hashes

Hashes for python_rtmidi-0.4.2b-py2.7-macosx-10.6-intel.egg
Algorithm Hash digest
SHA256 a71fbfa71e1f35eba3e1dcd1045829098930ae354cbb1a7d34ba34e31cc64152
MD5 a1c8077d1a5a7af0b39cad1a35e7d9c7
BLAKE2b-256 a169a2363b038edb8902dd8128f9820ca457d162b118990d4c98cbb7093c7cb5

See more details on using hashes here.

File details

Details for the file python-rtmidi-0.4.2b.win32-py3.3.exe.

File metadata

File hashes

Hashes for python-rtmidi-0.4.2b.win32-py3.3.exe
Algorithm Hash digest
SHA256 449657497ad3c35b76d0cd8e9a841d99f5cc0bc7aa85b7756d73b2493c753b56
MD5 9be4dfd0e8e5ad134d12914c672ee96c
BLAKE2b-256 04b4025ee4b4afa192b1c5bbca6ceb82272437bd3204f47ba96d24a968f3d9b1

See more details on using hashes here.

File details

Details for the file python-rtmidi-0.4.2b.win32-py2.7.exe.

File metadata

File hashes

Hashes for python-rtmidi-0.4.2b.win32-py2.7.exe
Algorithm Hash digest
SHA256 60889510d46543620122c383e58c7adee7e677e5605a9bbe741ad0b9a909d467
MD5 94ba24b325a7579549cd63e5f71ad7db
BLAKE2b-256 cffd6558b70af705a78a1955b9b2310cb18c9a49a165dd6adddd2303178c3823

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page