Mido - MIDI Objects for Python

Version 1.2.4

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.note
60
>>> msg.bytes()
[144, 60, 64]
>>> msg.copy(channel=2)
<message note_on channel=2 note=60 velocity=64 time=0>
with mido.open_input('LinnStrument') as inport:
    for msg in inport:
        print(msg)
port = mido.open_output()
port.send(msg)
mid = mido.MidiFile('song.mid')
for msg in mid.play():
    port.send(msg)

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/.

Contents

Indices and tables