Skip to content

Fix/synth crackle cpu#8

Merged
joak0068 merged 4 commits into
mainfrom
fix/synth-crackle-cpu
Jun 26, 2026
Merged

Fix/synth crackle cpu#8
joak0068 merged 4 commits into
mainfrom
fix/synth-crackle-cpu

Conversation

@joak0068

Copy link
Copy Markdown
Collaborator

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 (Svf sinf+powf / Moog polynomial) on every voice — and a chord put all 6
voices 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

  • New tunable values live in src/config/params.h
  • If a control changed, updated docs/MIDI_PROTOCOL.md and the params::midi map
  • Tested on hardware (Daisy Seed + Hothouse) — describe below, or note if untested

joak0068 and others added 4 commits June 26, 2026 15:10
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>
@joak0068
joak0068 merged commit 78c9b26 into main Jun 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant