diff --git a/Sources/LyrebirdShoeGaze/Pedal.swift b/Sources/LyrebirdShoeGaze/Pedal.swift index 29c24e9..b060e53 100644 --- a/Sources/LyrebirdShoeGaze/Pedal.swift +++ b/Sources/LyrebirdShoeGaze/Pedal.swift @@ -242,7 +242,11 @@ open class Pedal: SynthesizerBase { /// this before/after applying a snapshot to decide whether the board must be rebuilt (a plain /// node write does not re-enter `effect(_:)`). Empty for pedals with no such selectors. public var rebuildSelectorValues: [Double] { - effectSelectors.filter { $0.rebuildsOnChange }.map { $0.node.value } + // Sanitize non-finite to a fixed sentinel: the before/after compare in a recall uses `!=`, + // and `NaN != NaN` would force a spurious rebuild on every recall. + effectSelectors + .filter { $0.rebuildsOnChange } + .map { $0.node.value.isFinite ? $0.node.value : 0.0 } } /// Effect-specific transport controls, rendered as a row directly below the knobs — above diff --git a/Sources/LyrebirdShoeGaze/Presets/ShoeGaze+Preset.swift b/Sources/LyrebirdShoeGaze/Presets/ShoeGaze+Preset.swift index 981ca60..95965ea 100644 --- a/Sources/LyrebirdShoeGaze/Presets/ShoeGaze+Preset.swift +++ b/Sources/LyrebirdShoeGaze/Presets/ShoeGaze+Preset.swift @@ -334,8 +334,8 @@ extension ShoeGaze { // MARK: - Lightweight recall - /// Applies parameter values from `state` to the current rig topology without - /// rebuilding the engine graph. + /// Applies parameter values from `state` to the current rig topology, rebuilding only the + /// boards where a graph-topology selector changed. /// /// This is a lightweight "recall settings" path intended for topologically identical /// rigs (same board count, same segment order, same pedal types). Boards, segments, and @@ -345,6 +345,12 @@ extension ShoeGaze { /// is thrown and remaining /// entries continue to be processed. /// + /// Most parameters apply live with no graph change. The exception is a `rebuildsOnChange` + /// selector (e.g. a cabinet voice, which picks which convolver is instantiated): if such a + /// selector's value differs from the live rig, that board is rebuilt via `rebuildBoard(_:from:)` + /// so the new selection takes effect — which carries the same at-most-one-block glitch as any + /// rebuild on a running engine. Boards without such a selector stay fully live. + /// /// Use `loadRig(from:)` when you need a full topology rebuild. /// /// - Parameter state: The `ShoeGazeState` whose parameter values should be applied.