Skip to main content

MontyRoll

PyPI PyPI Downloads Python 3.10+ License: MIT Tests codecov

And now for something completely MIDI

MontyRoll is a lightweight and simple MIDI visualiser written in Python. It can read Standard MIDI Files and display the channels, their assigned instruments and a summary of what each one plays, and shows the notes on a scrollable, zoomable piano roll. It has no Python dependencies other than the standard library.

MontyRoll can also play the file through a synth such as timidity, if one is installed.

The piano roll showing the bundled Chopsticks demo, with the channel strip on the left The Events tab listing every event in the demo file, decoded

Requirements

  • Python 3.10+ with tkinter (sudo apt install python3-tk on Debian/Ubuntu)

  • Optional, for sound: a software synth on PATH, timidity recommended. See Synths for the alternatives and install commands.

Without a synth, everything except audio playback still works.

Run

python -m montyroll                            # start empty
python -m montyroll path/to/file.mid
python -m montyroll resources/chopsticks.mid   # the bundled demo

The demo is an original arrangement of Chopsticks (Euphemia Allen, 1877, public domain) generated by resources/make_demo.py: piano alone for sixteen bars, then the repeat with vibes, bass and drums, a tempo lift at the repeat and a ritardando at the end.

Features

Visualisation

  • Channel strip for every channel in use:

    • colour key
    • GM instrument
    • note count
    • pitch range
    • instrument family
    • whether the part uses pitch bend
  • Piano roll with:

    • per-channel colours
    • velocity-shaded notes
    • piano-key gutter
    • bar/beat grid
  • Three-row header ruler:

    • seconds (tempo-aware)
    • bar numbers
    • tempo changes and markers from the file
  • A file can contain any number of tempo changes. Each one is shown in the header ruler, and the seconds row stretches and compresses against the bar grid to match.

  • Event list with every message decoded, with tick, seconds and bar:beat for each

  • Status bar tracking the pointer in musical time, naming the note (or drum sound) under the cursor

Editor

  • Add, move, resize and delete notes with the mouse (see Controls).

  • Grid snap from whole notes down to 1/32, or off for free placement

  • Set velocity on any selection.

  • Change a channel's GM instrument and set the channel volume.

  • Saving re-serialises the original tracks, so any event the editor does not understand is written back unchanged.

Listen

  • Play and stop from the toolbar or Space, with a cursor that follows the file's tempo map and auto-scrolls the roll.

  • Mute and solo per channel. Mute silences a channel; solo plays only the soloed channels.

  • Each channel's instrument can be previewed from the channel strip, in that channel's own pitch range.

  • Master volume and playback speed (25-300%), affecting playback only

  • Mute, solo, volume and speed all take effect during playback, which carries on from the cursor position.

  • Live readout of elapsed time, bar:beat and current tempo

Controls

Action Control
Play / stop Space or the toolbar button
Select all / clear Ctrl+A / Esc
Delete selection Del
Open / save Ctrl+O / Ctrl+S
New file Ctrl+N
Add a note Double-click the piano roll
Move / resize a note Drag the note / drag its right edge
Zoom horizontally Ctrl + mouse wheel (anchored at the pointer)
Scroll horizontally Shift + mouse wheel
Scroll vertically Mouse wheel
Note context menu Right-click

Synths

MontyRoll makes no sound of its own. For playback it writes a temporary MIDI file and hands it to the first of these found on PATH:

  • TiMidity++ (timidity), recommended. On Debian/Ubuntu: sudo apt install timidity.

  • FluidSynth (fluidsynth), which needs a General MIDI soundfont in /usr/share/sounds/sf2, /usr/share/soundfonts or /usr/local/share/soundfonts. On Debian/Ubuntu: sudo apt install fluidsynth fluid-soundfont-gm.

  • WildMIDI (wildmidi)

  • aplaymidi from alsa-utils, used only when an ALSA synth port other than "Midi Through" exists. Midi Through is always present and plays nothing, so on its own it is not enough.

Licence

MIT - see LICENSE.

Download files

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

Source Distribution

montyroll-0.1.0.tar.gz (63.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

montyroll-0.1.0-py3-none-any.whl (46.3 kB view details)

Uploaded Python 3

File details

Details for the file montyroll-0.1.0.tar.gz.

File metadata

  • Download URL: montyroll-0.1.0.tar.gz
  • Upload date:
  • Size: 63.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for montyroll-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1bdea9445561299db2ed247c122193b5680f5dd064bb9d2e8b4edc5452eb877f
MD5 579ea0ad404ce05ff6e24f6b6a669c64
BLAKE2b-256 e7a4ba9f4b7ca5bbb971d2ced3aaf9a5970f49ab3d026a835b76c7ac1d76d6f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for montyroll-0.1.0.tar.gz:

Publisher: publish.yml on acscpt/montyroll

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file montyroll-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: montyroll-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 46.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for montyroll-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d09cf1114a8824da99cf256b885a57460c6f66989a4b1b358662ea04527bcf58
MD5 7ddac88028c16884f633031f6fe4eb1c
BLAKE2b-256 b0a009d61034c2cde2dd6007389717470f40ed767b5d808268ff023387baa359

See more details on using hashes here.

Provenance

The following attestation bundles were made for montyroll-0.1.0-py3-none-any.whl:

Publisher: publish.yml on acscpt/montyroll

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.0 This release

2 files

Supported by

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