FastLED 3.9.15
Loading...
Searching...
No Matches

◆ TempoAnalyzer()

fl::audio::detector::TempoAnalyzer::TempoAnalyzer ( )

Definition at line 11 of file tempo_analyzer.cpp.hpp.

12 : mCurrentBPM(120.0f)
13 , mConfidence(0.0f)
14 , mIsStable(false)
15 , mStability(0.0f)
16 , mMinBPM(60.0f)
17 , mMaxBPM(180.0f)
19 , mPreviousFlux(0.0f)
20 , mAdaptiveThreshold(0.0f)
22{
23 mPreviousMagnitudes.resize(8, 0.0f); // Track first 8 bins for spectral flux
25
26 // BPM confidence fades over ~2s of silence — musical tempo has natural
27 // persistence; snapping faster feels wrong. Raw BPM is NOT gated so that
28 // when audio returns, beat sync resumes from the same tempo estimate.
29 SilenceEnvelope::Config cfg;
30 cfg.decayTauSeconds = 2.0f;
31 cfg.targetValue = 0.0f;
32 mConfidenceEnvelope.configure(cfg);
33}
vector< TempoHypothesis > mHypotheses
static constexpr size MAX_HYPOTHESES

References fl::audio::SilenceEnvelope::Config::decayTauSeconds, mAdaptiveThreshold, MAX_HYPOTHESES, mConfidence, mConfidenceEnvelope, mCurrentBPM, mHypotheses, mIsStable, mMaxBPM, mMinBPM, mPreviousFlux, mPreviousMagnitudes, mStability, mStabilityThreshold, mStableFrameCount, and fl::audio::SilenceEnvelope::Config::targetValue.

Referenced by update().

+ Here is the caller graph for this function: