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.4b.zip (98.1 kB view details)

Uploaded Source

python-rtmidi-0.4b.tar.gz (80.3 kB view details)

Uploaded Source

python-rtmidi-0.4b.tar.bz2 (69.1 kB view details)

Uploaded Source

Built Distributions

python_rtmidi-0.4b-py3.3-macosx-10.6-intel.egg (172.4 kB view details)

Uploaded Source

python_rtmidi-0.4b-py2.7-macosx-10.6-intel.egg (171.0 kB view details)

Uploaded Source

python-rtmidi-0.4b.win32-py3.3.exe (295.2 kB view details)

Uploaded Source

python-rtmidi-0.4b.win32-py2.7.exe (296.6 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for python-rtmidi-0.4b.zip
Algorithm Hash digest
SHA256 14e1f621d295ca600534bb87b2f040f042c84556da0f8ef2b5d367cb1e4f40b5
MD5 614542ed9ecc467b30619976813e2f32
BLAKE2b-256 b78af3321cf84bfecd2821010ad5c43b16fdcedcae917f1d75946998c6077570

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python-rtmidi-0.4b.tar.gz
Algorithm Hash digest
SHA256 f9b634d93cc5c1118e372e3aaeacc1fee63882596b98b0e5ebbfee5b32e56e63
MD5 5b12e713ac978fb4a9c4b8cfe8181a0c
BLAKE2b-256 f3bd7d60e9750e46d7c61bfce19d3598c46dd386ef39c82c612a193a4b1740f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python-rtmidi-0.4b.tar.bz2
Algorithm Hash digest
SHA256 27b016286daaa3f6b2dda976556b5cb667226368c3ad522a8fb8ba4b20be1f4a
MD5 844a28864796077212f913acd2b66b34
BLAKE2b-256 e70cc4f71027e299276d5399868b0fb596d58c1f6906be1adfcf91e06e75c4bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_rtmidi-0.4b-py3.3-macosx-10.6-intel.egg
Algorithm Hash digest
SHA256 50881fd33c2270f6163f3441f9a827133498602b9b1806afea539b419cc7a1b5
MD5 d8f04575419bff7d981fbf392d929fce
BLAKE2b-256 ef841e77791f700954b9f487bae9e7a2eda46dce33748af25b92e11f1f069a39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_rtmidi-0.4b-py2.7-macosx-10.6-intel.egg
Algorithm Hash digest
SHA256 293d242f1c8ebb0281e8769ce35adf2516cc9b0a9095232b8216d91f2f38cf98
MD5 65105224247bbbd273efbc9c116b8e67
BLAKE2b-256 46741f63a04a55e4a48d509bcdb4e9152f2e0e6271f3cfda7ccfc28e13ac40ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python-rtmidi-0.4b.win32-py3.3.exe
Algorithm Hash digest
SHA256 3fe1ce81f3ea74feb3060d290acc02b63858ba1338c35b9dae9af8bff3746baf
MD5 1cffd3308a41f6fbfc84a5ecb4d15a7c
BLAKE2b-256 edc33a97d9eddac554995b4b4b23e4f7d2a4efa327c17f516d0ac3bfcae42747

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python-rtmidi-0.4b.win32-py2.7.exe
Algorithm Hash digest
SHA256 e5802b57132a73d4f7de478294b638eccbaf588e0922013ec209d6343437cdc8
MD5 7ae9d385f8bcdfe72e4bae7b41c366f9
BLAKE2b-256 b09f694d9a5b82eeda78516245178ed6ad6bfb6c87821766f059dbe9fc34a669

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