This project is an implementation of spectral flux-based onset detection in the JavaScript Web Audio API. It is built with the intent of powering procedural content generation in music-focused games and interactive web experiences. The project loosely implements logic and procedures described in the Onset Detection tutorial series by Badlogic Games.
At this time, the project is only a graphical visualizer. The red plot corresponds to the music waveform; green to the spectral flux; purple to the threshold of locally averaged flux values; and blue to the peaks of regions where the spectral flux exceeds the threshold. The external orange graph displays an attempt at displaying the frequency of the detected onsets, however this approach appears to be mathematically flawed.
The project still needs to determine the numerical onset rate in order to determine a BPM of a song. It also could be improved by looking at differing frequency ranges for improved recognition based on classes of instruments and genres. Please feel free to submit pull requests!