[sdiy] Tap tempo question

Brian Willoughby brianw at audiobanshee.com
Wed Feb 3 02:59:40 CET 2021

On Feb 2, 2021, at 02:59, Tom Wiltshire wrote:
> Averaging makes some sense where you’ve got a human tapping, and Brian is right that weighted averages are a good idea to give more recent times more importance. Rather than doing hard sums, on a PIC it makes sense to do this weighting by using bit shifts (so choose from weights of 1, 0.5, 0.25, or 0.125!!).

A low-pass filter with a coefficient of 0.5 would automatically create that weighted series (1, 0.5, 0.25, 0.125). It wouldn't even be necessary to store the last four values because the filter state would already have them summed.

It would probably be helpful to compare the latest period against the slowest tempo, and if it's even longer than that then just zero-out the filter state to reset. Of course, don't use the filter output if it's zero. Instead, just leave the tempo at the latest setting.

Brian Willoughby

More information about the Synth-diy mailing list