native: tanh soft-limiter + dropped/shaped dither (smoother speaker audio)
pumice-flare-fern log showed big progress (amp on 75s vs ~10s before)
but user still reports "fuzzy" speaker quality. Two refinements:
- soft_clip now uses tanh(x*0.9)/tanh(0.9) — a proper smooth limiter.
The previous piecewise clipper had a kinked transfer curve above
the 0.85 knee, producing harsh compression on loud notepat peaks.
tanh adds small even-order harmonics (warm character) instead of
the tinny distortion of the kinked curve.
- Dither reduced ±32 → ±8 and alternates every 8 samples (3 kHz
instead of 24 kHz). Less likely to leak through DAC anti-alias
filter at high gain. Still -72 dBFS, enough to hold SOF silence
detector open.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>