https://audio.dev/ -- @audiodevcon
An Efficient, Open-Source C++ Loop Classifier and Tempo Estimator - The Algorithm Behind Audacity’s Brand New Tempo Detection Feature - Matthieu Hodgkinson - ADC 2024
An efficient, offline C++ algorithm for loop classification and tempo estimation is presented, alongside its evaluation framework. The framework provides the area under the ROC curve (AUC) of the classifier, facilitating regression-free development and tuning of the algorithm. The AUC is now 0.93 when evaluated against the set of files (publicly available on freesound.org under the Creative Commons license) listed in the framework's source code. By providing computation time measurement, the framework has also been useful for optimizing the algorithm, which is now typically over 2500 times faster than real-time (measurement made on a Windows laptop with a 12th Gen Intel Core i7-12800HX processor and 32 GB of RAM). Furthermore, the framework can be used to set the target false positive rate according to the requirements of your application. Algorithm and evaluation framework are open source, and care has been taken to keep the algorithm easily reusable.
The algorithm can be seen as a "classical" algorithm and reuses ideas described elsewhere in the literature. However, the idea behind the classifier is original. A set of loosely plausible numbers of tatums (or ticks) fitting in the duration of the provided audio file is taken. The likelihood of each tatum count hypothesis is evaluated by measuring the distance of each onset to its closest tatum and using the onset's strength in the weighted average of all distances. The average is then compared to a threshold, and, if below, a disambiguation step is carried out, where the number of tatums is reused to determine the most likely tempo (BPM) and time signature.
As implied above, the input audio must be a loop for its tempo to be detected. This limitation was not deemed critical for the application the algorithm was intended for. On the other hand, it opened possibilities to improve the discriminant factor of the classifier, allowing a higher success rate while keeping the false positive rate low.
Checkout the GitHub Repo: https://github.com/saintmatthieu/loop...
Slides: https://data.audio.dev/talks/2024/an-...
Matthieu Hodgkinson
Passionate about music, I pursued a Bachelor's degree in Musicology at the Université Jean Monnet. I completed the final year of this degree at the National University of Ireland, as an Erasmus student, where I delved into computer music. I continued my studies there, earning an MA in Music Technology, and later completed a PhD in Computer Science, focusing on DSP.