Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Python RtMidi interface

Project description

def print_message(midi):
if midi.isNoteOn():
print 'ON: ', midi.getMidiNoteName(midi.getNoteNumber()), midi.getVelocity()
elif midi.isNoteOff():
print 'OFF:', midi.getMidiNoteName(midi.getNoteNumber())
elif midi.isController():
print 'CONTROLLER', midi.getControllerNumber(), midi.getControllerValue()


import rtmidi
midiin = rtmidi.RtMidiIn()

ports = range(midiin.getPortCount())
if ports:
for i in ports:
print midiin.getPortName(i)
midiin.openPort(1)
while True:
m = midiin.getMessage(250) # some timeout in ms
if m != None:
print_message(m)
else:
print 'NO MIDI INPUT PORTS!'

Home-page: https://github.com/patrickkidd/pyrtmidi
Author: Patrick Stinson
Author-email: patrickkidd@gmail.com
License: UNKNOWN
Download-URL: https://github.com/patrickkidd/pyrtmidi/tarball/2.3.4
Description: UNKNOWN
Keywords: midi audio hardware
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4

Project details


Download files

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

Files for rtmidi, version 2.3.4
Filename, size File type Python version Upload date Hashes
Filename, size rtmidi-2.3.4.tar.gz (51.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page