fix(cab): rebuild board on lightweight recall of a topology selector
Review follow-up to the single-convolver cab change. Now that only the selected cabinet voice's convolver is built, any path that changes the selector value without rebuilding leaves audio on the stale convolver. The UI drag already rebuilds; the gap was ShoeGaze.applyState (lightweight scene recall), which applies param snapshots to live pedals without a rebuild. - Pedal.rebuildSelectorValues: values of effectSelectors flagged rebuildsOnChange. - applyState/applySegmentParams/applyBranchParams: detect when a rebuildsOnChange selector value actually changes during recall and rebuild only those boards; boards without such a selector keep the cheap live-apply path. - CabinetVoice.voice(atSelectorValue:): guard non-finite and clamp in Double space so Int() can never trap on a corrupt preset value. - Doc fixes: CabinetPedal.cabinet and AmpVoicePedal chain diagram no longer claim a live Select. MIDI CC is unaffected: selectors are not in ccMappableControls (knobs + sliders only). Tests: recall changing the cab voice rebuilds and applies; recall with an unchanged voice does not rebuild. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ import LyrebirdUI
|
||||
/// → ToneStack(bass, mid, treble, model) (fixed per amp)
|
||||
/// → TriodeStage(power-amp drive) (power-amp warmth)
|
||||
/// → shapeVoice(_:) (subclass signature filter)
|
||||
/// → ConvolutionReverb(cab IR) (speaker cabinet — live-selectable voice)
|
||||
/// → ConvolutionReverb(cab IR) (speaker cabinet — voice-selectable, rebuild on change)
|
||||
/// ```
|
||||
/// Fully wet (the amp replaces the dry signal); `Level` is the master. Double-width amp-head card.
|
||||
///
|
||||
|
||||
@@ -42,7 +42,8 @@ public final class CabinetPedal: Pedal {
|
||||
// MARK: - Parameters
|
||||
|
||||
/// Selected cabinet voicing as an index into ``CabinetVoice/allCases``. Snaps to integer
|
||||
/// stops via the ``cabinet`` selector; read live by the `Select` in `effect(_:)`.
|
||||
/// stops via the ``cabinet`` selector; read at board-build time by `effect(_:)`, which
|
||||
/// instantiates only that voice's convolver (the selector is `rebuildsOnChange`).
|
||||
@UIParam public var cabinet: Double = 0.0
|
||||
|
||||
// MARK: - Constants
|
||||
|
||||
Reference in New Issue
Block a user