Skip to main content

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.

Filename, size & hash SHA256 hash help File type Python version Upload date
rtmidi-2.3.4.tar.gz (51.7 kB) Copy SHA256 hash SHA256 Source None Aug 16, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page