224 {
227
228 int centerX =
WIDTH / 2;
230
231 for (size_t angle = 0; angle < 360; angle += 6) {
233 if (band >=
fft->bins_db.size())
continue;
234
235 float magnitude =
fft->bins_db[band] / 100.0f;
238 magnitude =
fl::clamp(magnitude, 0.0f, 1.0f);
239
241
242 for (int r = 0; r < radius; r++) {
243 int x = centerX + (r * cosf(angle *
PI / 180.0f));
244 int y = centerY + (r * sinf(angle *
PI / 180.0f));
245
247 uint8_t colorIndex = fl::map_range<int, uint8_t>(r, 0, radius, 255, 0);
249 if (ledIndex >= 0 && ledIndex <
NUM_LEDS) {
251 }
252 }
253 }
254 }
255}
UINumberField palette("Palette", 0, 0, 2)
static const int NUM_BANDS
UISlider noiseFloor("Noise Floor", 0.1f, 0.0f, 1.0f, 0.01f)
UISlider audioGain("Audio Gain", 1.0f, 0.1f, 5.0f, 0.1f)
CRGBPalette16 getCurrentPalette()
CRGB ColorFromPalette(const CRGBPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)
FASTLED_FORCE_INLINE T clamp(T value, T min, T max)