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

Method updateCurrentTempo

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

Source from the content-addressed store, hash-verified

246}
247
248void TempoAnalyzer::updateCurrentTempo() {
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);
257 mConfidence = calculateTempoConfidence(best);
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}
265
266void TempoAnalyzer::updateStability() {
267 if (mBPMHistory.size() < 5) {

Callers

nothing calls this directly

Calls 5

emptyMethod · 0.45
updateMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
pop_frontMethod · 0.45

Tested by

no test coverage detected