Skip to main content

MIDI Objects for Python

Project description

https://travis-ci.org/olemb/mido.svg?branch=master

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
>>> 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)

Full documentation at https://mido.readthedocs.io/

Main Features

  • works in Python 2 and 3.

  • convenient message objects.

  • supports RtMidi, PortMidi and Pygame. New backends are easy to write.

  • full support for all 18 messages defined by the MIDI standard.

  • standard port API allows all kinds of input and output ports to be used interchangeably. New port types can be written by subclassing and overriding a few methods.

  • includes a reusable MIDI parser.

  • full support for MIDI files (read, write, create and play) with complete access to every message in the file, including all common meta messages.

  • can read and write SYX files (binary and plain text).

  • implements (somewhat experimental) MIDI over TCP/IP with socket ports. This allows for example wireless MIDI between two computers.

  • includes programs for playing MIDI files, listing ports and serving and forwarding ports over a network.

Status

1.2 is the third stable release.

Requirements

Mido targets Python 2.7 and 3.2.

Installing

pip install mido

If you want to use ports:

pip install python-rtmidi

See docs/backends/ for other backends.

Source Code

https://github.com/olemb/mido/

License

Mido is released under the terms of the MIT license.

Questions and suggestions

Please ask questions about Mido at https://groups.google.com/forum/#!forum/mido-community.

This mailing list was created to give both the user community a place to ask and hopefully also answer questions and for the developers a space to discuss Mido development. The success of the mailing list will depend on the community effort to also answer questions.

Looking for maintainers

This project is looking for somebody to take over the maintenance since the original author @olemb is busy with other projects. We look for somebody or a group of people who care about the code and would like to steer this project in future by discussing proposals, reviewing pull requests, and looking over issues. Please write to mido-community@googlegroups.com if you would like to help out with maintenance.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mido-1.2.9.tar.gz (96.1 kB view details)

Uploaded Source

Built Distribution

mido-1.2.9-py2.py3-none-any.whl (52.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mido-1.2.9.tar.gz.

File metadata

  • Download URL: mido-1.2.9.tar.gz
  • Upload date:
  • Size: 96.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for mido-1.2.9.tar.gz
Algorithm Hash digest
SHA256 c4a7d5528fefa3d3dcaa2056d4bc873e2c96a395658d15af5a89c8c3fa7c7acc
MD5 bec86e55a19f5bfdd5a3546c7cdc418a
BLAKE2b-256 47a8f05e3e6491568de9e03506a869a6039e2892d8350809203bd9abcf4b17a8

See more details on using hashes here.

File details

Details for the file mido-1.2.9-py2.py3-none-any.whl.

File metadata

  • Download URL: mido-1.2.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 52.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6

File hashes

Hashes for mido-1.2.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fc6364efa028c8405166f63e6a83cbc6c17aaeac2c28680abe64ae48703a89dd
MD5 b6a9c97f0c3ff459b79d09b39363500a
BLAKE2b-256 200a81beb587b1ae832ea6a1901dc7c6faa380e8dd154e0a862f0a9f3d2afab9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page