mirror of
https://github.com/storytold/soundcraft.git
synced 2026-10-28 20:46:58 -06:00
Profiling a demo-session bounce showed the time going to per-sample work that can be done more cheaply while producing bit-identical results: - mix: the fader ramp converted dB to gain (two powf) for every sample of every strip and of the master; GainRamp converts once per block. - mix: apply_matrix_span has slice fast paths for one and two taps per output, summing in the same order as the general loop. - mix/dsp: strip meters and the bounce peak use an 8-lane max (channel_peak); max is order-independent, so the result is unchanged. - dsp: LoudnessMeter true peak keeps its history in a doubled ring instead of shifting it every sample and runs the four phases side by side, each phase still summing its taps in the original order. - dsp: Maximizer finds the window minimum with a monotonic queue instead of scanning the whole lookahead window every sample. - dsp: flush() tests both bounds without short-circuiting; audio-io quantize rounds half away from zero without the libm call (exact on its clamped range). Demo bounce (24-bit dithered WAV, 55.9 s, 3 bounces per run, interleaved, 15 runs each, Ryzen 16 threads, shared machine): median 3.677 s -> 2.955 s (-19.6 %), min 3.116 s -> 2.394 s (-23.2 %). Output WAV byte-identical, reported LUFS/true peak/peak identical. New tests pin meter, maximizer, plate reverb and demo bounce output against values taken from the previous implementation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>