audio: add master volume + drive (tanh soft-sat) FX
Lands the DSP + JS binding plumbing for the two remaining FX that
notepat has wanted on a slider but didn't have a target for:
sound.volume.setMix(value) 0..2 (0..200%) master output gain
Applied AFTER the existing FX chain and
compressor but BEFORE system_volume (the
ALSA hardware mixer) and soft_clip. So
the slider acts as a per-user soft gain
that the hardware master still rides on top of.
sound.drive.setMix(value) 0..1 dry/wet blend to a tanh soft-clipper
with pre-gain (1+5*mix) and post-attenuation
(0.8). 0 is clean bypass; mid settings add
tube-ish harmonic warmth; 1.0 is obvious
saturation.
Both have the same exponential smoother as fx/room/glitch mixes (≈1 s
time constant at 48 kHz) so slider sweeps don't zipper. Defaults:
master_volume = 1.0 (unity)
drive_mix = 0.0 (bypass)
Follow-up commit will add the UI sliders + trackpad X/Y bindings in
notepat.mjs next to the existing echo/pitch/crush rows. The C path is
landing first so the next oven build has the audio side ready and the
UI work can layer on without a second build round-trip.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>