0
I figured it out by stepping through both of our code.
The problem was that I was setting the number of taps to 1
as soon as the user tapped the key the first time, when in reality itβs not taps that I want to count, but beats, and the first beat requires not one tap, but two: the start and the end of that beat. So what I should do is rename the variable to numberOfTappedOutBeats
and set it to 0
after the first tap rather than 1
.
Source:stackexchange.com