This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

This sketch demonstrates how to use the BeatDetect object in FREQ_ENERGY mode.
You can use isKick, isSnare, isHat, isRange, and isOnset(int) to track whatever kind of beats you are looking to track, they will report true or false based on the state of the analysis. To "tick" the analysis you must call detect with successive buffers of audio. You can do this inside of draw, but you are likely to miss some audio buffers if you do this. The sketch implements an AudioListener called BeatListener so that it can call detect on every buffer of audio processed by the system without repeating a buffer or missing one.

This sketch plays an entire song so it may be a little slow to load.

Source code: FrequencyEnergy BeatListener

Built with Processing