143 {
146 }
147
148
149
150 static uint32_t frame = 0;
151
152
154
156
158 if (!do_frame) {
159 continue;
160 }
163
165
167
168 int32_t max = 0;
169 for (int i = 0; i < sample.pcm().size(); ++i) {
170 int32_t
x =
ABS(sample.pcm()[i]);
173 }
174 }
175 float anim =
178
180
181
182
184
185
186
187
189 auto max_x =
fftOut.bins_raw.size() - 1;
190 for (
int i = 0; i <
fftOut.bins_raw.size(); ++i) {
192 auto v =
fftOut.bins_db[i];
193
196 uint8_t heatIndex =
198
199
200
201
203 c.fadeToBlackBy(255 - heatIndex);
205
206 }
207 }
208
211 }
212
214 float rms = sample.rms();
219 }
220 if (true) {
221 uint16_t fade_width = fade * (
WIDTH - 1);
223
225 auto c =
CRGB(255, 255, 0);
227 }
228 }
229
230
232
234}
UICheckbox enableRMS("Enable RMS visualization", false)
SoundLevelMeter soundLevelMeter(.0, 0.0)
float rms(Slice< const int16_t > data)
UICheckbox enableFFT("Enable FFT visualization", true)
XYMap ledsXY(WIDTH/2, HEIGHT/2, IS_SERPINTINE)
CRGB framebuffer[NUM_LEDS]
UICheckbox enableVolumeVis("Enable volume visualization", false)
XYMap frameBufferXY(WIDTH, HEIGHT, IS_SERPINTINE)
MaxFadeTracker audioFadeTracker(attackTimeSeconds.value(), decayTimeSeconds.value(), outputTimeSec.value(), 44100)
CFastLED FastLED
Global LED strip management instance.
const TProgmemRGBPalette16 HeatColors_p
Approximate "black body radiation" palette, akin to the FastLED HeatColor() function.
void downscale(const CRGB *src, const XYMap &srcXY, CRGB *dst, const XYMap &dstXY)
FASTLED_FORCE_INLINE T clamp(T value, T min, T max)
CRGB ColorFromPalette(const CRGBPalette16 &pal, uint8_t index, uint8_t brightness, TBlendType blendType)
FASTLED_FORCE_INLINE U map_range(T value, T in_min, T in_max, U out_min, U out_max)
Representation of an RGB pixel (Red, Green, Blue)