skillfed

mido

MIDI Objects for Python

mido v1.3.3 893.4K downloads/30d#4,795 on PyPI1,632
Permissive license MIT Active released

What it is and what it does

Mido is a Python library for working with MIDI (Musical Instrument Digital Interface) messages and files. It abstracts away the complexity of MIDI protocol details by providing convenient message objects that you can create, inspect, and modify. The library supports reading and writing MIDI files, sending and receiving MIDI messages through ports, and includes a reusable MIDI stream parser.

The core use case is building music production tools, sequencers, controllers, or any application that needs to communicate with MIDI hardware or software synthesizers. Mido handles all 18 standard MIDI message types and provides a unified port API that works across multiple backends (RtMidi, PortMidi, Pygame), so you can write code once and switch backends without changing your application logic. It also supports MIDI over TCP/IP for wireless communication between computers.

Use it for:

  • Build a MIDI controller or sequencer that sends note messages to a synthesizer or DAW
  • Read and playback MIDI files programmatically with full access to every message and meta-event
  • Listen to incoming MIDI from hardware controllers and respond in real time
  • Convert between MIDI file formats or extract/modify MIDI data from existing files
  • Implement wireless MIDI communication between computers using TCP/IP sockets

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Mido provides a Python library for creating, parsing, and sending MIDI messages and files, with support for multiple backends (RtMidi, PortMidi, Pygame) and port I/O.

Yes. Mido is a stable, actively maintained library with no known vulnerabilities, low install friction, and permissive licensing. It is the standard choice for MIDI work in Python and has a clear, well-documented API. Install it if you need to work with MIDI messages, files, or hardware in any capacity.

Install

mido on PyPI

pip

pip install mido

uv

uv add mido

poetry

poetry add mido

Installing mido

Before you install

Low friction installation with only two lightweight runtime dependencies (packaging and importlib-metadata). The project is actively maintained with a recent commit on 2026-06-27 and has been stable since its initial 2013 release.

License in practice

MIT license is permissive and imposes no restrictions on commercial or proprietary use, modification, or redistribution as long as the license text is included.

Quickstart

pip install mido

import mido
msg = mido.Message('note_on', note=60)
print(msg.type, msg.note)

with mido.open_input() as inport:
    for msg in inport:
        print(msg)

For port I/O, you may need to install an optional backend (e.g., mido[ports-rtmidi]) and have the corresponding system library (RtMidi, PortMidi, or Pygame) available.

Verify before relying

  • Whether the default installation works without optional port backends or if RtMidi/PortMidi system libraries are required for basic MIDI I/O
  • Performance characteristics when handling large MIDI files or high-frequency message streams

Package facts

License MIT (permissive)
Python support supports the current Python release (~=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 2 — packaging, importlib-metadata
Maintenance actively maintained — 658 days since the last release
Last repo commit
First released
Downloads 893,445/month — #4,795 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mido-1.3.3-py3-none-any.whl

Keywords: python, midi, midifile

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Multimedia :: Sound/Audio :: MIDITopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities

Tags

MIDI message handling pythonMIDI file read writeMIDI port input outputMIDI backend abstractionmusic production MIDI libraryMIDI over networkSYX file support
midimusic-productionaudio

More Software Development packages