From 8a08264fb4242cbf1599d3d514b1f13e6eabc6c3 Mon Sep 17 00:00:00 2001 From: Joshua Parmenter Date: Mon, 3 Aug 2026 11:55:23 -0700 Subject: [PATCH] =?UTF-8?q?feat(amps):=20Fender=20blackface=20variants=20?= =?UTF-8?q?=E2=80=94=20Fullerton=20Deluxe=20&=20Princeton=20(Phase=201)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make FullertonReverbAmpPedal open with a name-taking designated init, then derive two lower-headroom blackface combos that inherit its reverb + tremolo + bright control surface and differ only in voicing: - Fullerton Deluxe — 1×12, power-amp drive 2.2 (earlier breakup than the Twin's 1.5), americanCombo cab, slightly less bass. - Fullerton Princeton — 1×10, drive 2.6 (breaks up earliest), Vintage Dark cab, least bass, a shade darker. Both override powerAmpDriveInput (headroom via power-amp saturation) and powerAmpOversample → 4 for the harder drive. Registered across all 6 sites as .amp. 7 tests (variants differ from Twin + each other, inherited reverb/bright, ceiling at max gain, inherited control surface + oversample 4, round-trip, registry). Co-Authored-By: Claude Opus 4.8 --- Sources/LyrebirdShoeGaze/PedalType.swift | 2 + .../Pedals/FullertonDeluxeAmpPedal.swift | 39 ++++++ .../Pedals/FullertonPrincetonAmpPedal.swift | 41 ++++++ .../Pedals/FullertonReverbAmpPedal.swift | 17 ++- .../Presets/PedalRegistry.swift | 2 + Sources/LyrebirdShoeGazeUI/HelpView.swift | 2 +- .../LyrebirdShoeGazeUI/PedalCategory.swift | 2 +- .../LyrebirdShoeGazeUI/PedalPaletteView.swift | 2 +- Sources/LyrebirdShoeGazeUI/PedalView.swift | 2 + .../FullertonVariantsTests.swift | 127 ++++++++++++++++++ 10 files changed, 230 insertions(+), 6 deletions(-) create mode 100644 Sources/LyrebirdShoeGaze/Pedals/FullertonDeluxeAmpPedal.swift create mode 100644 Sources/LyrebirdShoeGaze/Pedals/FullertonPrincetonAmpPedal.swift create mode 100644 Tests/LyrebirdShoeGazeTests/FullertonVariantsTests.swift diff --git a/Sources/LyrebirdShoeGaze/PedalType.swift b/Sources/LyrebirdShoeGaze/PedalType.swift index 7e640ff..9bc0498 100644 --- a/Sources/LyrebirdShoeGaze/PedalType.swift +++ b/Sources/LyrebirdShoeGaze/PedalType.swift @@ -48,6 +48,8 @@ public extension PedalType { static let british = PedalType("British") static let chime = PedalType("Chime") static let fullertonReverb = PedalType("Fullerton Reverb") + static let fullertonDeluxe = PedalType("Fullerton Deluxe") + static let fullertonPrinceton = PedalType("Fullerton Princeton") static let jazzClean = PedalType("Jazz Clean") static let chimeTopBoost = PedalType("Chime Top Boost") static let neuralAmp = PedalType("Neural Amp") diff --git a/Sources/LyrebirdShoeGaze/Pedals/FullertonDeluxeAmpPedal.swift b/Sources/LyrebirdShoeGaze/Pedals/FullertonDeluxeAmpPedal.swift new file mode 100644 index 0000000..06b800e --- /dev/null +++ b/Sources/LyrebirdShoeGaze/Pedals/FullertonDeluxeAmpPedal.swift @@ -0,0 +1,39 @@ +// FullertonDeluxeAmpPedal.swift +// Lyrebird +// +// Copyright (c) 2026 Joshua Parmenter / realizedsound +// SPDX-License-Identifier: MIT + +import LyrebirdSynth +import LyrebirdUI + +/// American blackface **1×12 combo** — the lower-powered sibling of ``FullertonReverbAmpPedal``. +/// +/// Same reverb + tremolo + Bright control surface, but with less clean headroom: the power-amp +/// stage is driven harder so it breaks up earlier and grittier than the big 2×12 Twin voice. The +/// go-to blackface combo tone. +public final class FullertonDeluxeAmpPedal: FullertonReverbAmpPedal { + + /// Power-amp drive — higher than the Twin's fixed `1.5` so it saturates earlier (less headroom). + private let deluxePowerDrive: Double = 2.2 + + public override var summaryText: String { + "American 1×12 combo — earlier-breakup blackface tone with reverb, tremolo, and Bright." + } + + /// Master drives the power amp harder than the Twin, so 4× oversampling for anti-alias headroom. + public override var powerAmpOversample: Int { 4 } + public override var powerAmpDriveInput: any ValidGeneratorInput { deluxePowerDrive } + + /// Creates a Fullerton Deluxe amp. + /// + /// - Parameters: + /// - inputBus: Audio bus index to read the dry input from. Defaults to `0`. + /// - outputBus: Audio bus index to write the processed output to. Defaults to `0`. + public init(inputBus: Int = 0, outputBus: Int = 0) { + super.init(name: "Fullerton Deluxe", inputBus: inputBus, outputBus: outputBus) + gain = 4.5 // slightly hotter starting point than the Twin + bass = 0.45 // a touch less low end than the 2×12 + cab = 0.0 // American 1×12 + } +} diff --git a/Sources/LyrebirdShoeGaze/Pedals/FullertonPrincetonAmpPedal.swift b/Sources/LyrebirdShoeGaze/Pedals/FullertonPrincetonAmpPedal.swift new file mode 100644 index 0000000..0351f17 --- /dev/null +++ b/Sources/LyrebirdShoeGaze/Pedals/FullertonPrincetonAmpPedal.swift @@ -0,0 +1,41 @@ +// FullertonPrincetonAmpPedal.swift +// Lyrebird +// +// Copyright (c) 2026 Joshua Parmenter / realizedsound +// SPDX-License-Identifier: MIT + +import LyrebirdSynth +import LyrebirdUI + +/// American blackface **1×10 combo** — the smallest, darkest blackface voice, below +/// ``FullertonDeluxeAmpPedal``. +/// +/// Same reverb + tremolo + Bright control surface, but voiced smaller: a darker cabinet, less low +/// end, and the earliest, most compressed breakup of the three — the classic small-studio recording +/// combo. +public final class FullertonPrincetonAmpPedal: FullertonReverbAmpPedal { + + /// Power-amp drive — the highest of the blackface trio, so it breaks up earliest. + private let princetonPowerDrive: Double = 2.6 + + public override var summaryText: String { + "American 1×10 combo — small, dark, early-breakup blackface with reverb, tremolo, and Bright." + } + + /// Driven hardest of the blackface trio, so 4× oversampling for anti-alias headroom. + public override var powerAmpOversample: Int { 4 } + public override var powerAmpDriveInput: any ValidGeneratorInput { princetonPowerDrive } + + /// Creates a Fullerton Princeton amp. + /// + /// - Parameters: + /// - inputBus: Audio bus index to read the dry input from. Defaults to `0`. + /// - outputBus: Audio bus index to write the processed output to. Defaults to `0`. + public init(inputBus: Int = 0, outputBus: Int = 0) { + super.init(name: "Fullerton Princeton", inputBus: inputBus, outputBus: outputBus) + gain = 5.0 // hotter still — the small combo grits up soonest + bass = 0.4 // least low end of the trio + treble = 0.55 // a shade darker + cab = 2.0 // Vintage Dark — the small, dark 1×10 voice + } +} diff --git a/Sources/LyrebirdShoeGaze/Pedals/FullertonReverbAmpPedal.swift b/Sources/LyrebirdShoeGaze/Pedals/FullertonReverbAmpPedal.swift index 579d4ff..65da77d 100644 --- a/Sources/LyrebirdShoeGaze/Pedals/FullertonReverbAmpPedal.swift +++ b/Sources/LyrebirdShoeGaze/Pedals/FullertonReverbAmpPedal.swift @@ -22,7 +22,7 @@ import LyrebirdUI /// A **Reverb** and a **Vibrato** switch model the amp's two-button footswitch: each bypasses its /// effect (dry pass-through) while preserving the knob positions, so a player can stomp the FX in /// and out without losing their settings. -public final class FullertonReverbAmpPedal: AmpVoicePedal { +open class FullertonReverbAmpPedal: AmpVoicePedal { // MARK: - Onboard-effect parameters @@ -83,11 +83,22 @@ public final class FullertonReverbAmpPedal: AmpVoicePedal { /// - Parameters: /// - inputBus: Audio bus index to read the dry input from. Defaults to `0`. /// - outputBus: Audio bus index to write the processed output to. Defaults to `0`. - public init(inputBus: Int = 0, outputBus: Int = 0) { - super.init(name: "Fullerton Reverb", inputBus: inputBus, outputBus: outputBus) + public convenience init(inputBus: Int = 0, outputBus: Int = 0) { + self.init(name: "Fullerton Reverb", inputBus: inputBus, outputBus: outputBus) gain = 4.0 // headroom-rich clean default } + /// Designated init used by the blackface-combo variants (Deluxe / Princeton) to set their own + /// name while inheriting the shared reverb + tremolo + bright control surface. + /// + /// - Parameters: + /// - name: Display name for this amp voice. + /// - inputBus: Audio bus index to read the dry input from. Defaults to `0`. + /// - outputBus: Audio bus index to write the processed output to. Defaults to `0`. + public override init(name: String, inputBus: Int = 0, outputBus: Int = 0) { + super.init(name: name, inputBus: inputBus, outputBus: outputBus) + } + // MARK: - Switches public override var effectSwitches: [PedalSwitch] { diff --git a/Sources/LyrebirdShoeGaze/Presets/PedalRegistry.swift b/Sources/LyrebirdShoeGaze/Presets/PedalRegistry.swift index ad17893..344c8ad 100644 --- a/Sources/LyrebirdShoeGaze/Presets/PedalRegistry.swift +++ b/Sources/LyrebirdShoeGaze/Presets/PedalRegistry.swift @@ -35,6 +35,8 @@ public enum PedalRegistry { "British": { BritishAmpPedal() }, "Chime": { ChimeAmpPedal() }, "Fullerton Reverb": { FullertonReverbAmpPedal() }, + "Fullerton Deluxe": { FullertonDeluxeAmpPedal() }, + "Fullerton Princeton": { FullertonPrincetonAmpPedal() }, "Jazz Clean": { JazzCleanAmpPedal() }, "Chime Top Boost": { ChimeTopBoostAmpPedal() }, "Neural Amp": { NeuralAmpPedal() }, diff --git a/Sources/LyrebirdShoeGazeUI/HelpView.swift b/Sources/LyrebirdShoeGazeUI/HelpView.swift index c529c7d..1cb87c6 100644 --- a/Sources/LyrebirdShoeGazeUI/HelpView.swift +++ b/Sources/LyrebirdShoeGazeUI/HelpView.swift @@ -178,7 +178,7 @@ public struct HelpView: View { + "built-in speaker impulse responses.", "The Cabinet pedal's built-in cab voicings are original impulse responses generated in " + "code — not captures of any third-party hardware or IR pack.", - "The California, British, Chime, Fullerton Reverb, Jazz Clean, and Chime Top Boost amp pedals' tone stacks " + "The California, British, Chime, Fullerton Reverb, Fullerton Deluxe, Fullerton Princeton, Jazz Clean, and Chime Top Boost amp pedals' tone stacks " + "follow the Yeh & Smith analysis of the classic passive tone-stack circuit (\"Discretization " + "of the '59 Fender Bassman Tone Stack\", DAFx-06); their models are original code, not " + "captures of specific hardware.", diff --git a/Sources/LyrebirdShoeGazeUI/PedalCategory.swift b/Sources/LyrebirdShoeGazeUI/PedalCategory.swift index 28f7f12..819e8dc 100644 --- a/Sources/LyrebirdShoeGazeUI/PedalCategory.swift +++ b/Sources/LyrebirdShoeGazeUI/PedalCategory.swift @@ -44,7 +44,7 @@ public enum PedalCategory: String, CaseIterable, Identifiable, Sendable { } private static let mapping: [String: PedalCategory] = [ - "California": .amp, "British": .amp, "Chime": .amp, "Fullerton Reverb": .amp, "Jazz Clean": .amp, "Chime Top Boost": .amp, "Neural Amp": .amp, + "California": .amp, "British": .amp, "Chime": .amp, "Fullerton Reverb": .amp, "Fullerton Deluxe": .amp, "Fullerton Princeton": .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, diff --git a/Sources/LyrebirdShoeGazeUI/PedalPaletteView.swift b/Sources/LyrebirdShoeGazeUI/PedalPaletteView.swift index 6a4aada..b5d9307 100644 --- a/Sources/LyrebirdShoeGazeUI/PedalPaletteView.swift +++ b/Sources/LyrebirdShoeGazeUI/PedalPaletteView.swift @@ -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", "Chime", "Fullerton Reverb", "Jazz Clean", "Chime Top Boost", "Neural Amp", "Overdrive", "Distortion", "Compressor", "Sustainer", "Limiter", "Noise Gate", "Fuzz", + "California", "British", "Chime", "Fullerton Reverb", "Fullerton Deluxe", "Fullerton Princeton", "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", diff --git a/Sources/LyrebirdShoeGazeUI/PedalView.swift b/Sources/LyrebirdShoeGazeUI/PedalView.swift index df5ff69..ae78913 100644 --- a/Sources/LyrebirdShoeGazeUI/PedalView.swift +++ b/Sources/LyrebirdShoeGazeUI/PedalView.swift @@ -21,6 +21,8 @@ private func enclosureColor(for displayName: String) -> Color { case "British": return Color(red: 0.30, green: 0.16, blue: 0.10) // oxblood tolex case "Chime": return Color(red: 0.16, green: 0.24, blue: 0.22) // vintage green 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 "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 diff --git a/Tests/LyrebirdShoeGazeTests/FullertonVariantsTests.swift b/Tests/LyrebirdShoeGazeTests/FullertonVariantsTests.swift new file mode 100644 index 0000000..970febf --- /dev/null +++ b/Tests/LyrebirdShoeGazeTests/FullertonVariantsTests.swift @@ -0,0 +1,127 @@ +// FullertonVariantsTests.swift +// Lyrebird +// +// Copyright (c) 2026 Joshua Parmenter / realizedsound +// SPDX-License-Identifier: MIT + +import Testing +import Foundation +import LyrebirdSynth +import LyrebirdUI +@testable import LyrebirdShoeGaze + +@MainActor +@Suite("Fullerton blackface variants") +struct FullertonVariantsTests { + + private let sampleRate: Double = 48000.0 + + private func render(_ make: () -> P, configure: (P) -> Void = { _ in }) throws -> [Float] { + let (engine, url): (SynthesisEngine, URL) = makeNRTEngine( + duration: 0.3, sampleRate: sampleRate, numAudioBuses: 64) + defer { try? FileManager.default.removeItem(at: url) } + + let srcBus: AudioBus = try engine.busAllocator.allocateAudioBus(channelCount: 1) + let dstBus: AudioBus = try engine.busAllocator.allocateAudioBus(channelCount: 1) + defer { + engine.busAllocator.releaseAudioBus(srcBus) + engine.busAllocator.releaseAudioBus(dstBus) + } + + let source: TestLoopSource = TestLoopSource(targetBus: srcBus.index) + let pedal: P = make() + pedal.inputBus = srcBus.index + pedal.outputBus = dstBus.index + pedal.sampleRate = sampleRate + configure(pedal) + let master: TestRouteMaster = TestRouteMaster(inputBusIndex: dstBus.index) + try engine.add(source) + try engine.add(pedal, position: NodePosition.after(source)) + try engine.add(master, position: NodePosition.after(pedal)) + try engine.start() + return readStereoCAF(url: url, sampleRate: sampleRate) + } + + private func windowedSSD(_ a: [Float], _ b: [Float], skip: Int = 4096, window: Int = 4096) -> Double { + guard a.count >= skip + window, b.count >= skip + window else { return 0.0 } + return zip(a[skip..<(skip + window)], b[skip..<(skip + window)]).reduce(0.0) { acc, pair in + let d: Double = Double(pair.0 - pair.1); return acc + d * d + } + } + + private let variants: [(name: String, make: () -> FullertonReverbAmpPedal)] = [ + ("Fullerton Deluxe", { FullertonDeluxeAmpPedal() }), + ("Fullerton Princeton", { FullertonPrincetonAmpPedal() }), + ] + + @Test func bothBuildNonSilentFinite() throws { + for v in variants { + let s: [Float] = try render(v.make) + #expect(hasNonSilentOutput(s), "\(v.name) produced silence") + #expect(s.allSatisfy { $0.isFinite }, "\(v.name) produced non-finite output") + } + } + + @Test func variantsDifferFromTwinAndEachOther() throws { + // Same knob settings, different voicing (power-amp drive + cab) → different output. + let cfg: (FullertonReverbAmpPedal) -> Void = { $0.gain = 6.0; $0.reverb = 0.3 } + let twin: [Float] = try render({ FullertonReverbAmpPedal() }, configure: cfg) + let deluxe: [Float] = try render({ FullertonDeluxeAmpPedal() }, configure: cfg) + let princeton: [Float] = try render({ FullertonPrincetonAmpPedal() }, configure: cfg) + #expect(windowedSSD(twin, deluxe) > 0, "Deluxe should differ from the Twin") + #expect(windowedSSD(deluxe, princeton) > 0, "Princeton should differ from the Deluxe") + } + + @Test func inheritedReverbAndBrightWork() throws { + // The reverb knob and Bright switch are inherited from the Twin — spot-check on the Deluxe. + let dry: [Float] = try render({ FullertonDeluxeAmpPedal() }) { $0.reverb = 0.0 } + let wet: [Float] = try render({ FullertonDeluxeAmpPedal() }) { $0.reverb = 0.9 } + #expect(windowedSSD(dry, wet) > 0, "inherited reverb had no effect") + let flat: [Float] = try render({ FullertonPrincetonAmpPedal() }) { $0.bright = 0.0 } + let bright: [Float] = try render({ FullertonPrincetonAmpPedal() }) { $0.bright = 1.0 } + #expect(windowedSSD(flat, bright) > 0, "inherited bright switch had no effect") + } + + @Test func stayWithinCeilingAtMaxGain() throws { + let ceilingEpsilon: Double = 1.0e-4 + for v in variants { + let hot: [Float] = try render(v.make) { (pedal: FullertonReverbAmpPedal) in + pedal.gain = 30.0 + pedal.bass = 1.0 + pedal.treble = 1.0 + pedal.reverb = 1.0 + pedal.bright = 1.0 + pedal.intensity = 1.0 + } + let peak: Double = hot.reduce(0.0) { Swift.max($0, abs(Double($1))) } + #expect(peak <= 1.0 + ceilingEpsilon, "\(v.name) peak \(peak) exceeds the ±1 ceiling") + } + } + + @Test func inheritFullControlSurface() throws { + for v in variants { + let pedal: FullertonReverbAmpPedal = v.make() + #expect(pedal.effectKnobs.map { $0.label } + == ["Gain", "Bass", "Mid", "Treble", "Reverb", "Speed", "Intensity"], "\(v.name) knobs") + #expect(pedal.effectSwitches.map { $0.label } == ["Bright", "Reverb FX", "Vibrato"], "\(v.name) switches") + #expect(pedal.effectSelectors.map { $0.label } == ["Cab"], "\(v.name) selectors") + #expect(pedal.widthUnits == 3, "\(v.name) width") + #expect(pedal.toneStackModel == .fender, "\(v.name) tone stack") + #expect(pedal.powerAmpOversample == 4, "\(v.name) should oversample the harder-driven power amp at 4×") + } + } + + @Test func reverbRoundTripsThroughState() throws { + let pedal: FullertonDeluxeAmpPedal = FullertonDeluxeAmpPedal() + pedal.reverb = 0.7 + pedal.cab = 3.0 + let restored: FullertonDeluxeAmpPedal = FullertonDeluxeAmpPedal() + restored.applyState(pedal.captureState()) + #expect(restored.reverb == 0.7 && restored.cab == 3.0, "Deluxe state did not round-trip") + } + + @Test func registeredInBuiltInRegistry() throws { + #expect(PedalRegistry.makePedal(type: "Fullerton Deluxe") is FullertonDeluxeAmpPedal) + #expect(PedalRegistry.makePedal(type: "Fullerton Princeton") is FullertonPrincetonAmpPedal) + } +}