An interactive browser-based tool for real-time chord detection, circle-of-fifths visualization, and music notation rendering.
- ๐น Piano & MIDI Keyboard Input โ Play chords by clicking keys, using standard computer keyboard mappings, or connecting physical MIDI devices (Web MIDI API)
- ๐ด Circle of Fifths Visualization โ Notes are displayed in a dynamic circular layout; active notes light up and connect with lines to show chord shapes at a glance
- ๐ Real-time Chord Detection โ Automatically identifies chord names (including complex extensions like
M7#5sus4) as you play, with multiple enharmonic candidates listed - ๐ผ Music Notation Rendering โ Renders played chords as proper staff notation (treble + bass clef) using Verovio
- ๐ต Multi-Instrument Audio Playback โ Plays realistic sounds (Piano, Guitars, Organ, Strings, Accordion, etc.) via Soundfont Player with Web Audio API
- ๐ Multiple Chord Replay Modes โ Audition chords in 8 playback patterns (Simultaneous, Ascending, Descending, Strumming, Bass & Chord / Oom-Pah, Up & Down, Alberti Bass, Random Harp)
- ๐ธ Guitar Voicings โ Calculates and displays guitar chord voicings and barre shapes (E-shape, A-shape)
- ๐๏ธ Key Signature Selection โ Choose any key signature (C major through 7 sharps/flats) to contextualize chord display
- ๐ Sustain Pedal Mode โ Hold notes beyond key release to build up extended chords (supports physical MIDI pedal CC 64)
- ๐ Chord History & Candidates โ Keeps a history of recently played chords; hover to preview, click to lock and re-examine or pick alternative chord names
- โจ๏ธ Extended Keyboard Mapping โ Expand standard computer keyboard mappings to cover more octaves
- ๐จ Theme & Accent Customization โ Light/Dark theme toggle with customizable accent color palette
- Node.js v18 or higher
- npm v9 or higher
git clone https://github.com/manh9011/ChordVisualizer.git
cd ChordVisualizer
npm installnpm run devOpen your browser at http://localhost:5173 (or the port shown in your terminal).
npm run buildThe compiled output will be in the dist/ directory โ ready to deploy as a static site.
npm run previewThe computer keyboard is mapped logically to resemble a real piano, using rows for white and black keys:
Standard Mapping (Octaves 4 & 5):
- White Keys:
โนQWERTYยUIOP[]\ - Black Keys:
12ย456ย89ย-=ยโซ
Extended Mapping (Octaves 3 & 6): (Enable in the panel to reach additional octaves)
-
White Keys:
โงZXCVBยNM,./โง -
Black Keys:
โชAยDFGยJKย;'ยโต -
Hold multiple keys simultaneously to build a chord.
-
Enable Sustain Pedal to keep notes ringing after key release (also compatible with hardware MIDI sustain pedals).
Click any key on the on-screen piano keyboard or connect a hardware USB/MIDI keyboard to trigger notes.
Detected chords are logged in the History panel. Hover over a history entry to preview the chord; click to lock it for detailed inspection. Press the ร button to remove individual entries or Clear to reset.
| Library | Purpose |
|---|---|
| Vue 3 | Reactive UI framework |
| TypeScript | Type safety |
| Vite | Build tooling & dev server |
| @tonaljs/tonal | Music theory (chord detection, note utilities) |
| Verovio | MusicXML โ SVG staff notation rendering |
| Soundfont Player | Web Audio API piano synthesis |
chord-visualizer/
โโโ src/
โ โโโ App.vue # Main application component & state management
โ โโโ main.ts # Vue app entry point
โ โโโ style.css # Global styles
โ โโโ keys.ts # Keyboard mapping definitions
โ โโโ components/ # Reusable UI components
โ โ โโโ AccentColorPicker.vue
โ โ โโโ ChooseChordPanel.vue
โ โ โโโ ChordCandidates.vue
โ โ โโโ ChordHistoryList.vue
โ โ โโโ ChordHistoryStrip.vue
โ โ โโโ CopyToast.vue
โ โ โโโ KeySignaturePicker.vue
โ โ โโโ MiniCircleOfFifths.vue
โ โ โโโ MobileKeySignatureList.vue
โ โ โโโ ReplayModeControl.vue
โ โ โโโ ScorePanel.vue
โ โ โโโ SustainIndicator.vue
โ โโโ layouts/ # Responsive layout containers
โ โ โโโ DesktopLayout.vue
โ โ โโโ MobileLayout.vue
โ โโโ utils/ # Core logic & helpers
โ โ โโโ CanvasRenderer.ts # Canvas-based circle-of-fifths visualization
โ โ โโโ GuitarVoicings.ts # Guitar chord voicing calculations
โ โ โโโ MusicLogic.ts # Chord detection, MIDI mapping, key utilities
โ โ โโโ MusicXml.ts # MusicXML generation for Verovio rendering
โ โโโ types/ # TypeScript type declarations
โ โโโ soundfont-player.d.ts
โ โโโ verovio.d.ts
โโโ public/ # Static assets
โโโ index.html # HTML entry point
โโโ vite.config.ts # Vite configuration
โโโ tsconfig.json # TypeScript configuration
Contributions are welcome! Here's how to get involved:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m 'feat: add some feature' - Push to your branch:
git push origin feature/your-feature-name - Open a Pull Request
Please follow Conventional Commits for commit messages.
- MIDI input device support
- Dark/light theme toggle
- More instrument soundfonts
- Export chord sheet as PDF/image
- Chord progression sequencer
- Mobile touch gesture improvements
This project is licensed under the MIT License โ see the LICENSE file for details.
- Tonal.js โ The backbone of all music theory computations
- Verovio โ Beautiful open-source music notation engraver
- Soundfont Player โ Simple Web Audio soundfont library
- The open-source music & web community ๐ถ
Made with โค๏ธ and music theory


