perf(cab): instantiate only the selected cabinet convolver
The cab selector was a Select over one ConvolutionReverb per CabinetVoice, and Select evaluates every input each block — so all 8 voices' partitioned-FFT convolvers ran continuously (7/8 discarded), per CabinetPedal and per amp voice. Build only the selected voice's convolver. The cab selector is now rebuildsOnChange: committing a new stop asks the host to rebuild the board (same mechanism the Neural Amp model loader uses), which re-enters effect() with the new voice. One convolver runs instead of N; cost moves to a brief rebuild on cab switch (cabs are set-and-forget). - PedalSelectorKnob: add rebuildsOnChange flag. - PedalSelectorKnobView: fire onCommit on drag-end when the stop changed. - PedalView: wire onCommit → pedalRebuildAction for rebuildsOnChange selectors. - CabinetVoice.voice(atSelectorValue:): rounded/clamped index → voice. - CabinetPedal + AmpVoicePedal: single ConvolutionReverb for the selected voice. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -777,7 +777,12 @@ public struct PedalView: View {
|
||||
HStack(alignment: .top, spacing: PedalView.knobRowItemSpacing) {
|
||||
Spacer(minLength: 0)
|
||||
ForEach(Array(selectors.enumerated()), id: \.offset) { pair in
|
||||
PedalSelectorKnobView(pair.element)
|
||||
PedalSelectorKnobView(
|
||||
pair.element,
|
||||
onCommit: pair.element.rebuildsOnChange
|
||||
? { [pedal, pedalRebuildAction] in pedalRebuildAction(pedal) }
|
||||
: nil
|
||||
)
|
||||
}
|
||||
Spacer(minLength: 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user