v2.2.0 release: live-parameter ramp origin primed at synth add

A @UIParam/@LiveParam value assigned after construction but before the first render
is now delivered flat on the first block instead of ramping from the property-
declaration default (fixes e.g. a NoiseGate restored from saved rig state latching
open and ignoring its threshold). Backed by a new internal-facing
LiveParameterValue._primeRampOrigin() (default no-op, source-compatible); live
changes after start still ramp. See RELEASES.md for the full behavior-change note.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-03 12:25:29 -08:00
parent c14efe998a
commit 24ea32e47c
9 changed files with 238 additions and 6 deletions
+51
View File
@@ -7,6 +7,57 @@ functionality in a backward-compatible way.
---
## 2.2.0 — Live-parameter ramp origin primed at synth add
A small-but-behavioral release. One fix to how `@UIParam` / `@LiveParam` values
are delivered on a synth's first rendered block, plus the internal hook that
backs it. The public API is source-compatible — the one new protocol member is
internal-facing and ships with a default implementation — so this is drop-in
over 2.1.x, but the delivery change is observable and is called out below.
**Fix — a parameter set before the first render is now delivered flat.** When a
value is assigned to an `@UIParam` / `@LiveParam` *after the synth is
constructed but before it first renders* — most commonly when restoring saved
state onto a freshly built synth — the parameter is now delivered as a flat
block at that value from sample 0. Previously the first rendered block ramped
from the property-declaration default up to the assigned value over one
(sub-)block, because the property-wrapper setter advances the atomic target but
not the interpolation origin, which stayed at the construction-time default.
For most parameters that one-block (~a few ms) glide was benign. For a value
feeding a decision stage it was not: a `Schmidt` trigger fed a threshold that
swept up from the default would latch on the transient and, if the steady signal
sat inside the hysteresis band, never reset — e.g. a `NoiseGate` restored from a
saved rig would open on load and ignore its threshold. Priming the origin at add
removes the sweep.
Mechanically: `SynthesizerBase`, as part of the `Mirror`-based live-parameter
auto-registration it already runs at add time (`rebuildGraph()`, main thread,
before the node is visible to the RT thread), now also primes each parameter's
ramp origin to its current value via a new `LiveParameterValue._primeRampOrigin()`.
`ParameterNode` and `UIParamNode` implement it; external conformers inherit a
no-op default, so nothing is source-broken. A re-add (`remove` → change value →
`add`) likewise re-primes to the then-current value.
**Behavior change to be aware of.** Two deliveries changed, both toward "the
value you set before starting is the value you get":
- A value assigned between construction and first render is **flat** on block
one, not a ramp from the declaration default. Code that (knowingly or not)
relied on that opening glide will no longer see it. If you want an opening
ramp, drive the parameter from a source/envelope or change it after start.
- A synth removed, re-assigned while out of the tree, then re-added starts
**flat at the new value** rather than gliding from the value it last rendered.
Live changes made **while the synth is running** are unchanged — they still ramp
per (sub-)block from the last rendered value, as before. The source-slot /
crossfade path is unaffected (the source overwrites the origin each block).
Pinned by `LiveParamRampOriginTests` (flat delivery for `@UIParam` and
`@LiveParam`, live-change-still-ramps, remove/change/re-add, and source-slot
non-interference).
---
## 2.1.1 — Delay-click fix + internal consolidation
A patch release: one audible bug fix in the delay/comb/allpass family, plus a