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

◆ detectOnset()

bool fl::audio::detector::TempoAnalyzer::detectOnset ( u32 timestamp)
private

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

155 {
156 // Simple onset detection: flux exceeds adaptive threshold
158 return false;
159 }
160
161 // Avoid detecting onsets too close together
162 if (!mOnsetTimes.empty()) {
163 u32 timeSinceLastOnset = timestamp - mOnsetTimes.back();
164 if (timeSinceLastOnset < 50) { // 50ms minimum gap
165 return false;
166 }
167 }
168
169 return true;
170}

References mAdaptiveThreshold, mOnsetTimes, and mPreviousFlux.

Referenced by update().

+ Here is the caller graph for this function: