The tools to solve Audio Chord Recognition (Chord Estimation) problem.
Some of pre-trained model metrics of major and minor chords made by mir_eval on Isophonics and Robbie Williams datasets.
_ | majmin | mirex |
---|---|---|
beatles | 0.792 | 0.771 |
queen | 0.815 | 0.798 |
zweieck | 0.839 | 0.811 |
robbie_williams | 0.908 | 0.885 |
chord-recognition
takes an audio file in mp3
format, and then represents it as waweform in numpy.array
. It computes STFT to split the input into frames representing 1.5 seconds of the audio. It applies a simple ConvNet to each frame to classify into 25 classes (12 minor, 12 major plus a non-chord class). Finally the result is enhanced by HMM smoothing.
pip install git+https://github.com/discort/chord-recognition
from chord_recognition import estimate_chords
result = estimate_chords(audio_path='tests/fixtures/C_Am.mp3', nonchord=True)
print(result)
[(0.0, 1.6718, 'N'),
(1.6718, 3.7152, 'C'),
(3.7152, 4.2725, 'N'),
(4.2725, 6.0372, 'Am')]
Use this link to download Beatles, Queen and Robbie Williams datasets in isophonics format
unzip data.zip data
pip install -r requirements.txt
py.test -q --cov=chord_recognition tests
python -m chord_recognition.evaluate -ds <dataset_name>
audio_analysis.ipynb <- Check spectrogram, chromagram, etc
chords_analysis.ipynb <- Check chord distribution and other stats data
experiments.ipynb <- Describing some experiments to improve classification/
experiment<N>.ipynb <- A code to reproduce an experiment
jupyter notebook
References:
- Müller M. (2015) Chord Recognition. In: Fundamentals of Music Processing
- Korzeniowski, Widmer (2016) A Fully Convolutional Deep Auditory Model for Musical Chord Recognition
- Zanoni (2014) Chord and Harmony annotations of the first five albums by Robbie Williams