Fold one tap (timestamp atMs) into state. Returns the new accumulator and the derived BPM, or
undefined while fewer than two taps are accumulated. A tap arriving after a gap > TAP_RESET_MS
resets the accumulator to just this tap. An interval that is an outlier versus the running mean of
the other intervals (a mis-tap / accidental double) is discarded before averaging.
Fold one tap (timestamp
atMs) intostate. Returns the new accumulator and the derived BPM, orundefinedwhile fewer than two taps are accumulated. A tap arriving after a gap > TAP_RESET_MS resets the accumulator to just this tap. An interval that is an outlier versus the running mean of the other intervals (a mis-tap / accidental double) is discarded before averaging.