Skip to content

Commit

Permalink
web: Make BPM detector reset a bit more forgiving
Browse files Browse the repository at this point in the history
  • Loading branch information
liamappelbe committed Nov 17, 2023
1 parent 7ce951b commit 2fe5f95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metronome.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
this.bpm = -1;
} else {
const newBpm = 60.0 / (t - this.lastTap);
if (this.bpm == -1 || geometricDelta(this.bpm, newBpm) > 0.1) {
if (this.bpm == -1 || geometricDelta(this.bpm, newBpm) > 0.2) {
// This is the first BPM calculation or the BPM has changed drastically,
// so just set the BPM to the new value, rather than smoothly updating.
this.bpm = newBpm;
Expand Down

0 comments on commit 2fe5f95

Please sign in to comment.