Mido - MIDI Objects for Python

Version 1.2.9

Mido is a library for working with MIDI messages and ports. It’s designed to be as straight forward and Pythonic as possible:

>>> import mido
>>> msg = mido.Message('note_on', note=60)
>>> msg.type
>>> msg.note
>>> msg.bytes()
[144, 60, 64]
>>> msg.copy(channel=2)
<message note_on channel=2 note=60 velocity=64 time=0>
port = mido.open_output('Port Name')
with mido.open_input() as inport:
    for msg in inport:
mid = mido.MidiFile('song.mid')
for msg in mid.play():

Mido is short for MIDI objects.

About This Document

This document is available at https://mido.readthedocs.io/

To build locally:

python setup.py docs

This requires Sphinx. The resulting files can be found in docs/_build/.


Indices and tables