Skip to content

AudioSpectrumEffect

Source: AudioSpectrumEffect.h

AudioSpectrumEffect

class AudioSpectrumEffect
src/light/effects/AudioSpectrumEffect.h:24

Inherits: EffectBase

Audio-reactive effect: colors the layer from the 16-band FFT spectrum.

AudioSpectrumEffect card AudioSpectrumEffect controls Author: MoonLight original, on the WLED-SR GEQ / spectrum-analyzer concept (Andrew Tuline), via the predecessor, https://github.com/ewowi/MoonLight/blob/main/src/MoonLight/Nodes/Effects/E_WLED.h

The classic equalizer display: sixteen bands across x, each column lit from the bottom up. The bands scale to any width, so a wide grid gives each several columns and a narrow one samples.

Public Attributes

uint8_t colorMode = 1 : Color by height for the VU look, or per band, which reads as a spectrum at a glance.

Public Methods

virtual inline const char * tags() const override : Catalog tags for the visual catalog.

virtual inline Dim dimensions() const override : Writes the z=0 slice, which extrude fills through a volume.

virtual inline void defineControls() override : Publish the coloring choice.

virtual inline void tick() override : Draw the level meter, then one bar per column from its band's magnitude.

More info

The bottom row is a level meter

On a grid at least three rows tall, the bottom row becomes a horizontal level bar. The spectrum bars then sit above it, and a shorter grid gives its whole height to them. On a single row the bars collapse to per-column brightness instead.

This effect is the audio test instrument, so it shows the raw level rather than a smoothed one. The smoothed value lags by tens of milliseconds, which is the calm look every other effect wants.