Expand description
Spectrum scene (Plan 0034 / ADR-0036): the analysis frame’s log-spaced band array, drawn as N elements.
This is a fourth consumer of the existing line idiom, not a fifth render
idiom: N bars, an N-point polyline and a radial ring of N spokes are all
segment lists, and they go out through the same shared
LineRenderer the three other line scenes draw
through (ADR-0007). Nothing new is uploaded, no new pipeline is built, and
the Scene trait is untouched — update already receives the whole
AnalysisFrame, bands included.
The per-frame work is a chain of small pure steps — downsample, the
per-element ease, then one of the three SpectrumLayout builders — all
free functions over preallocated buffers. They are separate from the scene so
the claims that matter (low elements track low frequencies; the 64 → N
reduction loses nothing) are testable without a GPU.
The composite vocabulary this scene honors, since a silent no-op is the failure mode the shared-surface work exists to avoid:
zoom/pan_x/pan_y— the shared view transform (ADR-0018), applied by the renderer exactly as for every other line scene.mirror_order/mirror_reflect— the geometry mirror (Plan 0018 Phase 4). It replicates real geometry before rasterization and costs this scene nothing, so refusing it would be a no-op the author could not see. On the radial ring it is nearly the identity (the ring is already rotationally symmetric, the same near-no-op the Hankin star has); on bars and polyline it is genuinely transformative, because those figures are not centred.[palette]/[palette_b]/palette_mix/hue/hue_spread/saturation— the colour surface (ADR-0021), sampled on the CPU. Each line scene walkshue_spreadalong the axis its own generator makes meaningful (ADR-0059) — path position onparametric, generation depth onlsystem, radius onstar— and this scene’s is band index. The defaultspectrumpalette is the engine cosine, so an author who sets no[palette]sees the usual colour language.thickness/brightness/scale/base— ordinary stroke styling.curve— the level-shaping exponent (ADR-0040, Plan 0038 Phase 3), applied to the downsampled level before the per-element smoother so the easing operates in the displayed domain.1.0is exactly linear. It is the third per-element lever on an element’s length, besidebaseandscale.glow— the line renderer’s per-segment falloff multiplier (Plan 0038), whole-figure like on the other three line scenes. Not a post bloom.softness— the across-the-stroke profile (ADR-0124), whole-figure and shared with the other three line scenes. Default0.25: a solid bar with a short shoulder.1.0is the pure quadratic falloff;0is solid with a one-pixel edge. A different quantity fromglow, which scales the light and never the coverage.
Three parameters are layout-specific, and each is a no-op on the layouts
it does not describe — stated in presets/README.md and docs/presets.md
rather than left for an author to discover:
radiusis the ring’s inner radius; no meaning for bars or the polyline.spanandbaselineplace the bars/polyline figure in world space; no meaning for the ring, whichradiussizes instead (Plan 0038 Phase 2).
Structs§
- Spectrum
Scene - The spectrum readout: N elements driven by the analysis frame’s band array, drawn through the shared line renderer.
Enums§
- Spectrum
Layout - Which figure the elements form. Selected once at preset load through the
[spectrum]table; an unknown name is a surfaced load error (ADR-0007).
Constants§
- MAX_
ELEMENTS - Largest element count a
[spectrum]table may ask for — the band count itself, because above it the 64 → N reduction stops being a partition of the array. The loader validates against this, and the render layer sizes its per-element scratch to it (Plan 0034 Phase 4), so the two cannot disagree. - PARAMS
- Parameter vocabulary — see
fragment_field::PARAMS. Keep in sync withset_parambelow.