A terminal MIDI player and multi-track piano roll visualizer built with Rust and Ratatui.
miditui renders a multi-track piano roll with truecolor track palettes, interactive scrubbing, and real-time audio playback through your default speakers using SoundFont synthesis or a built-in fallback synth.
- Multi-Track Piano Roll: High-resolution semitone grid with labeled piano keys, beat rulers, and distinct 24-bit color palettes for each track.
- Real-Time Playhead: Smooth vertical playhead tracking with auto-scrolling viewport follow mode.
- Built-in Audio Synthesis:
- Automatically detects and loads General MIDI SoundFont (
.sf2) files viarustysynthandcpal. - Includes a zero-dependency polyphonic waveform synthesizer fallback so sound works immediately on any machine without downloading extra files.
- Automatically detects and loads General MIDI SoundFont (
- Interactive Controls:
- Full keyboard shortcuts for playback, scrubbing, zooming, octave shifting, and track muting/soloing.
- Mouse and touch tap support: click tracks to select, click
[M]/[S]to toggle mute/solo, and click the transport bar to scrub.
- Demo Mode: Run without any arguments to generate and play an expressive 4-track jam (Overdriven Guitar, Electric Bass, Lead Synth, and Drums).
Make sure you have Rust installed (1.85+ recommended), along with ALSA headers on Linux:
# Ubuntu / Debian
sudo apt-get install libasound2-dev pkg-config
# Fedora / RHEL
sudo dnf install alsa-lib-devel pkg-config
# Arch Linux
sudo pacman -S alsa-lib pkgconfcargo install midi-tuimiditui path/to/song.midIf the filename or directory path contains spaces, wrap it in quotes:
miditui "Alkaline Trio – Mercy Me.mid"Running without any arguments launches the built-in 4-track demo jam:
midituimiditui path/to/song.mid --sf2 /path/to/soundfont.sf2You can also set the SOUNDFONT environment variable:
export SOUNDFONT=/path/to/GeneralUser_GS.sf2
miditui path/to/song.midmiditui path/to/song.mid --info| Key | Action |
|---|---|
Space |
Play / Pause |
Left / h |
Seek backward 5 seconds |
Right / l |
Seek forward 5 seconds |
[ / ] |
Seek backward / forward 1 measure |
Home |
Rewind to start |
r |
Toggle repeat / loop mode |
, / . (< / >) |
Decrease / increase master volume |
| Key | Action |
|---|---|
Up / k |
Scroll piano pitch upward |
Down / j |
Scroll piano pitch downward |
+ / = |
Zoom time axis in |
- / _ |
Zoom time axis out |
f |
Toggle auto-follow playhead |
| Key | Action |
|---|---|
Tab / Shift+Tab |
Select next / previous track |
m |
Toggle mute on selected track |
s |
Toggle solo on selected track |
1 .. 9 |
Quick toggle mute for tracks 1 through 9 |
- Click any track row to select it.
- Click
[M]or[S]on a track to mute or solo. - Click
⏵/⏸on the transport bar to toggle playback. - Click anywhere on the progress bar to scrub directly to that position.
- Mouse wheel scrolls pitch up and down.
| Key | Action |
|---|---|
? |
Toggle help overlay modal |
Esc / q |
Close help modal / Quit application |
git clone https://github.com/pinkpixel-dev/miditui.git
cd miditui
cargo build --releaseThe compiled binary will be placed at target/release/miditui.
If you are running directly from the source repository instead of installing via Cargo, replace miditui with cargo run --release -- (for example: cargo run --release -- "song.mid").
Apache 2.0. See LICENSE for details.