34#define NUM_LEDS ((WIDTH) * (HEIGHT))
35#define IS_SERPINTINE false
36#define TIME_ANIMATION 1000
79 const int N = data.
size();
80 for (
int i = 0; i < N; ++i) {
81 int32_t x32 = int32_t(data[i]);
84 float rms = sqrt(
float(sumSq) / N);
94 auto screenmap =
ledsXY.toScreenMap();
95 screenmap.setDiameter(.2);
110 .setScreenMap(screenmap);
117 for (
int i = 0; i <
NUM_LEDS; ++i) {
126 memcpy(row1, row2,
WIDTH *
sizeof(
CRGB));
150 static uint32_t frame = 0;
169 for (
int i = 0; i < sample.pcm().size(); ++i) {
170 int32_t
x =
ABS(sample.pcm()[i]);
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];
203 c.fadeToBlackBy(255 - heatIndex);
214 float rms = sample.rms();
221 uint16_t fade_width = fade * (
WIDTH - 1);
225 auto c =
CRGB(255, 255, 0);
UISlider decayTimeSeconds("Fade time Seconds",.1, 0, 4,.02)
UITitle title("Simple control of an xy path")
UISlider attackTimeSeconds("Attack time Seconds",.1, 0, 4,.02)
UICheckbox enableRMS("Enable RMS visualization", false)
UICheckbox freeze("Freeze frame", 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)
UIButton advanceFrame("Advance frame")
XYMap frameBufferXY(WIDTH, HEIGHT, IS_SERPINTINE)
MaxFadeTracker audioFadeTracker(attackTimeSeconds.value(), decayTimeSeconds.value(), outputTimeSec.value(), 44100)
UISlider fadeToBlack("Fade to black by", 5, 0, 20, 1)
UIDescription description("This is more of a test for new features.")
UISlider outputTimeSec("outputTimeSec",.17, 0, 2,.01)
CFastLED FastLED
Global LED strip management instance.
central include file for FastLED, defines the CFastLED class/object
Tracks a smoothed peak with attack, decay, and output-inertia time-constants.
LED controller for WS2812 LEDs with GRB color order.
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)
Implements a simple red square effect for 2D LED grids.
Representation of an RGB pixel (Red, Green, Blue)