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

◆ updateCurrentTempo()

void fl::audio::detector::TempoAnalyzer::updateCurrentTempo ( )
private

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

248 {
249 if (mHypotheses.empty()) {
250 mConfidence = 0.0f;
251 return;
252 }
253
254 // Use the best hypothesis, filtered through median for outlier rejection
255 const TempoHypothesis& best = mHypotheses[0];
256 mCurrentBPM = mBPMMedian.update(best.bpm);
258
259 // Add to BPM history for stability analysis
260 mBPMHistory.push_back(mCurrentBPM);
261 if (mBPMHistory.size() > BPM_HISTORY_SIZE) {
262 mBPMHistory.pop_front();
263 }
264}
vector< TempoHypothesis > mHypotheses
static constexpr size BPM_HISTORY_SIZE
float calculateTempoConfidence(const TempoHypothesis &hyp)
MedianFilter< float, 21 > mBPMMedian

References fl::audio::detector::TempoAnalyzer::TempoHypothesis::bpm, BPM_HISTORY_SIZE, calculateTempoConfidence(), mBPMHistory, mBPMMedian, mConfidence, mCurrentBPM, and mHypotheses.

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: