this is my first crack at a beat detection algorithm in flash. it works by calculating average sample energy per frame over a certain band and compares the value against the last few values stored in a buffer. if the value is larger then whats in the memory, a beat occurs. currently it supports multiple bands, so you can listen for a kick or a snare at the same time. the theory is based on this article that i found while looking at some processing examples.
ive knocked up a little example, left and right arrow keys moves the band across the spectrum, < and > keys stretch and shrink the band, up and down arrow keys increase and decrease the beat threshold. you will see two line markers jumping around, the white represents the average energy for the current frame within that band and the yellow represents the average energy in the buffer.
check out the swf here. download the source here.


