fix(vst): master-gain per-sample ramp (no zipper/click); voice-count commits once on release; minor review items

This commit is contained in:
2026-07-27 23:30:27 -04:00
parent 43155cf320
commit e2c73e30d6
7 changed files with 116 additions and 43 deletions
+7 -2
View File
@@ -367,9 +367,14 @@ private:
MonoTrigger monoTrigger_ = MonoTrigger::Retrigger;
// FB1 post-mixer master gain (LINEAR; persisted in component state v8). A lock-free
// atomic — the ONE voice-param the audio thread reads directly (a single relaxed load
// per block, applied as a post-sum multiply). Default unity = pre-FB1 output.
// atomic — the target the UI thread writes; the audio thread ramps gainCurrent_ toward
// it per-sample each block (linear interpolation, ~20 ms at 48 kHz / 256-frame block)
// so sudden knob moves produce no zipper noise and the true-zero bottom causes no click.
std::atomic<float> masterGain_{1.0f};
// The audio-thread running gain value: tracks masterGain_ across blocks, stepping at
// most kGainRampRate per sample toward the target. Starts at unity (pre-FB1 default).
// Written and read exclusively on the audio thread — no atomics needed.
float gainCurrent_ = 1.0f;
// --- S-VIEW-4 preview-trigger mailbox (off-thread -> audio thread, lock-free) ---------
// The editor's preview-trigger button posts a note-on/off request from the UI thread; process()