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) 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, 3.4, 3.5).

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-1.0.0.zip (211.1 kB view details)

Uploaded Source

python-rtmidi-1.0.0.tar.gz (185.4 kB view details)

Uploaded Source

python-rtmidi-1.0.0.tar.bz2 (162.7 kB view details)

Uploaded Source

Built Distributions

python_rtmidi-1.0.0-cp35-cp35m-win_amd64.whl (70.3 kB view details)

Uploaded CPython 3.5m Windows x86-64

python_rtmidi-1.0.0-cp35-cp35m-win32.whl (62.5 kB view details)

Uploaded CPython 3.5m Windows x86

python_rtmidi-1.0.0-cp34-cp34m-win_amd64.whl (70.0 kB view details)

Uploaded CPython 3.4m Windows x86-64

python_rtmidi-1.0.0-cp34-cp34m-win32.whl (64.7 kB view details)

Uploaded CPython 3.4m Windows x86

python_rtmidi-1.0.0-cp27-cp27m-win_amd64.whl (68.1 kB view details)

Uploaded CPython 2.7m Windows x86-64

python_rtmidi-1.0.0-cp27-cp27m-win32.whl (59.0 kB view details)

Uploaded CPython 2.7m Windows x86

File details

Details for the file python-rtmidi-1.0.0.zip.

File metadata

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

File hashes

Hashes for python-rtmidi-1.0.0.zip
Algorithm Hash digest
SHA256 727d99d02e8bdec5256785608e100666ea0d9244779067120697b3b2187ec446
MD5 cd7d06b64b81b3fa667acc51c8317f17
BLAKE2b-256 accd10a9258c493dbdfff09aa33be7c3d0cf7da6368e5f1341f86c65040618e3

See more details on using hashes here.

File details

Details for the file python-rtmidi-1.0.0.tar.gz.

File metadata

File hashes

Hashes for python-rtmidi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e9abfb0e675f96cd2e0950f28065f580970b55df1a40259e2bbdd1689cef127c
MD5 e71a3b2706baab814debe1157de42f53
BLAKE2b-256 a23c5d744630c58a6ff776163e17742149eff598821f9ab58f8aba598b173af8

See more details on using hashes here.

File details

Details for the file python-rtmidi-1.0.0.tar.bz2.

File metadata

File hashes

Hashes for python-rtmidi-1.0.0.tar.bz2
Algorithm Hash digest
SHA256 a00b7204587823f7e0d9faa2e139f63c3902a1645d1f2213b60e1d3befbb2e42
MD5 347f911a7fb10f5799a3ab9a461b728a
BLAKE2b-256 324d8321a72874916acd77ef93f22cceae78b5c7534711b9c12cd870d7c7666c

See more details on using hashes here.

File details

Details for the file python_rtmidi-1.0.0-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for python_rtmidi-1.0.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 2ba9823e16df73314ebf1a0571c13e7231bc7befc686965e3e6478401adb7849
MD5 6cacd41a5ba328cf0a16a2bfd0af692b
BLAKE2b-256 d3b31651a29220f19b53d6369fb82a1b168efbd23355a11396ac764f9cfa9e9a

See more details on using hashes here.

File details

Details for the file python_rtmidi-1.0.0-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for python_rtmidi-1.0.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 fc57140e029ea44dcd64de6ba8bd3b0a8494082b9f1dfe5ed27222fe54213124
MD5 c97eb16933d8d36f35ac11a74bca3e2e
BLAKE2b-256 e1f99607a63c94eb8d73c1c983bb197d486109b626f59c054936f48e578756f9

See more details on using hashes here.

File details

Details for the file python_rtmidi-1.0.0-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for python_rtmidi-1.0.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 6e9d16589d0e5d654fc53337eb6585ff0b7bdbb87c2ffcf64bdce15cfd597424
MD5 816fac7dbc8746012af0bd0bb8b66761
BLAKE2b-256 eb25f37ea9c21c84781b77a50df8547ce5998e50730c3d8e1b9e1108c41e521c

See more details on using hashes here.

File details

Details for the file python_rtmidi-1.0.0-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for python_rtmidi-1.0.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 46eb0cba9680d92aa32bfe4c725489fa0db1f18d6d64d22254a47a4fa38b0197
MD5 e58d4449aa6d3f29a76c414cafa726cf
BLAKE2b-256 0a86f84f0c9f77dec6ce49dc1fdcd81fd35e43ea144ab485994267e68882c879

See more details on using hashes here.

File details

Details for the file python_rtmidi-1.0.0-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for python_rtmidi-1.0.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 5a342b38030e319726624789ff0f52b6c5441a1fc2dba5208af59fb96f6da089
MD5 df7b6e01ebdb13cee2655c22e41636d7
BLAKE2b-256 14461fc4a4bb32695a80c370a65b48411a0bd4f632cc538de26f3552e42fcd24

See more details on using hashes here.

File details

Details for the file python_rtmidi-1.0.0-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for python_rtmidi-1.0.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 6d48b3d75aafc48195f580f5de6d462e0927e5dc287ca79b495eda941da1fc03
MD5 190414986308df41fcce85cec021d14a
BLAKE2b-256 bd735b2342cbd26fb40c492b55bcb79332cb761d31b2c5d291d46fdd9ff8f3e6

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