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.
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
- Roadmap
- Installing Mido
- Backends
- Contributing
- Introduction (Basic Concepts)
- Messages
- Frozen Messages
- Ports
- MIDI Files
- SYX Files
- Parsing MIDI Bytes
- String Encoding
- Socket Ports - MIDI over TCP/IP
- Included Programs
- Writing a New Port
- Writing a New Backend
- Freezing to EXE File
- About MIDI
- Message Types
- Meta Message Types
- Library Reference
- Resources
- License
- Authors
- Acknowledgments