FastLED 3.10.8
Loading...
Searching...
No Matches

◆ shouldReportPitchChange() [2/2]

bool fl::audio::detector::Pitch::shouldReportPitchChange ( float newPitch) const
private

Definition at line 235 of file pitch.cpp.hpp.

235 {
236 // Check if pitch has changed significantly from previous detection
237 if (mPreviousPitch == 0.0f) {
238 // First pitch detection
239 return true;
240 }
241
242 // Calculate absolute difference in Hz
243 float pitchDiff = fl::abs(newPitch - mPreviousPitch);
244
245 // Report change if difference exceeds sensitivity threshold
246 return pitchDiff >= mPitchChangeSensitivity;
247}
constexpr enable_if< is_fixed_point< T >::value, T >::type abs(T x) FL_NO_EXCEPT

References fl::abs(), fl::FL_NO_EXCEPT, mPitchChangeSensitivity, and mPreviousPitch.

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: