// BritishAmpPedal.swift // Lyrebird // // Copyright (c) 2026 Joshua Parmenter / realizedsound // SPDX-License-Identifier: MIT import LyrebirdSynth import LyrebirdUI /// British-voiced amp (mid-forward crunch) with a **Presence** upper-high lift control. /// /// A ``AmpVoicePedal`` fixed to the British tone stack, defaulting to a higher gain for crunch. public final class BritishAmpPedal: AmpVoicePedal { /// Presence amount in [0, 1] → 0…`presenceMaxGainDb` of lift above `presenceFreqHz`. @UIParam public var presence: Double = 0.4 private let presenceFreqHz: Double = 4500.0 private let presenceMaxGainDb: Double = 8.0 private let shelfSlope: Double = 0.7 public override var toneStackModel: ToneStackModel { .marshall } public override var summaryText: String { "British crunch — forward mids and bite, with a Presence lift." } public override var signatureKnobs: [PedalKnob] { [PedalKnob(label: "Presence", node: $presence, range: signatureRange)] } /// Creates a British 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", inputBus: inputBus, outputBus: outputBus) gain = 10.0 // crunch-leaning default cab = 1.0 // default to the British 4×12 cab } public override func shapeVoice(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput { let gainDB: LinLin.Audio = LinLin.Audio( $presence, inLo: 0.0, inHi: 1.0, outLo: 0.0, outHi: presenceMaxGainDb) return RBJHighShelf.Audio(input: signal, freq: presenceFreqHz, gain: gainDB, slope: shelfSlope) } }