A spectacular, fully-featured grand piano in your terminal with colorful note visualization, MIDI playback, and recording capabilities. Experience music in living color with note-specific visual effects and full-width responsive piano layout!
- Realistic Grand Piano: Multi-octave piano with authentic sound samples
- MIDI File Playback: Load and play .mid files with full visual synchronization
- Audio Recording: Record and playback your performances
- Volume Control: Real-time volume adjustment with visual feedback
- Sustain Pedal: Hold notes for expressive playing
- Colorful Note Visualization: Each musical note (C, C#, D, etc.) has its own distinctive color
- Piano Key Lighting: Keys light up in note-specific colors when played
- Musical Particle Effects: Colorful musical symbols (βͺβ«β¬β) rain down from played keys
- Velocity-Sensitive Effects: Louder MIDI notes create more spectacular visual bursts
- Full-Width Piano Layout: Responsive piano that adapts to your terminal width
- Full-Screen Piano: Dynamic layout that spans your entire terminal width
- Multi-Octave Display: Shows 3-7 octaves depending on terminal width
- Real-time Key Mapping: Visual display of keyboard-to-piano key assignments
- Note Names: Display of musical note names on keys
- Octave Navigation: Easy octave switching with visual indicators
- Keyboard Mapping: Play using your QWERTY keyboard with intelligent key mapping
- MIDI Progress: Visual progress bar during MIDI playback
- Help System: Built-in help with F1 key
- Status Messages: Real-time feedback for all actions
- Debug Mode: Advanced debugging capabilities
brew tap lalo/tools
brew install terminal-pianogit clone https://github.com/yourusername/terminal-piano
cd terminal-piano
cargo build --release # or make build
./target/release/terminal-pianoterminal-piano- First Octave:
Q W E R T Y U I O P(white keys) +2 3 5 6 7 9 0(black keys) - Second Octave:
A S D F G H J K L ;(white keys) +1 4 8 - =(black keys) - Lower Notes:
Z X C V B N M(additional lower notes) - Sustain Pedal:
Space- Hold notes longer - Volume Control:
[ ]- Decrease/increase volume - Octave Control:
+ _- Change octave up/down
- Load MIDI File:
L- Load and select .mid files - MIDI Playback:
Shift + P(Capital P) - Play/pause MIDI files - Recording:
R- Start/stop recording your performance - Playback Recording:
p(lowercase p) - Play your last recording
- Help:
F1- Show/hide help screen - Metronome:
M- Toggle metronome on/off - Quit:
Qorq- Exit the application
Each note has its own distinctive color:
- C: π΄ Bright Red
- C#: π Warm Orange
- D: π‘ Golden Yellow
- D#: π’ Green Yellow
- E: π’ Lime Green
- F: π’ Teal Green
- F#: π΅ Sky Blue
- G: π΅ Dodger Blue
- G#: π£ Blue Violet
- A: π©· Deep Pink
- A#: π©· Hot Pink
- B: π Orange
The piano automatically adapts to your terminal width, showing 3-7 octaves:
Terminal Width: Narrow (80 cols) Wide (120+ cols)
βββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ βββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ¬ββ
β ββ―β ββ―β β ββ―β ββ―β ββ―β β β ββ―β ββ―β β ββ―β ββ―β ββ―β β ββ―β ββ―β β ββ―β ββ―β ββ―β β
β ββ¬β ββ¬β β ββ¬β ββ¬β ββ¬β β β ββ¬β ββ¬β β ββ¬β ββ¬β ββ¬β β ββ¬β ββ¬β β ββ¬β ββ¬β ββ¬β β
β Cβ Dβ Eβ Fβ Gβ Aβ Bβ β Cβ Dβ Eβ Fβ Gβ Aβ Bβ Cβ Dβ Eβ Fβ Gβ Aβ Bβ Cβ Dβ Eβ
ββββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ ββββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ΄βββ
Q W E R T Y U Q W E R T Y U I O P A S D F G H J
2 3 5 6 7 9 0
Key Features:
- Responsive Design: Piano scales with terminal width
- Color-Coded Keys: Each key lights up in its note-specific color
- Visual Feedback: Pressed keys show bright color highlights
- Note Labels: Musical note names displayed on each key
Load MIDI files for a spectacular visual and audio experience:
# Load MIDI file on startup
terminal-piano song.mid
# Or load within the app
# Press 'L' and select your .mid file- Colorful Key Lighting: Piano keys light up in note-specific colors as the music plays
- Musical Particle Rain: Colorful musical symbols (βͺβ«β¬β) cascade from active keys
- Velocity-Sensitive Effects: Louder passages create more spectacular particle bursts
- Progress Visualization: See playback progress with a visual timeline
- Harmonic Colors: Watch chords and melodies unfold in beautiful color combinations
- Full MIDI Event Support: Note on/off, velocity, timing
- Polyphonic Playback: Multiple notes and complex harmonies
- Tempo Accurate: Precise timing reproduction
- Visual Synchronization: Perfect sync between audio and visual effects
The repository includes a collection of beautiful MIDI files in the midi-demos/ folder:
# Play a demo file directly
terminal-piano midi-demos/debussy-clair-de-lune.mid
terminal-piano midi-demos/bach-invention-1.mid
terminal-piano midi-demos/chopin-minute-waltz.mid
# Or load them within the app using 'L' keyIncluded Demos:
- π Debussy - Clair de Lune: Perfect for experiencing the colorful visual effects
- πΌ Bach - Invention No. 1: Great for seeing counterpoint in different colors
- πΉ Chopin - Minute Waltz: Fast passages showcase velocity-sensitive particle effects
- π΅ Mozart - Turkish March: Classical melody with beautiful harmonic colors
- πΆ Beethoven - FΓΌr Elise: Iconic piece demonstrating the full color palette
These demo files are perfect for experiencing the full visual spectacle of Terminal Piano!
Recordings are saved in ~/.terminal-piano/recordings/ as both MIDI and WAV files.
Config file location: ~/.terminal-piano/config.toml
[audio]
sample_rate = 44100
buffer_size = 256
sound_font = "default" # or path to .sf2 file
[ui]
color_scheme = "classic" # classic, neon, minimal
show_notes = true
show_keyboard_hints = true
[midi]
input_device = "auto" # or specific device name
output_device = "auto"- UTF-8 Support: Modern terminal with Unicode character support
- True Color Support: 24-bit color terminal for full visual effects
- Works: VS Code terminal, iTerm2, Alacritty, Kitty, Windows Terminal
- Limited: Standard Terminal.app, older terminals (fallback to basic colors)
- Audio Device: Working audio output for sound playback
- Minimum Width: 80 columns recommended (adapts to any width)
If colors don't appear correctly, try:
# Enable true color support
export COLORTERM=truecolor
./target/release/terminal-piano
# Or set terminal type
export TERM=xterm-256color
./target/release/terminal-piano- Binary: ~10MB
- Audio Samples: Generated on-demand
- Recordings: Variable (depends on usage)
- Rust 1.70+ (if using Rust implementation)
- or Go 1.21+ (if using Go implementation)
make build
make test
make installWe welcome contributions! Please see CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.
- β Fixed MIDI Playback: Resolved capital P key detection for MIDI play/pause
- π Colorful Note Visualization: Each note now has its own distinctive color
- πΉ Full-Width Piano Layout: Piano now spans entire terminal width with adaptive octave display
- β¨ Enhanced Visual Effects: Velocity-sensitive particle effects with musical symbols
- π΅ Improved Audio Engine: Better note triggering and audio device handling
- π§ Key Mapping Overhaul: Complete keyboard mapping system with multi-octave support
- π¨ Responsive Design: Piano automatically adjusts to terminal width (3-7 octaves)
- Fixed timing calculations for accurate MIDI playback
- Optimized particle rendering for smooth visual effects
- Enhanced audio initialization with better error handling
- Improved key press detection and response
The app uses a carefully crafted color palette for each musical note:
- Warm Colors: C, C#, D, B (reds, oranges, yellows)
- Cool Colors: F#, G, G# (blues, purples)
- Nature Colors: D#, E, F (greens, teals)
- Accent Colors: A, A# (pinks)
We welcome contributions! Areas where help is appreciated:
- Additional audio sample formats
- More visual effect patterns
- Terminal compatibility improvements
- Performance optimizations
- MIDI feature enhancements
MIT License - see LICENSE for details.
- Inspired by piano-rs and terminal music applications
- Built with Rust, Ratatui, and Rodio for audio
- Musical symbols and Unicode support
- Community feedback and testing
Made with βͺ and π by the Terminal Piano team