Mido - MIDI Objects for Python

Version 1.2.10

Mido is a library for working with MIDI messages and ports:

>>> import mido
>>> msg = mido.Message('note_on', note=60)
>>> msg.type
'note_on'
>>> msg.note
60
>>> 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')
port.send(msg)
with mido.open_input() as inport:
    for msg in inport:
        print(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