You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: cut audio-CPU on the voice path + LTO flash savings
No audible change; verified to build clean (FLASH 98.2% -> 97.1%).
- Voice filter coefficients (Svf sinf+powf / Moog polynomial) are recomputed only
when cutoff/resonance/filter-type change, not every sample -- a real saving for
static-filter patches (cutoff held, no filter envelope).
- Unison detune frequency multipliers + 1/u gain are precomputed per block instead
of a per-sample division per oscillator.
- The final hard clamp to [-1,1] is folded into the master limiter, dropping a whole
extra per-block buffer pass in main.cpp.
- master.h: the param-smoothing coefficient uses params::audio::kBlockSize instead of
a hardcoded 48, so block size is a clean one-line lever.
- Enable -flto (compile + link); keep usb_identity.c out of LTO so its descriptor
override stays deterministic. Nets ~1.5 KB of internal flash back.
Note: the original "hoist SetFreq out of the loop" idea was dropped -- DaisySP's
SetFreq is the costly call, not the oscillator's, so the coefficient guard above is
where the saving actually is.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments