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

◆ reset()

void fl::audio::detector::MusicalBeat::reset ( )

Reset internal state (clear history, reset BPM)

Definition at line 105 of file musical_beat_detector.cpp.hpp.

105 {
106 mBeatDetected = false;
107 mLastBeatConfidence = 0.0f;
108 mCurrentBPM = 120.0f; // Default to common tempo
109 mLastBeatFrame = 0;
110 mCurrentFrame = 0;
111 mIBIHistory.clear();
112 mAverageIBI = 0.0f;
113
114 mStats.totalOnsets = 0;
115 mStats.validatedBeats = 0;
116 mStats.rejectedOnsets = 0;
117 mStats.currentBPM = mCurrentBPM;
118 mStats.averageIBI = 0.0f;
119 mStats.ibiCount = 0;
120}
deque< u32 > mIBIHistory
Inter-beat interval history (in frames)
float mAverageIBI
Average inter-beat interval (in frames)
bool mBeatDetected
Last beat was detected.
float mCurrentBPM
Current BPM estimate (smoothed)
float mLastBeatConfidence
Last beat confidence score.
u32 mCurrentFrame
Current frame counter.
u32 mLastBeatFrame
Last beat timestamp (in frames)

References mAverageIBI, mBeatDetected, mCurrentBPM, mCurrentFrame, mIBIHistory, mLastBeatConfidence, mLastBeatFrame, and mStats.

Referenced by ~MusicalBeat(), and configure().

+ Here is the caller graph for this function: