// SixtiesComboAmpPedal.swift // Lyrebird // // Copyright (c) 2026 Joshua Parmenter / realizedsound // SPDX-License-Identifier: MIT import LyrebirdSynth import LyrebirdUI /// American **'60s grit combo** — the small Supro/Silvertone-style amp: low headroom, gritty early /// breakup, and an onboard **tremolo**. /// /// A ``AmpVoicePedal`` (`.fender`) driven hard into the power stage for early breakup, with a /// tremolo (Speed / Intensity + footswitch) in the onboard-effects slot. public final class SixtiesComboAmpPedal: AmpVoicePedal { /// Tremolo LFO rate in Hz. Range [0.5, 12]. @UIParam public var speed: Double = 5.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 /// Power-amp drive — well above the default fixed value so the small combo grits up early. private let grittyPowerDrive: Double = 2.4 private let speedRange: ClosedRange = 0.5 ... 12.0 private let intensityRange: ClosedRange = 0.0 ... 1.0 public override var toneStackModel: ToneStackModel { .fender } public override var summaryText: String { "American '60s grit combo — early-breakup with onboard tremolo." } public override var signatureKnobs: [PedalKnob] { [ PedalKnob(label: "Speed", node: $speed, range: speedRange), PedalKnob(label: "Intensity", node: $intensity, range: intensityRange), ] } public override var effectSwitches: [PedalSwitch] { [ PedalSwitch( label: "Tremolo", node: $tremoloEnabled, options: [ PedalSwitch.Option(title: "Off", value: switchOffValue), PedalSwitch.Option(title: "On", value: switchOnValue), ] ), ] } /// Driven hard into the power stage, so 4× oversampling for anti-alias headroom. public override var powerAmpOversample: Int { 4 } public override var powerAmpDriveInput: any ValidGeneratorInput { grittyPowerDrive } /// Wider card for the tremolo knobs plus the Tremolo switch. public override var widthUnits: Int { 3 } /// Creates a Sixties Combo 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: "Sixties Combo", inputBus: inputBus, outputBus: outputBus) gain = 6.72 // gritty starting point cab = 2.0 // Vintage Dark — small, dark } /// Onboard tremolo (gated by the Tremolo footswitch), inserted after the tone stack. public override func onboardEffects(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput { tremolo(signal, speed: $speed, depth: $intensity, enabled: $tremoloEnabled) } }