Skip to main content

MontyRoll

PyPI PyPI Downloads Python 3.10+ License: MIT Tests codecov

And now for something completely MIDI

MontyRoll reads a Standard MIDI File and shows it as a piano roll, with a voice-demand strip underneath that counts how many voices sound at each instant. Its main purpose is to reduce that demand to a voice budget, usually the number of channels on a target platform. The reduced arrangement plays through a synth such as timidity, and exports as a sequence of register writes for the sound chips of the platform, currently as a ZSM file for the Commander X16.

MontyRoll is written in Python and uses the standard library alone, with tkinter for the window.

The documentation starts with a quick start on the demo file and goes on to every control, the plan file, and the Commander X16 export.

The demo file reduced to four voices: dropped notes stippled on the roll, and the strip level with the budget line The Events tab listing every event in the demo file, decoded

Requirements

  • Python 3.10+ with tkinter (sudo apt install python3-tk on Debian or 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.

Install

From PyPI, for the application alone:

pip install montyroll          # or: pipx install montyroll

pipx suits systems where pip will not install into the system Python. The package has no dependencies. The only things pip cannot provide are tkinter itself (sudo apt install python3-tk if import tkinter fails) and a synth for sound.

From the repository, which also carries the demo file and the documentation:

git clone https://github.com/acscpt/montyroll.git
cd montyroll

Run

montyroll path/to/file.mid                      # installed from PyPI
python3 -m montyroll path/to/file.mid           # from a clone
python3 -m montyroll resources/chopsticks.mid   # the demo, in the clone

Run with no file to start empty.

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

Reading a file

The piano roll draws every note in the colour of its channel, shaded by velocity, against a bar and beat grid with a piano keyboard down the side. Above the roll, a four-row ruler gives the time in seconds, the bar numbers, the tempo changes and markers of the file, and the chord in each beat, merged into runs. A file can hold any number of tempo changes, and the seconds row stretches and compresses against the bars to follow them. Beside the roll, a card for each channel gives its instrument, its note count, its pitch range, its instrument family, and whether it uses pitch bend. The status bar follows the pointer in musical time and names the chord and the note or drum sound under it.

Under the roll, the voice-demand strip stacks the sounding notes of each channel in the colours of the roll. Two lines over the stack count the distinct pitches, so that a unison counts once, and the distinct pitch classes, so that an octave doubling counts once too. The Events tab lists every event decoded, with its tick, its time, and its bar and beat. The Report tab gives the analysis as text, including the key, how many instruments play at once, and which channels rarely play together.

Editing

Notes are added, moved, resized, and deleted with the mouse, on a grid from whole notes down to 1/32 or with no grid at all. A selection can be given one velocity. Each channel card changes the instrument and the volume of its channel. The tempo can be set from any bar, a tempo change removed, or every tempo in the file scaled by a percentage. A save writes the original tracks back, so any event the editor does not understand is written back unchanged.

Playing

Play or Space plays the file through the synth, with a cursor that follows the tempo map and scrolls the roll. Each channel has a mute and a solo, and its instrument can be previewed in the pitch range of that channel. Master volume and playback speed (25-300%) change what is heard and leave the file as it is. A change to any of these during playback takes effect from the cursor.

Reducing

The Reduce panel fits the arrangement to the voice budget. Every note gets a weight from the priority of its channel, its velocity, its place in the texture, and whether it doubles another channel. When the budget is full, the note with the least weight gives way. Before any note competes for a voice, a pool can merge unisons, fold octave doublings, hold tremolo re-strikes as one note, close legato gaps, keep only its top line, or thin its chords.

Pools divide the channels into groups that share voices. Tiers describe the chips that the voices come from, each with its channel count, the channels reserved for other sound, and the release time of its patches. The roll stipples each dropped note, the strip shows the reduced demand with one budget line for each tier, and Play plays the reduced arrangement. The tiers, the pools, and the priorities make up a plan, which is saved beside the MIDI file as a .monty file and loads with it. File > Save Reduced As... writes the result as a MIDI file of its own.

Arranging

Three commands on the Edit menu add parts to an arrangement that has voices to spare. Split Channel into Parts... gives each part of a channel a channel of its own. Double Channel... copies a channel onto a free channel at an interval, and Echo Channel... copies it after a delay.

Exporting

An export target writes the reduced arrangement for the sound chips of a platform. The Commander X16 target writes a ZSM file for the YM2151 and the VERA PSG, with a sound for each pool taken from its patch library or from the instrument of each channel, and an optional bar range and loop. Once the file is written, the target reads it back and checks it.

Controls

Action Control
Play or stop Space or Play on the toolbar
New file Ctrl+N
Open a file Ctrl+O
Save the file Ctrl+S
Select every note Ctrl+A
Clear the selection Esc
Delete the selection Del
Add a note on the active channel Double-click the piano roll
Move a note Drag the note
Resize a note Drag its right edge
Add a note to the selection, or take it out Shift and click
Zoom horizontally Ctrl and the mouse wheel, anchored at the pointer
Scroll horizontally Shift and the mouse wheel
Scroll vertically The mouse wheel
Play from the bar or beat under the pointer Right-click the piano roll
Delete a note or set its velocity Right-click the note
Set the tempo from a bar Double-click the tempo row of the ruler
Set, remove, or scale tempos Right-click the tempo row of the ruler

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 or 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 or 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.

Metadata

Release files for montyroll 0.3.0

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

Source distribution (sdist)

Source distribution for montyroll 0.3.0
File Size Uploaded Provenance
montyroll-0.3.0.tar.gz 169.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for montyroll 0.3.0
File Interpreter ABI Platform
montyroll-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 286.8 kB

Release files / montyroll-0.3.0.tar.gz

Download URL montyroll-0.3.0.tar.gz
Size 169.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f5eb9818e9febd6284f551be9967717e4c8cec77fa6ca0481c0d9f6ed882a9f9
BLAKE2b-256 checksum
How to use checksums
45a3c7013f574cd717193bda2ad8c7804a663f680629c77ef36c48c14226ad72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / montyroll-0.3.0-py3-none-any.whl

Download URL montyroll-0.3.0-py3-none-any.whl
Size 117.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e379e971ac699597034b06d867d2cb37477e18b1aa3c8b44b9a0838e06638f6
BLAKE2b-256 checksum
How to use checksums
40047497adc484b75e0adb730a100813bda19867adccabd467c52dfa64acfd8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for montyroll 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for montyroll-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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