Skip to content

An efficient C++ loop classifier and tempo estimator

License

Notifications You must be signed in to change notification settings

Alzy/loop-tempo-estimator

 
 

Repository files navigation

Loop Tempo Estimation library

Upcoming talk at the 2024 Audio Developer Conference

Building

This project uses CMake as its build system. To build the project, you must first update the submodules:

git submodule update --init --recursive

Then, you can build the project using CMake:

mkdir build
cd build
cmake ..
cmake --build .

Usage

The main contribution of this repo is just a library, not an executable. It is in the loop-tempo-estimator directory and the entry-point header file is MusicInformationRetrieval.h.

However, the project includes a benchmarking framework as well as visualization tools. If you want to make sure that the code works, you may want to look at TatumQuantizationFitBenchmarking.cpp and TatumQuantizationFitVisualization.cpp.

Visualization

Some visualization of some aspects of the algorithm was implemented: TatumQuantizationFitVisualization.cpp takes a wav file as input, runs the algorithm with debug output, and writes this output to python files, which can afterwards be run to show plots.

  1. Set static constexpr auto runLocally = true; in MirTestUtils.h (should be committed as false to avoid CI running visualization and benchmarking)
  2. In TatumQuantizationFitVisualization.cpp, Set the value of const auto wavFile = to the path of the wav file you want to analyze.
  3. Build and run the lib-loop-tempo-estimator-test target. (The benchmarking will run and fail if you haven't set it up, but you can ignore it.)
  4. In tests/TatumQuantizationFitVisualization/, you will find visualize_debug_output.py and visualize_post-processed_STFT.py. You can execute them using Python.

E.g. image shows the onset detection function (blue), the onsets (red) and the tatums (green) as estimated by the algorithm on a 16-bar drum loop.

About

An efficient C++ loop classifier and tempo estimator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 78.1%
  • HTML 18.3%
  • CMake 2.2%
  • Python 1.3%
  • C 0.1%