Every point
is a
sound.
The terrain below is a map of timbre-pitch space. Horizontal is frequency — 80 Hz to 1200 Hz, logarithmic. Vertical is spectral richness — pure sine at the bottom, 16-harmonic series at the top.
Touch any point. What you see is what you hear. The AudioWorklet runs 16 oscillators in parallel, their amplitudes shaped by a spectral rolloff curve. Move up — harmonics emerge. Move down — they dissolve into purity.
Same architecture as Signal: one state, two transducers. But now the state carries two dimensions. Frequency rides the SPSC ring buffer. Timbre sits in an atomic slot. Both read by audio and canvas simultaneously.
16 sine oscillators tuned to integer multiples of the fundamental. Harmonic n has amplitude 1/nk(y), where k(y) = 8(1-y)² + 0.15. At y=0, the exponent is ~8 — only the fundamental survives. At y=1, the exponent drops to 0.15 — a bright, brassy spectrum with all harmonics present. Normalized for constant perceived loudness across the timbre axis.
Harmonics above 45% of the Nyquist frequency are suppressed. At a fundamental of 1200 Hz, harmonic 16 would be 19200 Hz — above Nyquist at 44100 Hz sample rate. The processor skips these automatically. At lower fundamentals, all 16 harmonics render cleanly. The result: no aliasing artifacts, no matter where you play on the terrain.
Frequency uses the SPSC ring buffer — high-bandwidth, per-frame updates as you sweep horizontally. Timbre uses an atomic float slot — lower bandwidth, but the value changes less frequently and doesn't need the ring buffer's depth. Both sit in the same SharedArrayBuffer. The AudioWorklet reads both on every render quantum (128 samples, ~2.9ms).
The background texture isn't decoration — it's a precomputed map of the harmonic space. Brighter regions have more spectral energy. Color encodes frequency. Every pixel corresponds to a specific combination of pitch and timbre. The visual IS the parameter space. Move your cursor and the sound follows the terrain.
Where n is the harmonic number (1-16), y is the timbre parameter (0-1), and A is the normalized amplitude. The quadratic curve in k(y) gives more control resolution in the lower half of the timbre axis, where the ear is most sensitive to tonal change.