Skip to content
Beats per minute (BPM) automatic detection with Web Audio API
JavaScript HTML
Find file
Latest commit aae064f @srchea JSHint passed
Failed to load latest commit information.
bin JSHint passed
doc JSHint passed
src JSHint passed
test Add empty line eof
.gitignore Ignore assets
Gruntfile.js Fix all tests
LICENSE Initial commit
README.md Add testing instructions in README
bower.json Change version
package.json Remove qunit from package.json

README.md

Pulse.js

This library aims to get the BPM (beat per minute) automatically with Web Audio API.

Installation

To install Pulse.js with bower: bower install pulsejs

Usage

Here is a basic usage of Pulse:

var uri = "song.mp3";
var pulse = new Pulse({

    // when Pulse has finished to compute main data: beat, significant peaks...
    onComplete: function(event, pulse) {
        var extrapolatedPeaks = pulse.getExtrapolatedPeaks(
            pulse.renderedBuffer,
            pulse.significantPeaks,
            pulse.beat
        );

        // beat (ms and bpm properties)
        console.log(pulse.beat);

        // extrapolated peaks
        console.log(extrapolatedPeaks);
    }
});

pulse.loadBufferFromURI(uri);

Examples

This is a screenshot of a game based on rhythms like "Dance Dance Revolution". It show one of the several possibilities of Pulse.


Mark Ronson - Uptown Funk feat. Bruno Mars


Avicii - The Nights


Avicii - The Nights

Documentation

The full documentation can be found on this repository.

Contributions

  • Install all grunt tasks: npm install.
  • Then run: grunt watch.
  • Write your tests and make your changes.
  • Enjoy :-) and please do not forget comments.

Of course, all contributions are welcome.

References

Something went wrong with that request. Please try again.