Mido - MIDI Objects for Python¶
Version 1.1.24
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
>>> output = mido.open_output()
>>> output.send(mido.Message('note_on', note=60, velocity=64))
>>> with mido.open_input('SH-201') as inport:
... for msg in inport:
... print(msg)
>>> from mido import Message
>>> msg = Message('program_change', program=1)
>>> msg
<message program_change channel=0 program=1 time=0>
>>> msg.copy(program=2, time=100)
<message program_change channel=0 program=2 time=100>
>>> msg.time
100
>>> msg.bytes()
[192, 1]
>>> from mido import MidiFile
>>> for msg in MidiFile('song.mid').play():
... output.send(msg)
Mido is short for MIDi Objects.
Source code¶
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¶
- Changes
- Installing Mido
- Contributing
- Introduction (Basic Concepts)
- Messages
- Ports
- MIDI Files
- SYX Files
- Backends
- Parsing MIDI Bytes
- String Encoding
- Socket Ports - MIDI over TCP/IP
- Included Programs
- Writing a New Port
- Writing a New Backend
- Freezing Mido Programs
- About MIDI
- Message Types
- Meta Message Types
- Library Reference
- Resources
- License
- Authors
- Acknowledgements