ChordSnap is a Python-based web app that analyzes uploaded audio files (.mp3/.wav) and detects chords over time, featuring simple visualizations and instrument-specific presentation. 🎵
- Backend: FastAPI (Python) 🐍 with chroma-based chord detection (librosa) 🎼
- Frontend: Vite ⚡ + React ⚛️ + TypeScript 📘
[https://chord-snap.vercel.app/]
- Windows: Download from ffmpeg.org or use
winget install ffmpeg - Mac:
brew install ffmpeg - Linux:
sudo apt install ffmpegorsudo yum install ffmpeg
cd backend
python -m venv .venv
. .venv/Scripts/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000Note: If you encounter "Unspecified internal error" when uploading MP3/MP4 files, install FFmpeg or convert your files to WAV format.
The frontend is located in the project root.
npm install
npm run devOpen the frontend dev server URL shown in the console (e.g., http://localhost:5173).
Ensure the backend is running on http://localhost:8000 or update VITE_API_BASE_URL in .env accordingly.
- 📤 Upload
.mp3or.wavfiles - 🎸 Instrument Selection (Guitar, Piano, Ukulele)
- ⏱️ Chord Timeline with precise timestamps
- 🎧 Playback audio alongside detected chords
- Chord Detection: Uses chroma features and template matching for major/minor triads. Lightweight and CPU-friendly. 🧠
- Accuracy: Depends on audio quality, tuning, and arrangement. Future improvements may include key estimation, seventh chords, and HMM smoothing. 🔮
- POST
/analyze(multipart/form-data):file: Audio file 📁instrument: Optional instrument type 🎻- Returns:
{ segments: [{ startSec, endSec, chord, confidence }], durationSec }