An experimental deep learning project for real-time chord recognition from audio input. This project demonstrates how machine learning can be applied to music analysis. You can access the demo at https://onehotchord.com
Note: This is an experimental project and may not work perfectly in all scenarios.
- Real-time chord recognition from audio input
- Browser-based interface with visual feedback
- Privacy-focused design - all processing happens on your device
- Supports common chord types: major, minor, diminished, 7th chords
- Responsive visualization of detected notes
One Hot Chord uses a deep neural network to analyze audio and identify chords:
- Captures audio from your microphone
- Extracts frequency information using a Constant-Q Transform
- Processes these features through a neural network
- Identifies the root note and chord type
- Displays the results in real-time
gen_samples.py
- Generates synthetic chord samples for trainingpreprocess.py
- Extracts features from audio samplestrain.py
- Trains the neural network modelmodel.py
- Defines the neural network architecturedocs/
- Web demo
- Python 3.8+
- FluidSynth and a SoundFont file (for sample generation)
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Download a SoundFont file (e.g., FluidR3_GM.sf2) to the
sf2/
directory
# Generate training samples
python gen_samples.py
# Preprocess audio samples
python preprocess.py [wav files]
# Train the model
python train.py chord_dataset.npz
# Try real-time recognition
python listen.py
Serve the web interface:
cd www
python -m http.server 8000
Then open your browser to http://localhost:8000
This is still an experimental project built in a weekend. It has limitations:
- Works best with clean audio input
- May struggle with complex chord voicings
- Limited to the chord types it was trained on
- Performance varies depending on audio quality and background noise
This project is licensed under the Apache License - see the LICENSE file for details.
- FluidSynth for MIDI synthesis
- Librosa for audio processing
- PyTorch for neural network implementation
- ONNX Runtime for model deployment