// CaliforniaAmpPedal.swift // Lyrebird // // Copyright (c) 2026 Joshua Parmenter / realizedsound // SPDX-License-Identifier: MIT import LyrebirdSynth import LyrebirdUI /// American-voiced amp (scooped-mid, bright clean) with a **Bright** high-shelf sparkle control. /// /// A ``AmpVoicePedal`` fixed to the American tone stack, defaulting to a lower gain for headroom. public final class CaliforniaAmpPedal: AmpVoicePedal { /// Bright high-shelf amount in [0, 1] → 0…`brightMaxGainDb` of lift above `brightFreqHz`. @UIParam public var bright: Double = 0.3 private let brightFreqHz: Double = 3200.0 private let brightMaxGainDb: Double = 6.0 private let shelfSlope: Double = 1.0 public override var toneStackModel: ToneStackModel { .fender } public override var summaryText: String { "American clean — scooped mids, glassy top, with a Bright sparkle shelf." } public override var signatureKnobs: [PedalKnob] { [PedalKnob(label: "Bright", node: $bright, range: signatureRange)] } /// Creates a California 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: "California", inputBus: inputBus, outputBus: outputBus) gain = 4.0 // clean-leaning default } public override func shapeVoice(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput { let gainDB: LinLin.Audio = LinLin.Audio( $bright, inLo: 0.0, inHi: 1.0, outLo: 0.0, outHi: brightMaxGainDb) return RBJHighShelf.Audio(input: signal, freq: brightFreqHz, gain: gainDB, slope: shelfSlope) } }