Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Averaging of tapping speed #9

Open
l3u opened this issue Dec 11, 2022 · 6 comments
Open

Averaging of tapping speed #9

l3u opened this issue Dec 11, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@l3u
Copy link

l3u commented Dec 11, 2022

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

@Kr0oked Kr0oked added the enhancement New feature or request label Dec 27, 2022
@Kr0oked
Copy link
Owner

Kr0oked commented Dec 27, 2022

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

@MasonMcV
Copy link

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.

@CubeOfCheese
Copy link

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

@z33ky
Copy link

z33ky commented Mar 10, 2024

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.

@MasonMcV
Copy link

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.

@Kr0oked
Copy link
Owner

Kr0oked commented Mar 31, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants