Process one audio frame.
- Parameters
-
| onsetDetected | True if onset detector triggered |
| onsetStrength | Onset magnitude (spectral flux value) |
Definition at line 25 of file musical_beat_detector.cpp.hpp.
25 {
29
30 if (!onsetDetected) {
31 return;
32 }
33
35
36
40
41
44
45
46 float ibiSeconds =
static_cast<float>(ibiFrames *
mConfig.samplesPerFrame) /
47 static_cast<float>(
mConfig.sampleRate);
48
49
51
53
55 }
57
58
60
61
63
64
68 } else {
69
72 }
73 } else {
75 }
76}
deque< u32 > mIBIHistory
Inter-beat interval history (in frames)
bool isValidIBI(float ibi) const
Check if IBI is within valid BPM range.
float calculateBeatConfidence(float currentIBI)
Calculate beat confidence based on rhythmic consistency.
bool mBeatDetected
Last beat was detected.
float mCurrentBPM
Current BPM estimate (smoothed)
float mLastBeatConfidence
Last beat confidence score.
u32 mCurrentFrame
Current frame counter.
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.
void updateBPMEstimate()
Update BPM estimate from inter-beat intervals.
MusicalBeatDetectorConfig mConfig
References calculateBeatConfidence(), getAverageIBI(), isValidIBI(), mBeatDetected, mConfig, mCurrentBPM, mCurrentFrame, mIBIHistory, mLastBeatConfidence, mLastBeatFrame, mStats, updateBPMEstimate(), and validateBeat().
Referenced by ~MusicalBeat().