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
@@ -44,7 +44,7 @@ public enum PedalCategory: String, CaseIterable, Identifiable, Sendable {
}
private static let mapping: [String: PedalCategory] = [
"California": .amp, "British": .amp, "British Plexi": .amp, "British JTM": .amp, "British Bluesbreaker": .amp, "Chime": .amp, "Chime 15": .amp, "Chime Normal": .amp, "Chime Baby": .amp, "Fullerton Reverb": .amp, "Fullerton Deluxe": .amp, "Fullerton Princeton": .amp, "Jazz Clean": .amp, "Chime Top Boost": .amp, "Neural Amp": .amp,
"California": .amp, "British": .amp, "British Plexi": .amp, "British JTM": .amp, "British Bluesbreaker": .amp, "Chime": .amp, "Chime 15": .amp, "Chime Normal": .amp, "Chime Baby": .amp, "Fullerton Reverb": .amp, "Fullerton Deluxe": .amp, "Fullerton Princeton": .amp, "Fullerton Drive": .amp, "Jazz Clean": .amp, "Chime Top Boost": .amp, "Neural Amp": .amp,
"Overdrive": .gain, "Distortion": .gain, "Fuzz": .gain, "Volume": .gain,
"Compressor": .dynamics, "Sustainer": .dynamics, "Limiter": .dynamics, "Noise Gate": .dynamics,
"Graphic EQ": .filter, "Auto-Wah": .filter, "Wah": .filter, "Mutant": .filter,
@@ -54,7 +54,7 @@ public struct PedalPaletteView: View {
/// Preferred display order for the built-in pedals. Any registered pedal not listed here is
/// appended afterwards (sorted) so the palette never silently drops a newly added pedal.
private static let preferredOrder: [String] = [
"California", "British", "British Plexi", "British JTM", "British Bluesbreaker", "Chime", "Chime 15", "Chime Normal", "Chime Baby", "Fullerton Reverb", "Fullerton Deluxe", "Fullerton Princeton", "Jazz Clean", "Chime Top Boost", "Neural Amp", "Overdrive", "Distortion", "Compressor", "Sustainer", "Limiter", "Noise Gate", "Fuzz",
"California", "British", "British Plexi", "British JTM", "British Bluesbreaker", "Chime", "Chime 15", "Chime Normal", "Chime Baby", "Fullerton Reverb", "Fullerton Deluxe", "Fullerton Princeton", "Fullerton Drive", "Jazz Clean", "Chime Top Boost", "Neural Amp", "Overdrive", "Distortion", "Compressor", "Sustainer", "Limiter", "Noise Gate", "Fuzz",
"Volume",
"Graphic EQ", "Tremolo", "Phaser", "Modulation", "Chorus", "Flanger", "Vibrato", "Rotary",
"Auto-Wah", "Wah", "Mutant", "Cabinet", "Ring Modulator", "Diffuser", "Bitcrusher", "Granulator",
@@ -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))
+7 -1
View File
@@ -29,6 +29,7 @@ private func enclosureColor(for displayName: String) -> Color {
case "Fullerton Reverb": return Color(red: 0.15, green: 0.22, blue: 0.30) // blackface panel
case "Fullerton Deluxe": return Color(red: 0.17, green: 0.20, blue: 0.26) // blackface, warmer
case "Fullerton Princeton": return Color(red: 0.19, green: 0.19, blue: 0.23) // small blackface
case "Fullerton Drive": return Color(red: 0.22, green: 0.18, blue: 0.24) // two-channel combo
case "Jazz Clean": return Color(red: 0.14, green: 0.30, blue: 0.34) // solid-state silver-teal
case "Chime Top Boost": return Color(red: 0.20, green: 0.32, blue: 0.20) // vox-green tolex
case "Neural Amp": return Color(red: 0.22, green: 0.16, blue: 0.30) // deep neural violet
@@ -824,7 +825,12 @@ public struct PedalView: View {
if !switches.isEmpty {
HStack(alignment: .top, spacing: PedalView.knobSpacing) {
ForEach(Array(switches.enumerated()), id: \.offset) { pair in
PedalSwitchView(pair.element)
PedalSwitchView(
pair.element,
onCommit: pair.element.rebuildsOnChange
? { [pedal, pedalRebuildAction] in pedalRebuildAction(pedal) }
: nil
)
}
}
}