Fix/synth crackle cpu#8
Merged
Merged
Conversation
Intermittent crackle in Synth mode came from per-block CPU spikes, not sustained load (the watchdog only sheds after ~150ms, so transient peaks slipped through). Two changes attack the peak: - voice.h: recompute the filter SetFreq (Svf sinf+powf / Moog polynomial) at control rate (every kCoefInterval=8 samples, ~6 kHz) instead of every sample. A moving filter envelope changes fc every sample, which used to force a per-sample SetFreq on every voice; a chord put all 6 voices on that path at once and spiked a block past the deadline. Unchanged-coef skip is kept (static patches stay free); a filter-type switch still forces an immediate recompute. Inaudible for sweeps. - params.h: audio block size 48 -> 64 (~1.3 ms @ 48 kHz) for more headroom against transient spikes and to amortize per-block control work. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Describes the heaviest engine configuration (Synth + 6 voices/4 unison/ analog/Moog + reverb + master filter, MIDI-flooded) and how to read the SysEx CPU meter and watchdog when changing DSP or voice counts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Fix: intermittent crackle in Synth mode under load. The crackle was a per-block CPU
spike, not sustained load (so the watchdog, which only sheds after ~150 ms, never caught
it): a moving filter envelope changed the cutoff every sample, forcing a per-sample
SetFreq(Svfsinf+powf/ Moog polynomial) on every voice — and a chord put all 6voices on that path at once, tipping a block past its deadline. The voice filter now
recomputes its coefficients at control rate (every 8 samples, ~6 kHz — inaudible for
sweeps) while keeping the existing "skip when unchanged" fast path for static patches.
The audio block size also goes 48 → 64 (~1.3 ms @ 48 kHz) for more headroom against
transient spikes.
Checklist
src/config/params.hdocs/MIDI_PROTOCOL.mdand theparams::midimap