Install
openclaw skills install @flobo3/midi-pianoroll-renderopenclaw skills install @flobo3/midi-pianoroll-renderTurns any MIDI file into a polished piano-roll PNG: colored note blocks with note letters inside, a large chord track, automatic key + tempo detection, and a chromatic color legend. Two orientations are supported: vertical (time ↓ down, Synthesia-style falling notes — default) and horizontal (time → right, classic DAW style).
mido and Pillow (pip install mido pillow)consolab.ttf (Windows Consolas Bold) and silently fall back to PIL's default font elsewhere# vertical roll (time ↓ down, portrait) — DEFAULT, best for playing along
python scripts/render_vertical.py song.mid song_vertical.png
# horizontal roll (time → right, DAW-style) — option for wide screens / long phrases
python scripts/render_any.py song.mid song_roll.png
Common options (both scripts):
| Flag | Meaning |
|---|---|
--bars N | Render exactly N bars (skips auto-detection) |
--start N | Start from bar N (skip an empty intro) |
--mel T | Force melody track index |
--acc T | Force accompaniment/bass track index |
Example:
# Skip a sparse 10-bar intro, start at the main groove, force track roles
python scripts/render_any.py mario.mid mario_roll.png --mel 1 --acc 6 --start 10
--mel / --acc when a MIDI has odd instrumentation (e.g., a percussion track with a higher average pitch).Key: Gm (bb), Key: C# (#######).--bars, the canvas keeps a 4:3-derived height instead.Emaj7 for a plain C major passage) and enharmonic oddities (A#m with 7 sharps instead of the conventional Bbm). Labels are advisory — hand-correct for publication.melody=<idx> line and override if needed.--start to jump into the music.scripts/render_vertical.py — vertical renderer (default; falling-notes style, best for playing)scripts/render_any.py — horizontal renderer (DAW-style alternative)Both are standalone (stdlib + mido + Pillow) and safe to copy into any project.
assets/tetris_vertical.png — vertical: Tetris (Korobeiniki) theme, 4 bars, A minor 80 BPMassets/september_horizontal.png — horizontal: Wake Me Up When September Ends, 8 bars, G major 104 BPM