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
+3 -2
View File
@@ -745,8 +745,9 @@ ComponentState deserializeComponentState(const std::vector<std::uint8_t>& bytes,
// default (unity) holds, reproducing pre-FB1 output exactly. A non-finite, negative, or
// above-cap value (a corrupt blob) falls back to unity rather than silencing/blasting.
if (version == kComponentStateVersion) {
const double g = bitsToDouble(asU64(r.i64()));
if (!r.ok) return out; // truncated inside the gain double -> empty (unity holds)
const double g = bitsToDouble(r.u64());
if (!r.ok) return out; // truncated inside the gain double unity holds (out already
// carries mode/marker/velocity/voice fields from above)
out.masterGainLinear =
(std::isfinite(g) && g >= 0.0 && g <= vst::masterGainMaxLinear() * (1.0 + 1e-9))
? g