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:
@@ -237,6 +237,14 @@ open class Pedal: SynthesizerBase {
|
||||
[]
|
||||
}
|
||||
|
||||
/// Current values of every ``effectSelectors`` entry flagged `rebuildsOnChange` — the selectors
|
||||
/// whose choice changes the graph topology (e.g. a cabinet voice). A lightweight recall compares
|
||||
/// 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 }
|
||||
}
|
||||
|
||||
/// Effect-specific transport controls, rendered as a row directly below the knobs — above
|
||||
/// ``effectButtons``. Use for the persistent state toggles and transport stops that read as
|
||||
/// a group distinct from the momentary "do it now" actions (e.g. a looper's Loop / Stop /
|
||||
|
||||
Reference in New Issue
Block a user