1.0.1 • Published 6 years ago

tempo-detector v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Very simple utility function to detect the beats per minutes based on the time between function calls.

A very simple example of a tap for tempo would be:

 <div id="display"></div>
 <button id="button">Tap For Tempo</button>
 const button = document.getElementById('button');
 const display = document.getElementById('display');
 
 const beatDetector = tempoDetector(bpm => {
   // this will continue to be called
   display.innerText = bpm;
 });
 
 button.addEventListener('click', beatDetector);