Skip to content

adielbm/chord-extractor

Repository files navigation

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 :]

Example

python chord.py "https://music.youtube.com/watch?v=pRVM5oy_9Fg"

screenshot

Requirements

Setup

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 build

Usage

Inside 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_id

Acknowledgements

This project includes code from David Rubert under the MIT License:

About

extract chords from an audio file (using ohollo/chord-extractor & Chordino)

Topics

Resources

License

Stars

Watchers

Forks

Contributors