pyace: A python implementation of automatic chord estimation (ACE) from audio
This is a super lite version that derives from my PhD thesis. The original code of this work is written in matlab. So I try to port some of those code into python, but this is by no means a direct porting. This project is meant to be a minimalist version of ACE, which keeps only the algorithmic gist of the original work.
Compared with the original version which supports sevenths chords and inversions, this piece of code currently only supports maj and min triads, and it has much lighter (only a few lines of) feature extraction and segmentation codes.
It depends on librosa for feature extraction and hmmlearn for chord segmentation (as well as labeling if in the simple model)
Also install keras (and theano or tensorflow also) to use the FCNN or RNN models, otherwise you could only run it in "simple" model.
pip install pyace
First of all import the module by calling:
import pyace
It basically provides two simple interfaces:
pyace.simpleace(songpath, respath)
and
pyace.deepace(songpath, respath, modelpath, acemode)
You could just take the source code and run it as:
python pyace.py [songpath] [acemode] [modelpath]
The acemode can be either 'simple', 'fcnn' or 'rnn'.
For example, try the following lines:
python pyace.py aizheni.mp3 simple
python pyace.py aizheni.mp3 rnn ./model/lstmrnn512/CJKURB.cg.model
The pretrained models as well as the testcases can be downloaded here
This is a very lite version of ACE. You are strongly encouraged to take this piece of code away and do whatever you want to.
Please refer to the evaluation script provided (pyace/aceeval.py and eval.sh) for the evaluation process. The process relies on the MusOOEvaluator
This software is under BSD License. For commercial use of this software, please contact the author.