Skip to main content

Mido - MIDI Objects for Python

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 input as mido.open_input('SH-201'):
...     for msg in input:
...         print(msg)
>>> msg = mido.Message('program_change', program=10)
>>> msg.type
'program_change'
>>> msg.channel = 2
>>> msg2 = msg.copy(program=9)
<message program_change channel=2, program=9, time=0>

Full documentation at http://mido.readthedocs.org/

Status

This is the first stable release. All basic functionality is in place. (Messages, ports and parser.)

Requirements

Mido targets Python 2.7 and 3.2 and runs on Ubuntu and Mac OS X. May also run on other systems.

If you want to use message ports, you will need PortMidi installed on your system. The PortMidi library is loaded on demand, so you can use the parser and messages without it.

Installing

To install:

$ pip install mido

The PortMidi wrapper is written with ctypes, so no compilation is required.

If you want to use ports, you need the PortMidi shared library. The Ubuntu package is called libportmidi-dev. PortMidi is also available in MacPorts and Homebrew under the name portmidi.

Documentation

Documentation is available at http://mido.readthedocs.org/

Known Bugs

  • on OS X, PortMidi usually hangs for a second or two seconds while initializing. (It always succeeds.)

  • libportmidi prints out error messages instead of returning err and setting the error message string. Thus, Mido can’t catch errors and raise the proper exception. (I’ve been able to work around this when opening ports, so don’t know if this is still a problem.)

  • there is an obscure bug involving the OS X application Midi Keys. See tmp/segfault.py.

Future Plans

  • add a library of useful tools, such as delays, an event engine and message filters.

  • support running status (This is currently tricky or impossible with PortMidi, but could be useful for other data sources.)

  • support time codes (0xf1). (These have one data bytes divided into 3 bits type and 4 bits values. It’s unclear how to handle this.)

License

Mido is released under the terms of the MIT license.

Source Code

Latest version of the code: http://github.com/olemb/mido/ .

Latest development version: http://github.com/olemb/mido/tree/develop/

Author

Ole Martin Bjørndalen - ombdalen@gmail.com

Metadata

Release files for mido 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mido 1.0.4
File Size Uploaded
mido-1.0.4.tar.gz 28.3 kB Details

Release files / mido-1.0.4.tar.gz

Download URL mido-1.0.4.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b5dc40ec798435550401850b9e30cadd4c42f7fb650f0e19dbcfa9f44afc86a5
BLAKE2b-256 checksum
How to use checksums
464695ec82ea0610be46a25ac683992ba90cdc5fc4a5ee547247fb97a900f6d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.10

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.24

2 release files

1.1.23

2 release files

1.1.22

2 release files

1.1.21

2 release files

1.1.20

2 release files

1.1.19

1 release file

1.1.18

2 release files

1.1.16

2 release files

1.1.15

2 release files

1.1.13

1 release file

1.1.11

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

This release

1.0.4 This release

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page