diff --git a/src/timemanager.cxx b/src/timemanager.cxx index 8dcd3bf..8a9606f 100644 --- a/src/timemanager.cxx +++ b/src/timemanager.cxx @@ -105,14 +105,14 @@ void TimeManager::registerObserver(TimeObserver* o) void TimeManager::tap() { // reset tap tempo to "first tap" if more than 5 secs elapsed since last tap - if ( tapTempo[0] < frame - samplerate * 5 ) + if ( tapTempo[0] < totalFrameCounter - samplerate * 5 ) { tapTempoPos = 0; } if ( tapTempoPos < 3 ) { - tapTempo[tapTempoPos] = frame; + tapTempo[tapTempoPos] = totalFrameCounter; tapTempoPos++; } else @@ -120,7 +120,7 @@ void TimeManager::tap() // calculate frames per tap int tapFpb1 = tapTempo[1] - tapTempo[0]; int tapFpb2 = tapTempo[2] - tapTempo[1]; - int tapFpb3 = frame - tapTempo[2]; // last tap, until now + int tapFpb3 = totalFrameCounter - tapTempo[2]; // last tap, until now int average = (tapFpb1 + tapFpb2 + tapFpb3) / 3;