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

◆ shouldTriggerNoteChange() [2/2]

bool fl::audio::detector::Note::shouldTriggerNoteChange ( u8 newNote,
u8 currentNote ) const
private

Definition at line 237 of file note.cpp.hpp.

237 {
238 if (newNote == NO_NOTE || currentNote == NO_NOTE) {
239 return false;
240 }
241
242 // Calculate semitone difference
243 int semitoneDistance = fl::abs(static_cast<int>(newNote) - static_cast<int>(currentNote));
244
245 // Trigger note change if difference exceeds threshold
246 return semitoneDistance >= mNoteChangeThreshold;
247}
static constexpr u8 NO_NOTE
Definition note.h:110
constexpr enable_if< is_fixed_point< T >::value, T >::type abs(T x) FL_NO_EXCEPT

References fl::abs(), fl::FL_NO_EXCEPT, mNoteChangeThreshold, and NO_NOTE.

Referenced by update().

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