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

◆ frequencyToScale255()

fl::u8 fl::audio::Reactive::frequencyToScale255 ( fl::u8 binIndex) const

Definition at line 586 of file audio_reactive.cpp.hpp.

586 {
587 if (binIndex >= 16) return 0;
588 // Bin values have no fixed upper bound (depend on FFT output, scaling
589 // mode, gain, and equalization). Best-effort clamp to 0-255.
590 float value = mCurrentData.frequencyBins[binIndex];
591 if (value < 0.0f) value = 0.0f;
592 if (value > 255.0f) value = 255.0f;
593 return static_cast<fl::u8>(value);
594}
unsigned char u8
Definition s16x16x4.h:132
constexpr int type_rank< T >::value

References mCurrentData, and fl::type_rank< T >::value.