Skip to content

🎼 Beats per minute (BPM) automatic detection with Web Audio API

License

Notifications You must be signed in to change notification settings

sannremy/pulse.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🎼 Beats per minute (BPM) automatic detection with Web Audio API

Resources

License

Stars

Watchers

Forks

Packages

No packages published