Skip to content

GEQ3DEffect

Source: GEQ3DEffect.h

GEQ3DEffect

class GEQ3DEffect
src/light/effects/GEQ3DEffect.h:28

Inherits: EffectBase

Audio-reactive 3D graphic-equalizer effect.

GEQ3DEffect card GEQ3DEffect controls Author: @TroyHacks (MoonModules, GPLv3), https://github.com/ewowi/MoonLight/blob/main/src/MoonLight/Nodes/Effects/E_MoonModules.h

The 16 bands rise as bars on a 2D grid, drawn with faked depth. GEQEffect in this folder draws the same data flat instead.

Prior art: MoonLight's GEQ3D, descended from the WLED-MM effect.

Public Attributes

uint8_t speed = 2 : The projector's sweep rate, timed in BPM so every device agrees on its position.

uint8_t frontFill = 228 : How strongly a bar's front face fills.

uint8_t horizon = 0 : The row the vanishing point sits on.

uint8_t depth = 176 : How far the side and top lines reach toward the projector.

uint8_t numBands = 16 : How many bands are shown, where fewer gives wider bars.

bool borders = true : Outline each bar.

Public Methods

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

virtual inline Dim dimensions() const override : The perspective is faked on a plane, so this is a 2D effect.

virtual inline void defineControls() override : Publish the sweep, the perspective and the bar's faces.

virtual inline void tick() override : Sweep the projector, then draw each bar's faces converging toward it.

More info

The projector is the vanishing point

Each bar's side and top faces are lines running from the bar toward a sweeping projector. depth shortens each line so it stops partway, and that converging foreshortening is the look. The projector sweeps left and right, and each band is painted away from it. So the perspective always points away from the moving vanishing point. The front faces fill flat, and a border optionally outlines each bar.

MoonLight's anti-alias toggle is dropped, since [draw::line] is a crisp Bresenham.