midi-ascii-art
v1.1.0
Published
Generate beautiful ASCII art patterns in your terminal by playing MIDI keys
Maintainers
Readme
MIDI ASCII Art
Generate beautiful ASCII art patterns in your terminal by playing MIDI keys
⚠️ This project has been vibe coded
A real-time MIDI visualizer that transforms your keyboard playing into mesmerizing ASCII art. Each of the 88 piano keys triggers one of seven unique patterns—waves, spirals, grids, and more—creating an interactive visual experience right in your terminal.
Install
npm installUsage
CLI
npm start
npm start -- --columns 100 --rows 30
npm start -- --color red
npm start -- --color random
npm start -- --verboseOptions
-c, --columns <number>- Number of columns (default: terminal width)-r, --rows <number>- Number of rows (default: terminal height - 2)--color <color>- Color for ASCII art (default: white)- Named colors:
black,red,green,yellow,blue,magenta,cyan,white,gray,redBright,greenBright,yellowBright,blueBright,magentaBright,cyanBright,whiteBright - Use
randomfor a random color on each run
- Named colors:
-v, --verbose- Show note info when keys are pressed (default: false)-h, --help- Display help information-V, --version- Display version number
Requirements
- Node.js (v22 or higher)
- A MIDI keyboard or controller connected to your computer
How it Works
- The program lists all available MIDI inputs
- Connects to the first available MIDI device
- Each MIDI key is assigned to one of 7 patterns based on its note number
- When you press a key, the terminal clears and displays the generated ASCII art
- Each key maintains its own randomization seed for consistent variations
- Press
Ctrl+Cto exit
Examples
# Run with default terminal dimensions
npm start
# Run with custom dimensions
npm start -- --columns 100 --rows 30
# Run with smaller output
npm start -- --columns 50 --rows 20
# Run with colored output
npm start -- --color cyan
# Run with random color
npm start -- --color random
# Run with verbose note info
npm start -- --verboseExample output when playing a MIDI key:
🎹 Note: 60 | Velocity: 100 | Pattern: circle
○
◎ ◎
● ●
◉ ◉
◌ ◌
⊙ ⊙
⊚ ⊚
◌ ◌
◉ ◉Patterns
The app cycles through 7 patterns based on key number:
- Wave - Flowing sine wave patterns with various characters
- Diagonal - Angled lines and box-drawing characters
- Circle - Radial/circular patterns emanating from center
- Grid - Structured box-drawing grid patterns
- Noise - Random dot/point distributions
- Chevron - Zigzag/chevron arrow patterns
- Spiral - Spiraling circular forms
Each of the 88 piano keys maps to one of these 7 patterns using modulo arithmetic. Each key produces consistent but unique variations using seeded randomization.
Features
- 🎹 Real-time MIDI input detection
- 🎨 7 unique ASCII art patterns (wave, diagonal, circle, grid, noise, chevron, spiral)
- 🌈 Colorful output with 16 color options or random colors
- 🎲 Seeded randomization - each key produces consistent but unique variations
- 📐 Customizable terminal size
- ✨ Clean fullscreen display
- 🛡️ Graceful error handling and shutdown
Development
# Install dependencies
npm install
# Run tests
npm test
# Lint and format code
npm run format
# Run the application
npm start