Comment 2 for bug 1313063

Revision history for this message
Marco Angerer (hektikr) wrote :

GOT IT:

replace ll. 146 ff. in beatgrid.cpp with

double beatFraction = (dSamples - firstBeatSample()) / m_dBeatLength;
    double prevBeat = floorf(beatFraction);
    double nextBeat = ceilf(beatFraction);

    // If the position is within 1/100th of the next or previous beat, treat it
    // as if it is that beat.
    const double kEpsilon = .01;

    if (fabs(nextBeat - beatFraction) < kEpsilon) {
     beatFraction = nextBeat;
     //but now we have to update prevBeat
     prevBeat = nextBeat;
    } else if (fabs(prevBeat - beatFraction) < kEpsilon) {
     beatFraction = prevBeat;
     //in this case nextBeat has to be updated
     nextBeat = prevBeat;
    }