feat(amps): boutique high-gain — Boutique Lead / OD (Phase 6)

Add a shared BoutiqueAmpPedal base: a rebuildsOnChange Clean/Lead channel switch
(Lead cascades a stage set by Drive), a Master (via masterDrive), and Presence
(top-end high-shelf) + Depth (low-end low-shelf, RBJLowShelf) power-amp shaping;
widthUnits 4, 4× power-amp oversample.

- Boutique Lead — SLO-style aggressive super-lead (.marshall, hot Lead drive).
- Boutique OD — D-style smooth overdrive (.fender) with a Mid Boost switch
  (RBJPeakingEQ peak scaled by the switch, identity when off) layered on the base
  Presence/Depth shaping.

Registered across 6 sites as .amp. 10 tests (channel switch + rebuildsOnChange,
presence/depth, master drives power amp via RMS-normalized SSD, drive, ceiling on
lead channel, control surfaces, OD mid boost, round-trip, registry).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 14:10:14 -07:00
parent 651706126c
commit 9c0f89bae6
9 changed files with 367 additions and 2 deletions
+2
View File
@@ -51,6 +51,8 @@ public extension PedalType {
static let britishBluesbreaker = PedalType("British Bluesbreaker")
static let britishMaster = PedalType("British Master")
static let britishDual = PedalType("British Dual")
static let boutiqueLead = PedalType("Boutique Lead")
static let boutiqueOD = PedalType("Boutique OD")
static let chime = PedalType("Chime")
static let chimeFifteen = PedalType("Chime 15")
static let chimeNormal = PedalType("Chime Normal")
@@ -0,0 +1,100 @@
// BoutiqueAmpPedal.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
import LyrebirdSynth
import LyrebirdUI
/// Shared base for the boutique high-gain amps (Boutique Lead / Boutique OD) — a footswitchable
/// Clean/Lead channel into a master-volume power section, with **Presence** (top-end) and **Depth**
/// (low-end resonance) shaping.
///
/// The Lead channel cascades a second gain stage (set by `Drive`) via ``preampStage(_:)`` — a
/// `rebuildsOnChange` **Channel** switch, so only the selected channel is built. `Master` drives the
/// power-amp stage via ``AmpVoicePedal/masterDrive(_:minDrive:maxDrive:)``. Concrete voices override
/// ``AmpVoicePedal/toneStackModel`` and gain defaults, and may extend the shaping (e.g. a mid boost).
open class BoutiqueAmpPedal: AmpVoicePedal {
/// Presence amount in [0, 1] → 0…`presenceMaxGainDb` of top-end lift.
@UIParam public var presence: Double = 0.4
/// Depth amount in [0, 1] → 0…`depthMaxGainDb` of low-end resonance lift.
@UIParam public var depth: Double = 0.3
/// Master volume in [0, 1] → power-amp drive in [`masterMinDrive`, `masterMaxDrive`].
@UIParam public var master: Double = 0.5
/// Lead-channel preamp gain (the cascaded stage). Range [1, 30].
@UIParam public var drive: Double = 10.0
/// Channel select: `0` = Clean, `1` = Lead (the cascaded gain stage).
@UIParam public var channel: Double = 0.0
private let presenceFreqHz: Double = 4500.0
private let presenceMaxGainDb: Double = 8.0
private let presenceSlope: Double = 0.7
private let depthFreqHz: Double = 120.0
private let depthMaxGainDb: Double = 6.0
private let depthSlope: Double = 0.7
private let masterMinDrive: Double = 0.5
private let masterMaxDrive: Double = 5.0
/// Grid bias of the cascaded lead stage — a little asymmetry for even-harmonic grind.
let leadBias: Double = 0.15
private let channelThreshold: Double = 0.5
let signatureAmount: ClosedRange<Double> = 0.0 ... 1.0
private let driveRange: ClosedRange<Double> = 1.0 ... 30.0
let switchOffValue: Double = 0.0
let switchOnValue: Double = 1.0
public override var toneStackModel: ToneStackModel { .marshall }
public override var signatureKnobs: [PedalKnob] {
[
PedalKnob(label: "Presence", node: $presence, range: signatureAmount),
PedalKnob(label: "Depth", node: $depth, range: signatureAmount),
PedalKnob(label: "Master", node: $master, range: signatureAmount),
PedalKnob(label: "Drive", node: $drive, range: driveRange),
]
}
public override var effectSwitches: [PedalSwitch] {
[
PedalSwitch(
label: "Channel",
node: $channel,
options: [
PedalSwitch.Option(title: "Clean", value: switchOffValue),
PedalSwitch.Option(title: "Lead", value: switchOnValue),
],
rebuildsOnChange: true
),
]
}
/// Master drives the power-amp stage. 4× oversampling since it can be driven hard.
public override var powerAmpDriveInput: any ValidGeneratorInput {
masterDrive($master, minDrive: masterMinDrive, maxDrive: masterMaxDrive)
}
public override var powerAmpOversample: Int { 4 }
/// Wider card for the Presence/Depth/Master/Drive knobs plus the Channel switch.
public override var widthUnits: Int { 4 }
/// Clean preamp, plus a cascaded lead stage on the Lead channel. `channel` is read at
/// board-build time (the switch is `rebuildsOnChange`), so only the selected channel is built.
public override func preampStage(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput {
let clean: any ValidGeneratorInput = super.preampStage(signal)
guard channel >= channelThreshold else { return clean }
return TriodeStage(input: clean, drive: $drive, bias: leadBias, oversample: preampOversample)
}
/// Presence (top-end high-shelf) then Depth (low-end low-shelf), post power amp.
public override func shapeVoice(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput {
let presenceGainDb: LinLin.Audio = LinLin.Audio(
$presence, inLo: 0.0, inHi: 1.0, outLo: 0.0, outHi: presenceMaxGainDb)
let presenced: RBJHighShelf.Audio = RBJHighShelf.Audio(
input: signal, freq: presenceFreqHz, gain: presenceGainDb, slope: presenceSlope)
let depthGainDb: LinLin.Audio = LinLin.Audio(
$depth, inLo: 0.0, inHi: 1.0, outLo: 0.0, outHi: depthMaxGainDb)
return RBJLowShelf.Audio(
input: presenced, freq: depthFreqHz, gain: depthGainDb, slope: depthSlope)
}
}
@@ -0,0 +1,32 @@
// BoutiqueLeadAmpPedal.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
import LyrebirdSynth
import LyrebirdUI
/// Boutique **super-lead** — the SLO-style high-gain singing lead: aggressive cascaded overdrive on
/// the Lead channel, a Master volume, and Presence / Depth power-amp shaping.
///
/// A ``BoutiqueAmpPedal`` fixed to the aggressive British tone stack, defaulting to a hot Lead drive.
public final class BoutiqueLeadAmpPedal: BoutiqueAmpPedal {
public override var toneStackModel: ToneStackModel { .marshall }
public override var summaryText: String {
"Boutique super-lead — aggressive cascaded high gain with Master, Presence, and Depth."
}
/// Creates a Boutique Lead 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: "Boutique Lead", inputBus: inputBus, outputBus: outputBus)
gain = 6.0
drive = 14.0 // hot singing lead
cab = 1.0 // British 4×12
}
}
@@ -0,0 +1,62 @@
// BoutiqueODAmpPedal.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
import LyrebirdSynth
import LyrebirdUI
/// Boutique **overdrive special** — the smooth D-style voice: a Fender-derived clean plus a fluid
/// overdrive channel, a **Mid Boost** switch, a Master volume, and Presence / Depth shaping.
///
/// A ``BoutiqueAmpPedal`` on the smoother American tone stack. The Mid Boost adds a midrange peak
/// (the D-style "PAB" character) on top of the base Presence/Depth shaping.
public final class BoutiqueODAmpPedal: BoutiqueAmpPedal {
/// Mid Boost switch: `0` = flat, `1` = midrange peak engaged.
@UIParam public var midBoost: Double = 0.0
private let midBoostFreqHz: Double = 650.0
private let midBoostMaxGainDb: Double = 6.0
private let midBoostQ: Double = 1.0
public override var toneStackModel: ToneStackModel { .fender }
public override var summaryText: String {
"Boutique overdrive special — smooth D-style OD with a Mid Boost, Master, Presence, and Depth."
}
/// Base Channel switch plus the Mid Boost switch (compose `super`).
public override var effectSwitches: [PedalSwitch] {
super.effectSwitches + [
PedalSwitch(
label: "Mid Boost",
node: $midBoost,
options: [
PedalSwitch.Option(title: "Off", value: switchOffValue),
PedalSwitch.Option(title: "On", value: switchOnValue),
]
),
]
}
/// Creates a Boutique OD 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: "Boutique OD", inputBus: inputBus, outputBus: outputBus)
gain = 5.0
drive = 10.0
cab = 0.0 // American 1×12
}
/// The base Presence/Depth shaping, plus a Mid Boost peak when the switch is engaged (its gain
/// scales by the switch value, so Off is a true identity, live, no rebuild).
public override func shapeVoice(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput {
let shaped: any ValidGeneratorInput = super.shapeVoice(signal)
let midGainDb: any ValidGeneratorInput = $midBoost * midBoostMaxGainDb
return RBJPeakingEQ.Audio(input: shaped, freq: midBoostFreqHz, gain: midGainDb, q: midBoostQ)
}
}
@@ -38,6 +38,8 @@ public enum PedalRegistry {
"British Bluesbreaker": { BritishBluesbreakerAmpPedal() },
"British Master": { BritishMasterAmpPedal() },
"British Dual": { BritishDualAmpPedal() },
"Boutique Lead": { BoutiqueLeadAmpPedal() },
"Boutique OD": { BoutiqueODAmpPedal() },
"Chime": { ChimeAmpPedal() },
"Chime 15": { ChimeFifteenAmpPedal() },
"Chime Normal": { ChimeNormalAmpPedal() },