deque< u32 > mIBIHistory
Inter-beat interval history (in frames)
const Stats & getStats() const
float mAverageIBI
Average inter-beat interval (in frames)
MusicalBeat() FL_NOEXCEPT
void processSample(bool onsetDetected, float onsetStrength)
Process one audio frame.
bool isValidIBI(float ibi) const
Check if IBI is within valid BPM range.
float calculateBeatConfidence(float currentIBI)
Calculate beat confidence based on rhythmic consistency.
float getBeatConfidence() const
Get beat confidence for the last detected beat.
bool mBeatDetected
Last beat was detected.
float mCurrentBPM
Current BPM estimate (smoothed)
bool isBeat() const
Check if a musical beat was detected in the last frame.
float mLastBeatConfidence
Last beat confidence score.
void reset()
Reset internal state (clear history, reset BPM)
u32 mCurrentFrame
Current frame counter.
void configure(const MusicalBeatDetectorConfig &config)
Configure the beat detector.
float getAverageIBI() const
Get inter-beat interval (IBI) statistics.
u32 mLastBeatFrame
Last beat timestamp (in frames)
bool validateBeat(float onsetStrength)
Validate if an onset is a true musical beat.
float getBPM() const
Get current BPM estimate.
void updateBPMEstimate()
Update BPM estimate from inter-beat intervals.
float calculateIBIStdDev() const
Calculate standard deviation of IBI history.
MusicalBeatDetectorConfig mConfig
Get statistics (for debugging/monitoring)
u32 samplesPerFrame
Samples per frame - used for timing calculations.
u32 sampleRate
Sample rate (Hz) - used for timing calculations.
float maxBPM
Maximum BPM to detect (default: 250 BPM)
float minBeatConfidence
Minimum beat confidence to report a beat (0.0-1.0) Higher values = fewer false positives,...
u32 maxIBIHistory
Maximum number of inter-beat intervals to track Higher values = better BPM estimation,...
float minBPM
Minimum BPM to detect (default: 50 BPM)
float bpmSmoothingAlpha
BPM estimation smoothing factor (0.0-1.0) Higher values = slower BPM adaptation, more stable tempo.
Configuration for musical beat detection.
Base definition for an LED controller.