feat(amps): channel-switch enabler + drive-channel amps (Phase 4)

Enabler:
- PedalSwitch.rebuildsOnChange (mirrors PedalSelectorKnob): a switch that changes
  graph topology asks the host to rebuild. Wired through PedalSwitchView (onCommit
  on a changed tap) and PedalView.switchRow → pedalRebuildAction.
- AmpVoicePedal.preampStage(_:) overridable hook (default: one TriodeStage at
  Gain). preCabinetCore feeds it; a channel amp cascades an extra stage on its
  drive channel. Named preampOversample constant (4).

Amps:
- Fullerton Drive — American two-channel combo: blackface Clean + an overdrive
  channel (cascaded TriodeStage set by Drive), spring reverb, Bright. Channel
  switch is rebuildsOnChange, so only the selected channel's stages are built.
- Jazz Clean — add the JC onboard Distortion channel (Clean/Dist switch + Drive
  knob) via the same preampStage cascade; flows through its stereo wideEffect.

Registered Fullerton Drive across 6 sites as .amp. 22 tests across the two amps
(channel switch changes output, drive knob, rebuildsOnChange, ceiling on the
drive channel, control surface, round-trip, registry).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 13:04:06 -07:00
parent 8cd77ad984
commit da4d5e23ea
12 changed files with 327 additions and 10 deletions
@@ -49,6 +49,9 @@ public struct PedalSwitchView: View {
// MARK: - Properties
private let pedalSwitch: PedalSwitch
/// Called once when a tap commits a different position — used to trigger a board rebuild for
/// `rebuildsOnChange` switches (e.g. a channel switch). `nil` for plain switches.
private let onCommit: (() -> Void)?
@Environment(\.shoeGazeTempoEnabled) private var tempoEnabled: Bool
@@ -56,9 +59,13 @@ public struct PedalSwitchView: View {
/// Creates a segmented switch view.
///
/// - Parameter pedalSwitch: The discrete switch descriptor to render.
public init(_ pedalSwitch: PedalSwitch) {
/// - Parameters:
/// - pedalSwitch: The discrete switch descriptor to render.
/// - onCommit: Called when a tap selects a different position. Used for `rebuildsOnChange`
/// switches; `nil` otherwise.
public init(_ pedalSwitch: PedalSwitch, onCommit: (() -> Void)? = nil) {
self.pedalSwitch = pedalSwitch
self.onCommit = onCommit
}
// MARK: - Body
@@ -97,7 +104,9 @@ public struct PedalSwitchView: View {
private func segment(option: PedalSwitch.Option, isActive: Bool) -> some View {
Button(action: {
let changed: Bool = option.value != pedalSwitch.node.value
pedalSwitch.node.update(option.value)
if changed { onCommit?() }
}) {
Text(option.title)
.font(.system(size: PedalSwitchView.fontSize, weight: .semibold))