this is a python script that extracts chords from audio files. it's basically a wrapper around chord-extractor (which is itself using Chordino and NNLS Chroma ).
This can extract chords from local audio files (or downloaded them from youtube videos using yt-dlp if a youtube link is provided). The extracted chords are then displayed using tombatossals/react-chords + tombatossals/chords-db.
it works for me. i really HOPE it works for you too :]
python chord.py "https://music.youtube.com/watch?v=pRVM5oy_9Fg"- python 3.8.20 (for chord-extractor)
- chord-extractor and its requirements
- https://code.soundsoftware.ac.uk/projects/vamp-plugin-pack/files to install
Chordino and NNLS Chromaplugins - for youtube downloads:
- yt-dlp
- python 3.9 or newer (for yt-dlp support)
First make sure you have pyenv installed. see: https://github.com/pyenv/pyenv#installation
Then install both Python versions:
# Install latest python
pyenv install 3.13
# Install python 3.8 for chord-extractor
pyenv install 3.8.10
pyenv local 3.8.10 # Set it as default for this project
# Install chord-extractor dependencies in Python 3.8 environment
pip install -r requirements.txt
# Install yt-dlp in Python 3.9+ (adjust version if needed)
python3.13 -m pip install yt-dlp
# Install main dependencies in Python 3.8 environment
pip install -r requirements.txt
# optional: install and build the react app
npm install
npm run buildInside the project directory run either:
# for a local file
python chord.py path/to/your/file.mp3
# for yt video/audio
python chord.py https://www.youtube.com/watch?v=your_video_idThis project includes code from David Rubert under the MIT License:
guitar.jsonandukulele.jsonfrom https://github.com/tombatossals/chords-db (Copyright Original Author David Rubert).
