Kr0oked / Metronome

Simple and beautiful metronome for Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Averaging of tapping speed

l3u opened this issue · comments

Hi,

first of all thanks for your app! Going through all metronome apps on F-Droid, I like yours the most for its simplicity! I have one small feature request though:

When tapping in a tempo, the slider jumps up and down in relatively big range. This is surely due to me not tapping accurately enough, or due to touchscreen sensitivity issues or whatever. However, it's always the time between the last two taps that is used to adjust the metronome's timing. And this can deviate quite a lot from what I thought I tapped in.

So: What about adding some averaging when tapping (maybe as an option to turn on and off)? Like when you start tapping, the app calculates the average of all taps, getting more stable the longer you tap? And if the time between two taps is too lonmg (maybe twice the average or such), the value is reset and a new measurement begins?

This would be really great!

Cheers, Tobias

Hi, thanks for sharing your idea. I already experimented a little bit with averaging the tappings but it felt rather strange and so I sticked with the current approach. I couldn't decide on the amount of last taps or time period on which to calculate the average. It felt either strange for slow or fast beats.
I think the current approach allows the user to get an idea of what tempo he is tapping an he can fine tune it afterwards.
Maybe I will revisit the averaging idea later on.
Regards

I agree with @l3u on the desire for a moving average of the tapping. It feels unnatural to have the value jump around so much while tapping. I'm not super accurate at tapping a consistent tempo, so I see the value fluctuate by around 10-15 bpm when tapping manually.

A suggestion of a way to implement this could be to keep a moving average for the duration of the tapping, but reset the average if the tempo changes by more than 20% or the button is not tapped for click period x3.

The average could also weight previous taps by recency. So the older the tap is, the smaller of a factor it is in the average. Up to some cutoff point where it's old enough that it should be disregarded

I implemented this feature in a fork since it feels good to me. It's quite simply the average over all collected tempo values. The number of values to consider (i.e. the length of the queue that is maintained for this) is user-configurable; It can be set to 2 to replicate the current behavior.
Whenever two taps are so far apart they fall below the minimum BPM, the queue is cleared and the current tempo value is kept until a new one can be calculated with the next tap (src).
Code could be added to suppress changing the current BPM until enough taps are in, but currently it will update as soon as one value is available in the queue, i.e. an average can be calculated at all.

I'd be happy to open a PR, or feel free to just take the code if you consider this approach acceptable.

I have tested this on my device and it works well for me. The average of the 2-8 taps worked perfect. When switching the tempo I was tapping at, I could see the tempo gradually change. I was able to keep the tempo consistent within 2 or 3 bpm, which feels about right.

The only suggestion I would have is: changing the tempo taps slider to match the style of the home screen.

Sorry guys, I din't have time to check out this issue in the last few weeks.
@z33ky I had a look at your fork and the averaging worked good over eight taps. I would like to work on an own implementation.
I will try to implement something that does not need any settings that have to be tweaked. I also stumbled upon this tool here https://www.justinguitar.com/tap-tempo-bpm-tool . What I like about this approach is that the user sees that he has to tap multiple times and that he gets an average.