tempo-detector
v1.0.1
Published
A package that helps you figure out the tempo based on the interval between function calls
Downloads
1
Readme
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);