Skip to content

Latest commit

ย 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Chord Visualizer Banner

๐ŸŽต Chord Visualizer

An interactive browser-based tool for real-time chord detection, circle-of-fifths visualization, and music notation rendering.

Music Vue 3 TypeScript Vite MIT License


โœจ Features

  • ๐ŸŽน 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

๐Ÿ–ผ๏ธ Screenshots

Main desktop interface โ€” Circle of fifths visualization with staff notation and piano keyboard


Main desktop interface

Main mobile interface โ€” Circle of fifths visualization with staff notation


Main mobile interface

๐Ÿš€ Getting Started

Prerequisites

  • Node.js v18 or higher
  • npm v9 or higher

Installation

git clone https://github.com/manh9011/ChordVisualizer.git
cd ChordVisualizer

npm install

Development

npm run dev

Open your browser at http://localhost:5173 (or the port shown in your terminal).

Production Build

npm run build

The compiled output will be in the dist/ directory โ€” ready to deploy as a static site.

Preview Production Build

npm run preview

๐ŸŽฎ How to Use

Keyboard & MIDI Shortcuts

The computer keyboard is mapped logically to resemble a real piano, using rows for white and black keys:

Standard Mapping (Octaves 4 & 5):

  • White Keys: โ†น Q W E R T Y ย  U I O P [ ] \
  • Black Keys: 1 2 ย  4 5 6 ย  8 9 ย  - = ย  โŒซ

Extended Mapping (Octaves 3 & 6): (Enable in the panel to reach additional octaves)

  • White Keys: โ‡ง Z X C V B ย  N M , . / โ‡ง

  • Black Keys: โ‡ช A ย  D F G ย  J K ย  ; ' ย  โ†ต

  • 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).

Mouse / Touch / MIDI

Click any key on the on-screen piano keyboard or connect a hardware USB/MIDI keyboard to trigger notes.

Chord History

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.


๐Ÿ—๏ธ Tech Stack

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

๐Ÿ“ Project Structure

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

๐Ÿค Contributing

Contributions are welcome! Here's how to get involved:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -m 'feat: add some feature'
  4. Push to your branch: git push origin feature/your-feature-name
  5. Open a Pull Request

Please follow Conventional Commits for commit messages.

Ideas for Contributions

  • MIDI input device support
  • Dark/light theme toggle
  • More instrument soundfonts
  • Export chord sheet as PDF/image
  • Chord progression sequencer
  • Mobile touch gesture improvements

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


๐Ÿ™ Acknowledgements

  • 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

About

An interactive browser-based tool for real-time chord detection, circle-of-fifths visualization, and music notation rendering.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Sponsor this project

Packages

Contributors

Languages