- Before proceding with the problem statement, it will be mindfull to go through this article which includes a thread of discussion over the same problem that we are trying to solve and the Krumhansl-Schmuckler Key-Finding Algorithm.
- Lastly, there is also an app mixxxdj which uses a key finder and I managed to find the repository which contains the code for the same and can be found here.
I found and testing two methods to detect the global key or pitch of an audio file:-
1. mmKey.py:
- Uses a Convolutional Neural Network to detect the global key of the audio file as described in the research paper Filip Korzeniowski and Gerhard Widmer, "Genre-Agnostic Key Classification with Convolutional Neural Networks", In Proceedings of the 19th International Society for Music Information Retrieval Conference (ISMIR), Paris, France, 2018..
- This implementation uses a python package called madmom. madmom requires numpy, scipy. cython. mido (for MIDI handling), pytest (to run the tests), pyaudio (to process live audio input), pyfftw (for better FFT performance)
2. pyacaKey.py:
- Computes the musical key of an input audio file using the idea behind Krumhansl-Schmuckler Key-Finding Algorithm.
- Uses the pyaca python package, which is actually the python scripts accompanying the book An Introduction to Audio Content Analysis.
- This implementation does not output as precise results as mmKey.py script. Thus, needs more paratmeter optimisation and fine tuning.
We are using Python3