tried implementing tempo/beat tracking from scratch but failed miserably, so now I'm using libaubio and can report success, after figuring out how to use it (hopefully) correctly w.r.t. overlapped blocks, which is not at all clear from the documentation.

aubio gives me timestamp of last beat and tempo, from which I can construct a beat phasor, which I can then multiply or subdivide at will. the overall phase offset of the result doesn't align with musical sections (and the detected beat alignment is often off too), so I plan to add a manual button I can hit to say "this is the start of a section, phase should be 0 now".

currently it runs offline, but should be relatively trivial to port to a live callback-based audio input API (for which I'll probably use SDL2 as I'm already using SDL2 in the image viewer).

then the next step will be hooking the phase into the image viewer I made previously to have animations synchronized to audio.

#aubio #libaubio