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

Uploaded Source

python-rtmidi-0.4.1b.tar.gz (116.7 kB view details)

Uploaded Source

python-rtmidi-0.4.1b.tar.bz2 (94.1 kB view details)

Uploaded Source

Built Distributions

python-rtmidi-0.4.1b.win32-py3.3.exe (295.4 kB view details)

Uploaded Source

python-rtmidi-0.4.1b.win32-py2.7.exe (296.8 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for python-rtmidi-0.4.1b.zip
Algorithm Hash digest
SHA256 9dcbb7c151164edb4de8994b7f761881b3631d2546fc47939fdefaefd6a06ba5
MD5 238e48949459eeff2ddb2098a178ba6e
BLAKE2b-256 a91083c0c75216fb13917973c99e51e24b3c4c4ef4d435a140d6928f70a9e17d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python-rtmidi-0.4.1b.tar.gz
Algorithm Hash digest
SHA256 bfc315a58b56389a56ce59b5b1e3fa736ce9eb1dde9a4d1ccd68c5ad69abcf7d
MD5 81fc8b0f9327434fc00e1d7f43db9b65
BLAKE2b-256 26539bc7e71e10fb5580417d420dacd631678ac418619fa84afa7ca21554f1c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python-rtmidi-0.4.1b.tar.bz2
Algorithm Hash digest
SHA256 db812d2982d91a417997138eaf106952e9deea41134351fd95a894343a2177df
MD5 ea2dc7e02c8c3079e70636577eb7cfba
BLAKE2b-256 c9469827f62b17b4ccd2847707fe3c4723dd91cc64faaa6ecf51acb21401b07f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_rtmidi-0.4.1b-py3.3-macosx-10.6-intel.egg
Algorithm Hash digest
SHA256 264ca6d5aba27994aae8e6b518c5153313040369c5dae6ffea2bbb6605ebfc2b
MD5 808be4d4ace8eedc38633c46d9c3aa03
BLAKE2b-256 f5de8753323f2a0d945704c977b3938b1273cba9e6b985dec7552c8f82c80b9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_rtmidi-0.4.1b-py2.7-macosx-10.6-intel.egg
Algorithm Hash digest
SHA256 d101c0bc81848cb5619597066b984952fa9c22bea4aa895c2df698ca52da9700
MD5 dbf33261feb586faf9ab1d8b4573d7a9
BLAKE2b-256 9a2a56dc66a3f046c0a8de17a6a3f1174176720836142085790da5c5b89e46f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python-rtmidi-0.4.1b.win32-py3.3.exe
Algorithm Hash digest
SHA256 2ba99661e91bc5e323cded49e9a52187db3f3b25b815a6ea34f53a9f41e01f2c
MD5 682798b5ab2cdd1a38b0f733e82ec458
BLAKE2b-256 ea34898cee5addd73f4eb1c46ba6b19f7781ed09eeda164c089a600e07c0d0fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python-rtmidi-0.4.1b.win32-py2.7.exe
Algorithm Hash digest
SHA256 1a324011ea0ddba29369cc18d24c8cfca77910b522e3bd4bdbf9b96da9441d73
MD5 3003ddf186947ffb8715cb6c77688170
BLAKE2b-256 fd7234aa6fd5524e4a874f4141cac0b6770ad23d5492c981d1c1e7fde92c1b36

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