MCPcopy Create free account
hub / github.com/FastLED/FastLED / reset

Method reset

src/fl/audio/detector/tempo_analyzer.cpp.hpp:114–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void TempoAnalyzer::reset() {
115 mCurrentBPM = 120.0f;
116 mConfidence = 0.0f;
117 mIsStable = false;
118 mStability = 0.0f;
119 mPreviousFlux = 0.0f;
120 mAdaptiveThreshold = 0.0f;
121 mStableFrameCount = 0;
122 fl::fill(mPreviousMagnitudes.begin(), mPreviousMagnitudes.end(), 0.0f);
123 mHypotheses.clear();
124 mOnsetTimes.clear();
125 mFluxAvg.reset();
126 mBPMMedian.reset();
127 mBPMHistory.clear();
128 mConfidenceEnvelope.reset(0.0f);
129 mPrevTimestamp = 0;
130 mHasPrevTimestamp = false;
131}
132
133float TempoAnalyzer::calculateSpectralFlux(const fft::Bins& fft) {
134 // Focus on low-to-mid frequencies for beat detection

Callers

nothing calls this directly

Calls 4

fillFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected