Skip to content

RadialSpectrumEffect

Source: RadialSpectrumEffect.h

RadialSpectrumEffect

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

Inherits: EffectBase

Effect: the spectrum as ripples, one sector per band, radius as time, a shockwave per beat.

RadialSpectrumEffect card RadialSpectrumEffect controls

Each band owns a sector around the center, mirrored left and right. Sound is born at the center and travels outward, so the radius is time. A ring's length is that band's recent history, which makes this a radial spectrogram.

Public Attributes

uint8_t speed = 85 : How fast sound travels outward.

uint8_t persistence = 128 : How far out a ripple stays visible.

bool smooth = false : Read the meter ballistic rather than the raw bands.

bool beat = true : Add a white shockwave on every detected onset.

PolarLut::Controls polar : The polar address, and which mapping a cube takes.

Public Methods

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

virtual inline Dim dimensions() const override : Volumetric: a cube's rings become expanding shells.

virtual inline void defineControls() override : Publish the ripple's speed and reach, the source, the shockwave and the address.

virtual inline void prepare() override : Build the polar address table and clear the ring history.

virtual inline void tick() override : Birth any due rings from the current spectrum, then read one out per light.

Public Static Attributes

constexpr uint16_t kMaxHistory = 128 : rings of history, and the largest radius read

More info

Nothing is transported

The effect keeps a short history of band frames, one entry per ring, and every light reads it. A light's angle picks its band and its radius picks its age. That is two table reads a light, which is cheaper than drawing bars. It is volumetric for free: under the spherical mapping a cube's rings become shells.

It doubles as the diagnostic

Every sector is one band, so a stuck band shows as a sector that never moves or never dims. smooth switches between the raw bands and the meter ballistic, which is the useful comparison. beat adds the onset detector's hits as a white shockwave traveling out with the ripples.