// BritishBluesbreakerAmpPedal.swift // Lyrebird // // Copyright (c) 2026 Joshua Parmenter / realizedsound // SPDX-License-Identifier: MIT import LyrebirdSynth import LyrebirdUI /// British non-master **2×12 combo** with onboard **tremolo** — the bluesbreaker voice: lower-power /// Marshall crunch that cleans up with the guitar volume, plus a bias-tremolo. /// /// A ``BritishComboAmpPedal`` (Presence + Bright) that overlays a tremolo in the onboard-effects /// slot, with Speed / Intensity knobs and a Tremolo footswitch. public final class BritishBluesbreakerAmpPedal: BritishComboAmpPedal { /// Tremolo LFO rate in Hz. Range [0.5, 12]. @UIParam public var speed: Double = 4.0 /// Tremolo depth in [0, 1]. `0` = off, `1` = full swing. @UIParam public var intensity: Double = 0.0 /// Tremolo footswitch: `1` = engaged, `0` = bypassed (`Speed`/`Intensity` preserved). @UIParam public var tremoloEnabled: Double = 1.0 private let speedRange: ClosedRange = 0.5 ... 12.0 private let intensityRange: ClosedRange = 0.0 ... 1.0 public override var summaryText: String { "British 2×12 combo — bluesbreaker crunch with tremolo, Presence, and a Bright switch." } public override var signatureKnobs: [PedalKnob] { [ PedalKnob(label: "Presence", node: $presence, range: signatureRange), PedalKnob(label: "Speed", node: $speed, range: speedRange), PedalKnob(label: "Intensity", node: $intensity, range: intensityRange), ] } /// The base Bright switch plus a Tremolo footswitch (compose `super` so Bright stays in sync). public override var effectSwitches: [PedalSwitch] { super.effectSwitches + [ PedalSwitch( label: "Tremolo", node: $tremoloEnabled, options: [ PedalSwitch.Option(title: "Off", value: switchOffValue), PedalSwitch.Option(title: "On", value: switchOnValue), ] ), ] } /// Creates a British Bluesbreaker 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: "British Bluesbreaker", inputBus: inputBus, outputBus: outputBus) gain = 6.27 cab = 1.0 // British 4×12 voice (combo 2×12 tonally close enough among our cabs) } /// Tremolo (gated by the Tremolo footswitch), inserted after the tone stack. public override func onboardEffects(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput { // Identity when depth·enabled == 0. tremolo(signal, speed: $speed, depth: $intensity, enabled: $tremoloEnabled) } }