Skip to content

GEQEffect

Source: GEQEffect.h

GEQEffect

class GEQEffect
src/light/effects/GEQEffect.h:30

Inherits: EffectBase

Audio-reactive graphic-equalizer effect: 16 bands as vertical bars.

GEQEffect card GEQEffect controls Author: Andrew Tuline (WLED-SR), via the predecessor, https://github.com/ewowi/MoonLight/blob/main/src/MoonLight/Nodes/Effects/E_WLED.h

The 16 audio bands spread across a panel's columns, each rising to its band's loudness. A peak dot sits at the highest the bar recently reached and falls back slowly. GEQ3D in this folder draws the same data in perspective instead.

Prior art: WLED's 2D GEQ, of the Aircoookie and Andrew Tuline lineage, by way of MoonLight.

Public Attributes

uint8_t fadeOut = 248 : The per-frame fade, which is the motion trail. A fast fade snaps the bars rather than smearing.

uint8_t ripple = 4 : The peak dot falls one row every this many frames, and 0 removes the dot.

bool colorBars = false : Color each bar by its column rather than by height along it.

bool smoothBars = false : Blend each band with its neighbors, for a smoother profile.

Public Methods

virtual inline const char * tags() const override : Catalog tags: MoonLight origin, WLED lineage, audio-reactive.

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

virtual inline void defineControls() override : Publish the trail, the peak fall rate and the two coloring toggles.

virtual inline void prepare() override : Size one peak tracker per column, and start every peak at the floor.

virtual inline void tick() override : Fade the trail, then fill each column to its band and drop its peak dot.

More info

One frame

The buffer fades a little, which is the motion trail fadeOut sets. Each column then reads its band, optionally smoothed against its neighbors, and fills from the floor. The bar takes one color per column under colorBars, or a gradient running up it. A per-column tracker remembers the tallest the bar reached, drawn as a dot once the bar falls below. That dot decays one row every ripple frames, and ripple 0 disables it.

Reproduced from WLED: the band mapping, the smoothing weights, the fill and the falling peak. Silence flattens the bars and the peaks fall away.