beat lab / tone lab
SCULPT + PERFORM

Now sculpt with bins and play with keys.

The hero above is the argument: timbre and performance live in the same gesture. Vertical motion tilts the spectrum from bright to dark; horizontal motion sweeps the chromatic keyboard; entering the field gates the ADSR envelope. One pointer, three transducers — sculpt, play, shape.

Below is the instrument. The top half is a 32-bin spectrum sculptor — draw any timbre. The bottom half is a chromatic keyboard mapped to your computer keys, with eight-voice polyphony and per-voice ADSR. Sculpt a sound, then perform with it.

One shared state holds timbre, voice allocation, and envelope parameters. The AudioWorklet reads all three and produces shaped polyphonic audio. The Canvas reads envelope levels back for visual feedback. Dual reconciliation v7. Sculpt a timbre in the Fourier Sculptor and load it here.

THE ARCHITECTURE
POLYPHONIC ADDITIVE SYNTHESIS

Each voice runs the same additive synthesis algorithm — 32 sine partials weighted by the bin amplitudes. But each voice has its own fundamental frequency, determined by the key pressed. Eight voices can sound simultaneously. Power normalization keeps volume stable as voices stack.

ADSR ENVELOPE

Every voice has its own ADSR envelope — attack ramps up, decay falls to sustain, sustain holds, release fades to silence. The envelope runs per-sample in the AudioWorklet. Presets shape the character: organ (instant), piano (percussive decay), pad (slow swell), pluck (fast transient, no sustain).

DUAL RECONCILIATION V7

The SharedArrayBuffer carries three kinds of state: timbre (32 bins), performance (8 voice frequencies + gates), and envelope parameters (ADSR). The worklet writes per-voice envelope levels back. The Canvas reads them for keyboard glow that tracks the exact amplitude of each sounding voice.

WHY THIS MATTERS

The sculptor proves you can draw sound. The tone lab proves you can perform with it. ADSR gives each note a shape — the difference between a piano strike and a pad swell, using the same timbre. Sound design, envelope shaping, and performance share a substrate. The instrument IS the visualizer IS the synthesizer.

KEY MAPPING
WHITE KEYS
A
C3
S
D3
D
E3
F
F3
G
G3
H
A3
J
B3
K
C4
L
D4
;
E4
BLACK KEYS
W
C#3
E
D#3
T
F#3
Y
G#3
U
A#3
O
C#4
P
D#4
SIGNAL CHAIN
draw bins
key press
SAB write
AudioWorklet
ADSR envelope
poly synth
destination
Bins
32 harmonics
Polyphony
8 voices
Transport
SAB / postMessage
Range
C3 — E4 (17 keys)