Version 2.0.0 - Now built with TypeScript for enhanced type safety and maintainability
This project develops a hybrid piano interface that solves a fundamental problem in music: traditional piano keyboards force musicians to memorize 12 different physical patterns for every chord, scale, and progression due to a geometric mismatch between uniform musical space (12 equal semitones) and the asymmetric piano keyboard layout (7 white + 5 black keys).
Rather than replacing the piano with an isomorphic keyboard (which faces insurmountable adoption barriers), we augment the standard keyboard with intelligent controls that let musicians think in functional harmony (root + quality + extensions) instead of specific note names.
The piano keyboard attempts an impossible mapping: fitting 12 equal chromatic semitones onto a 7+5 diatonic-chromatic hybrid layout with asymmetric spacing. This creates transpositional non-invariance:
- C major scale: all white keys in a horizontal line
- F# major scale: five black keys and two white keys at different depths
- C major 7th chord (C-E-G-B): four white keys at uniform depth
- C# major 7th (C#-F-G#-C): alternating between elevated black keys and recessed white keys
- 6-12 months of daily practice needed for basic fluency across all major scales
- 1-2 years for solid technique in all keys
- Learning C major provides zero motor pattern transfer to F# major
- Professional pianists still process complex keys measurably slower than simple keys
- Musicians must memorize 12 distinct physical patterns for every chord type
Preserve everything pianists know while eliminating what they must memorize.
The system maintains the standard 88-key piano keyboard completely unchanged while adding auxiliary controls that provide isomorphic logic for chord selection. Musicians can:
- Play traditionally (ignoring all augmentations)
- Use simplified chord selection (auxiliary controls)
- Mix both approaches seamlessly
Contemporary musicians don't think in note names - they think in:
- Functional relationships: I-IV-V, ii-V-I progressions
- Interval patterns: major thirds, perfect fifths
- Chord structures: root + quality + extensions
- Scale degrees: 1-2-3-4-5-6-7 relative to tonic
Our interface matches these mental models.
- ~6,000 lines of JavaScript migrated to TypeScript across 23 files
- Zero compilation errors - fully type-safe codebase
- Comprehensive type system with music theory types (
Note,Chord,Scale, etc.) - Path aliases for clean imports (
@voicing/,@input/,@audio/,@utils/,@ui/) - Full JSDoc documentation throughout
Play entire chord progressions from text input:
- Simple syntax:
C Am F GorDm7 G7 Cmaj7 - Octave specification:
(4) C Am F G(centers voicing on octave 4) - Slash chords:
Cm7/A(custom bass note) - Double slash notation:
Cm7/A//F(custom bass AND top note) - Supports: Major, Minor, 7th, Maj7, Min7, 9ths, Sus2/Sus4, Diminished, Half-diminished
An experimental feature for adventurous musicians that applies non-diatonic chord substitutions using:
- Chromatic mediants
- Parallel chords
- Tritone substitutions
- Modal interchange
- Cluster voicings for smooth voice leading
- Press
,(comma) to rotate chord notes downward - Press
.(period) to rotate chord notes upward - Explore different voicings of the same chord instantly
- Color-coded chord tones now include extensions:
- Root (red), Third (blue), Fifth (green), Seventh (yellow)
- Ninth, Eleventh, Thirteenth (purple/pink tones)
- Vite for lightning-fast development with HMR
- Vitest for testing
- ESLint + Prettier for code quality
- Node 18+ required
- Standard 88-key piano keyboard remains fully functional
- Auxiliary controls positioned above/beside keyboard
- Musicians can ignore augmentations entirely
- Preserves compatibility with existing technique, repertoire, pedagogy
Interface lets musicians specify:
- Root note (12 chromatic options via circle of fifths)
- Quality (Major 7, Dominant 7, Minor 7, Half-diminished, Diminished)
- Extensions (11th and 13th via keyboard modifiers with automatic compatibility logic)
- Cmd adds 13th (major/dominant chords only)
- Ctrl adds 11th (#11 for major/dominant, natural 11 for minor)
The system knows tertian harmony patterns and handles geometric mapping automatically.
Scale step progression builders: I, ii, iii, IV, V, vi, vii° buttons that:
- Trigger appropriate chord qualities automatically (I = major 7, ii = minor 7, V = dominant 7)
- Work identically in all 12 keys
- Support mode selection (Ionian, Dorian, Phrygian, Lydian, Mixolydian, Aeolian, Locrian)
Think "I want a ii-V-I in Bb" and press three buttons - the system handles note selection.
When moving between chords, the system calculates optimal voice leading:
- Retain common tones
- Move other voices minimally
- Prefer contrary motion between bass and upper voices
Supports four voicing styles:
- Close voicing: all notes within octave
- Drop-2 voicing: drop second voice from top
- Drop-2-4 voicing: drop both second and fourth voices from top (wider jazz voicing)
- Jazz/Guide voicing: rootless voicings emphasizing 3rd and 7th
LED-capable keyboard provides visual feedback:
- Root notes (red)
- Thirds (blue)
- Fifths (green)
- Sevenths (yellow)
- Extensions (11th/13th) (purple)
Multiple display modes:
- Show only chord tones
- Show full scale
- Show available tensions
- Show voice leading arrows between chords
Despite all simplifications, musicians retain unrestricted chromatic access:
- Secondary dominants
- Modal interchange borrowing
- Chromatic passing tones
- Unexpected color notes
The system never prevents playing any pitch. Essential for sophisticated harmony in jazz and contemporary music.
All patterns work identically in all keys:
- Program a ii-V-I in C major
- Change key selector to G♭
- Same button presses work instantly
- Transposition reduces to single-button key change
Physical Buttons:
- 12 root buttons (circle of fifths arrangement)
- 7 scale mode buttons (Major, Minor, Dorian, Mixolydian, etc.)
- 7 scale step buttons (I, ii, iii, IV, V, vi, vii°)
- 4 voicing style buttons (Close, Drop-2, Drop-2-4, Jazz/Guide)
Keyboard Modifiers:
- Shift: Octave shift (+8va)
- Cmd: Add 13th extension
- Ctrl: Add 11th extension (#11 for major, natural 11 for minor)
- Space: Chord mode (trigger contextual chords from scale degrees)
Physical form factor: 12" x 4" x 2" console mountable above any piano.
The system automatically calculates optimal voice leading between chords:
- Retains common tones when possible
- Moves other voices with minimal finger movement
- Prefers contrary motion between bass and upper voices
- Supports multiple voicing styles for different musical contexts
- Major 7th: M3+m3+M3 (intervals: 0, 4, 7, 11)
- Dominant 7th: M3+m3+m3 (intervals: 0, 4, 7, 10)
- Minor 7th: m3+M3+m3 (intervals: 0, 3, 7, 10)
- Half-diminished 7th: m3+m3+M3 (intervals: 0, 3, 6, 10)
- Fully diminished 7th: m3+m3+m3 (intervals: 0, 3, 6, 9)
The system automatically enforces music theory compatibility:
- Major & Dominant chords: Can take 11th (#11) and 13th
- Minor chords: Can take 11th (natural) only
- Diminished chords: Extensions not typically used
These patterns are identical in all 12 keys - piano's physical layout obscures this invariance.
- Expressive E Osmose ($1,799): Maintains traditional keys, adds 3D control. Pre-orders sold out. Lesson: evolutionary beats revolutionary.
- LinnStrument: 5,300+ units since 2014, sustained profitability. Lesson: sustainable niche beats hypergrowth.
- Launchpad Pro MK3: Only mainstream grid controller with chord mode. Lesson: simple features users want beat complex features designers think are cool.
- Scaler 2 ($59): Strong professional adoption by augmenting workflow. Lesson: suggest and facilitate, don't automate and restrict.
- ROLI: £101M raised, £34.1M losses, bankruptcy 2021. Revolutionary continuous surface intimidated keyboard players. Over-invested in hypergrowth.
- Continuous surfaces: Require complete retraining, alienate existing pianists.
- Scale-lock modes: Remove control that advanced players need.
- Preserve existing skills: Musicians have years invested in piano technique
- Provide escape hatches: Never remove chromatic access or full control
- Use open standards: MIDI compatibility ensures longevity
- Target realistic markets: Educators, jazz pianists, church musicians, composition students
- Build sustainably: $500-$800 prosumer price point, not venture-backed hypergrowth
- Physical control console with 27+ buttons
- Circle of fifths layout for key selection
- Color-coded button groups for intuitive operation
- Small display for chord/voicing information
- MIDI output for maximum compatibility
- LED lighting for piano keyboard
- Color-coded chord tone highlighting
- Multiple display modes (chord tones, full scale, tensions)
- Real-time visual feedback
- Common progression storage (I-V-vi-IV, ii-V-I, 12-bar blues)
- User-programmable custom progressions
- Quick recall for frequently used patterns
- Voice leading arrow visualization
- Mode selection (Ionian, Dorian, Phrygian, etc.)
- Chromatic overlay mode indicator
- Transpose function
- Computer software for configuration
- Quick ii-V-I progression practice in all keys
- Optimal voice leading for comping
- Exploration of chord extensions (11th, 13th) with automatic compatibility
- Transposition of standards
- Visual demonstration of harmonic theory
- Teaching voice leading principles
- Key-independent pattern learning
- Immediate feedback for students
- Quick chord progression building for hymns
- Transposition for different vocalists
- Professional-sounding voicings instantly
- Minimal practice time required
- Exploration of harmonic possibilities
- Voice leading experimentation
- Progression prototyping
- Theory made tangible
This project synthesizes research from:
- Music theory: Tertian harmony, voice leading, functional harmony
- Cognitive science: Expert vs. novice processing, chunking, motor learning
- Pedagogy: Scale degree vs. interval thinking, pattern recognition
- Alternative instruments: Isomorphic keyboards, Jankó, Wicki-Hayden, Harmonic Table
- Commercial products: Osmose, LinnStrument, ROLI, Launchpad Pro, Scaler 2
- Piano design: 300-year-old layout, path dependency, network effects
The cognitive problem isn't memorization capacity - it's geometric mapping. Musicians understand that all major 7th chords have the same structure; the challenge is that this structure maps to different physical patterns depending on root note.
Instead of changing the physical layout (isomorphic keyboards), we add an abstraction layer that thinks isomorphically while maintaining the familiar interface.
- Day 1: Play traditional repertoire normally
- Week 1: Try simple I-IV-V progressions with scale steps
- Month 1: Explore voice leading optimization
- Year 1: Master transposition and extensions
- Year 5+: Use chromatic overlay for sophisticated harmony
Beginners benefit from simplified chord selection. Experts benefit from voice leading optimization and visual feedback. Advanced players use chromatic escape hatch for color notes and modal interchange.
$500-$800: Prosumer sweet spot
- Less than Osmose ($1,799)
- More than Launchpad Pro ($449)
- Justified by piano-specific integration and sophistication
- Console unit above keyboard (like organ stops)
- Side panel to left of keyboard
- Touch strip along fallboard/music desk
- iPad/tablet app mounted on music desk
Console provides most physical buttons and best visibility for initial version.
- Music educators: 10,000s potential
- Jazz pianists: 100,000s potential
- Church musicians: 100,000s potential
- Composition students: 10,000s potential
Aggregate: viable niche market without requiring mainstream piano replacement.
Based on commercial failures:
- ❌ Never remove chromatic access (auto-accompaniment keyboard limitation)
- ❌ Never require complete retraining (continuous surface failure)
- ❌ Never build proprietary lock-in (ROLI abandonware concerns)
- ❌ Never design for hypergrowth (venture capital incompatibility)
- ❌ Never sacrifice build quality (cheap MIDI controller complaints)
- ❌ Never ignore user feedback (Push chord mode requests ignored 6+ years)
Instead:
- ✅ Maintain backward compatibility
- ✅ Support incremental adoption
- ✅ Use open standards (MIDI)
- ✅ Build sustainably
- ✅ Prioritize reliability
- ✅ Listen to musicians' actual needs
Make theory visible and memorization obsolete.
Musicians don't need a new keyboard - they need an intelligent co-pilot that knows music theory so they can focus on music making. The tertian harmony patterns are systematic and key-independent; the voice leading principles are mathematical and predictable; the functional progressions are universal across styles.
All of this knowledge can be encoded in 27 buttons and supporting logic, turning the piano from a difficult-to-master mechanical device into an intuitive musical thought interface that grows with the player from beginner to expert.
# Clone the repository
git clone <repository-url>
cd best-instrument
# Install dependencies (requires Node 18+)
npm install# Start the development server with hot module reloading
npm run dev
# Server will start at http://localhost:3001
# Open in your browser and start playing!- Select a key: Click root buttons (C, G, D, etc.)
- Choose quality: Click chord quality buttons (Maj7, Min7, Dom7)
- Add extensions: Hold
Cmdfor 13th,Ctrlfor 11th - Watch the keyboard: See chord tones highlighted in color
- Set your key: Click a root note (e.g., C)
- Choose scale: Select Ionian (Major) or other modes
- Build progressions: Click I → IV → V → I or ii → V → I
- Observe voice leading: Watch how the system minimizes hand movement
- Try different voicings: Close, Drop-2, Drop-2-4, Guide
- Notice how voice leading changes with each style
- Enable Smart Voicing for automatic optimization
- Enter a progression:
(4) C Am F GorDm7 G7 Cmaj7 - Press Play or hit Enter
- Watch and listen as the system plays through your progression
- Try slash chords:
Cm7/Aor double slash:Cm7/A//F
- Jazz Wormhole Mode: Click the JAZZ button for harmonic surprises
- Inversions: Use
,and.to rotate chord notes - Pedal Points: Click Pedal button, then press a key to set sustain
1-7: Play diatonic scale degrees8-9-0-=: Upper octave scale degrees (8-14)Space+1-7: Trigger contextual chords (I, ii, iii, IV, V, vi, vii°)- Piano keys work as expected for direct note playing
Shift: Octave shift (+8va)Cmd: Add 13th extensionCtrl: Add 11th extension,(comma): Rotate chord downward.(period): Rotate chord upward
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Run tests
npm test
# Run tests with UI
npm run test:ui
# Run tests with coverage
npm run test:coverage
# Type check without emitting
npm run typecheck
# Format code
npm run format
# Lint code
npm run lintsrc/
├── types/ # TypeScript type definitions
│ ├── music.ts # Music theory types (Note, Chord, Scale, etc.)
│ ├── state.ts # Application state types
│ └── index.ts # Type exports
├── audio/ # Web Audio API integration
│ ├── audioContext.ts
│ └── playback.ts
├── input/ # Keyboard and user input handling
│ ├── constants.ts
│ ├── keyboardInput.ts
│ ├── keyboardMap.ts
│ ├── scaleDegreePlayer.ts
│ ├── chordTrigger.ts
│ └── notePlayback.ts
├── voicing/ # Chord voicing and voice leading
│ ├── constants.ts
│ ├── state.ts
│ ├── generators.ts
│ ├── optimizer.ts
│ ├── updater.ts
│ └── wormhole.ts # Experimental chord substitution
├── ui/ # User interface components
│ ├── display.ts
│ ├── eventHandlers.ts
│ ├── keyboard.ts
│ ├── scaleStepCarousel.ts
│ └── chordProgressionPlayer.ts
├── utils/ # Utility functions
│ └── helpers.ts
├── analysis/ # Key detection
│ └── keyDetection.js
├── looper/ # Looping functionality
│ └── looper.js
└── init.ts # Application entry point
- Strict type checking for all music theory operations
- Path aliases for clean imports (configured in
tsconfig.json) - Full IDE support with autocomplete and inline documentation
- Compile-time error detection prevents runtime bugs
- JSDoc comments provide context-aware help
The project uses Vitest for testing. Tests will be added incrementally as features stabilize.
# Run tests in watch mode
npm test
# Run tests once
npm run test:run
# View test UI
npm run test:uiThe project uses ESLint and Prettier to maintain code quality:
# Check for linting errors
npm run lint
# Auto-format all code
npm run formatSee implementation phases above for hardware development roadmap.
This project exists at the intersection of music theory, cognitive science, interface design, and sustainable innovation. It proves that you don't need to reinvent the piano - you need to augment it intelligently.