Skip to content

Variables

Eighteen read-only variables carry the live audio analysis into your expressions, plus five that carry position rather than sound: index for a per-element evaluation, and x/y/rad/ang for a per-vertex one.

VariableMeaningNotes
bassBass-band level (~20–250 Hz), as a fraction of its own recent peak.0–1. > 0.5 means “loud for this track”.
midMid-band level (~250–4000 Hz), same basis.0–1.
trebTreble-band level (~4–18 kHz), same basis.0–1; reads lowest of the three on most material.
onsetOnset/attack strength, as a fraction of its own recent peak.0–1. A transient, not a level — spikes on hits.
beat1.0 on a hop where a beat fired, else 0.0.A gate: beat * k adds k only on beat frames.
barBeat phase in [0, 1): 0 on each beat, ramping to the next.A misnomer kept for compatibility — for real bar position use bar_phase.
timeThe scene clock in seconds (monotonic).Use time * k for slow drift; k sets the speed.
tempoTracked tempo in BPM.Not a 0–1 band — see the warning below.
noveltySpectral-change transient: ~0 within a steady segment, spiking at a track/section boundary.Experimental — see below.
bass_rawAbsolute bass magnitude — the pre-normalization value.Raw and small (mean 0.040): multiply up and clamp.
mid_rawAbsolute mid magnitude.Raw and small (mean 0.006).
treb_rawAbsolute treble magnitude.Raw and small (mean 0.006).
onset_rawAbsolute spectral flux.Raw and very small (mean 0.002).
beat_indexMonotone onset counter, 0 before the first detection.Integer-valued, and not a musical periodmod(beat_index, 4) is not “every 4th beat”. See Musical time.
time_since_beatSeconds since the last beat; exactly 0 on a beat hop.A retriggered ramp — good for decays.
beat_in_barWhich beat of the bar, 03.beat_in_bar == 0 is the downbeat.
bar_indexBar counter — monotone except across an alignment change.mod(bar_index, 8) for an 8-bar arc, which a lock can repeat or drop one bar of.
bar_phasePosition across the whole bar, [0, 1).The genuine bar phase, unlike bar.
indexThe element’s own position in [0, 1] during a per-element evaluation.Not audio. 0 everywhere else — see below.
x / yThe vertex’s position in [0, 1] during a per-vertex evaluation; y = 0 is the top.Not audio. 0 outside a [per_vertex] table — see below.
radThat vertex’s distance from the centre, aspect-corrected against the render target.1.0 at the middle of the top and bottom edges on any display; further at the sides of a wide one.
angThat vertex’s angle from the centre, [0, tau), counter-clockwise from +x as you look at the screen.0 outside a [per_vertex] table.

The four headline levels are normalized (ADR-0049): each is divided by its own slowly-decaying running peak, with a silence floor so a quiet room reads 0 rather than amplified noise. That is what makes a threshold portable across tracks and gain staging. The cost is deliberate — absolute dynamics are hidden, so a quiet passage and a loud one read alike. When a look should scale with real loudness, use the *_raw twin and expect the old tiny magnitudes.

The five musical-time variables come from the beat tracker, and the three bar-position ones sit behind a confidence gate with a counter fallback, so they are always periodic and never confidently wrong about the music. 4/4 is assumed. None of the five is a dependable musical period. beat_index counts onset detections rather than beats, and the bar trio is the counter fallback most of the time — both measured, and diagnosed, in Musical time below. Read that section before you build structure on any of them.

tempo is the one variable that is not roughly 0–1. It is 0 until the tempo tracker warms up (the first several seconds of audio), then jumps to a real BPM in the ~60–200 range. Using it raw will blow out any parameter. Either scale it (tempo / 180) or — better — compare it:

select(tempo > 128, 2.5, 0.8) # a fast look above 128 BPM, a calm one below

novelty is experimental. It is a transient that spikes when the spectrum changes character — useful for gating an accent on a track or section change (beat * (novelty > 0.5)). Its DSP shape may change in a later release, or it may be withdrawn; do not build a preset that only works with today’s exact values.

Built from a8ce055 at version 0.115.0. This site tracks main and is not versioned per release.