Thanks! re: corner frequency, ha, yeah I maybe oversimplified the example code a bit. That code will, however, work, because the Web Audio API specifies a default frequency of 350Hz ( http://webaudio.github.io/web-audio-api/#attributes-17 ). You can also dig into the source code of the page for the code that makes the audio examples happen (search for "click", which will give you the click handlers).
I think we'll circle around and try again in a less naive way :)
Thanks! I think the answer is that it would fall down pretty hard if the tempo started varying, the reason being that the algorithm seeks out interval modes instead of averages, with only a little wiggle room.
In the testing section, the songs that we fail to identify correctly are usually those we couldn't get a "handle" on in the form of identifying common intervals. A varying tempo would exacerbate that problem.
Additionally, the question becomes: what is the tempo of a song that has an inconsistent tempo?
Thanks for this write up, I really enjoyed it.
+1 to the suggestion to adjust the threshold based on the average volume in a section, maybe using a sliding window.
A really nice article, but not really an advanced algorithm. What would be really interesting is an explanation of something like Ableton warp engine, which can automatically detect and warp to the grid tracks with fluid tempo.
Wow, in my half-awake state I initially read that as 'BEAR detection using JavaScript and the Web Audio API". Unfortunately the article did not live up to the promise.
Also, peak detection can be improved a lot by searching for local maxima of the level instead of taking a threshold of the amplitude.
As a scientist of acoustics, I find this approach frustratingly naive. Still, nice write-up!