feat(amps): Marshall non-master voices — Plexi / JTM / Bluesbreaker (Phase 2)

Add a shared non-master British base and three voices. BritishComboAmpPedal
(open) provides the common surface: .marshall tone stack, Presence lift
(post-power-amp shelf), Bright switch (pre-preamp shelf), fixed power-amp drive
(loudness from Gain, no Master — distinct from the master-volume BritishAmpPedal).

- British Plexi — non-master Super Lead, higher gain, 4×12.
- British JTM — warmer, lower-gain JTM crunch, darker top.
- British Bluesbreaker — 2×12 combo crunch + onboard tremolo (Speed/Intensity +
  Tremolo footswitch), widthUnits 3.

Registered across all 6 sites as .amp; Help tone-stack acknowledgment genericized
so it no longer needs editing per amp. 12 tests (Presence/Bright per voice,
non-master check, Plexi/JTM surface, voices differ, Bluesbreaker tremolo +
footswitch bit-exact bypass, ceiling, round-trip, registry).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 12:10:06 -07:00
parent 690030a4c5
commit 4de8379cb8
11 changed files with 388 additions and 3 deletions
+3
View File
@@ -46,6 +46,9 @@ public extension PedalType {
// Drive & dynamics
static let california = PedalType("California")
static let british = PedalType("British")
static let britishPlexi = PedalType("British Plexi")
static let britishJTM = PedalType("British JTM")
static let britishBluesbreaker = PedalType("British Bluesbreaker")
static let chime = PedalType("Chime")
static let fullertonReverb = PedalType("Fullerton Reverb")
static let fullertonDeluxe = PedalType("Fullerton Deluxe")
@@ -0,0 +1,87 @@
// 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
/// Tremolo depth scaling — at full `intensity` the LFO swings over half the normalised range so
/// the peak gain is 1.0 and the trough is `1 − intensity`.
private let tremoloDepthScale: Double = 0.5
private let speedRange: ClosedRange<Double> = 0.5 ... 12.0
private let intensityRange: ClosedRange<Double> = 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),
]
}
/// Wider card for the extra tremolo knobs plus the Bright and Tremolo switches.
public override var widthUnits: Int { 3 }
public override var effectSwitches: [PedalSwitch] {
[
PedalSwitch(
label: "Bright",
node: $bright,
options: [
PedalSwitch.Option(title: "Off", value: switchOffValue),
PedalSwitch.Option(title: "On", value: switchOnValue),
]
),
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.0
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 {
// Footswitch gates depth to 0 → LFO is a constant 1.0 (identity). Unipolar sine over
// [1 − depth, 1]: peak gain 1.0, trough 1 − depth.
let depth: any ValidGeneratorInput = $intensity * $tremoloEnabled
let lfoScale: any ValidGeneratorInput = depth * tremoloDepthScale
let lfoOffset: any ValidGeneratorInput = 1.0 - (depth * tremoloDepthScale)
let lfo: OscSin.Audio = OscSin.Audio(freq: $speed, mul: lfoScale, add: lfoOffset)
return signal * lfo
}
}
@@ -0,0 +1,66 @@
// BritishComboAmpPedal.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
import LyrebirdSynth
import LyrebirdUI
/// Shared base for the **non-master** British voices (Plexi / JTM / Bluesbreaker) — the earlier
/// Marshalls with no master volume, so the power-amp stage runs at a fixed drive and loudness comes
/// from cranking `Gain`.
///
/// Provides the common British control surface: the `.marshall` tone stack, a **Presence** lift
/// (post-power-amp high-shelf) and a **Bright** switch (pre-preamp high-shelf). Concrete voices
/// subclass this and differ by gain/cab/headroom; the Bluesbreaker additionally overlays tremolo.
///
/// Distinct from ``BritishAmpPedal``, which is the master-volume (JCM-style) crunch voice.
open class BritishComboAmpPedal: AmpVoicePedal {
/// Presence amount in [0, 1] → 0…`presenceMaxGainDb` of lift above `presenceFreqHz`.
@UIParam public var presence: Double = 0.4
/// Bright switch: `0` = flat, `1` = treble shelf engaged.
@UIParam public var bright: Double = 0.0
private let presenceFreqHz: Double = 4500.0
private let presenceMaxGainDb: Double = 8.0
private let presenceSlope: Double = 0.7
private let brightFreqHz: Double = 3500.0
private let brightMaxGainDb: Double = 6.0
private let brightSlope: Double = 0.7
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: signatureRange)]
}
public override var effectSwitches: [PedalSwitch] {
[
PedalSwitch(
label: "Bright",
node: $bright,
options: [
PedalSwitch.Option(title: "Off", value: switchOffValue),
PedalSwitch.Option(title: "On", value: switchOnValue),
]
),
]
}
/// Bright switch: a high-shelf lift ahead of the preamp (identity when off, live, no rebuild).
public override func inputShaping(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput {
let shelfGainDb: any ValidGeneratorInput = $bright * brightMaxGainDb
return RBJHighShelf.Audio(
input: signal, freq: brightFreqHz, gain: shelfGainDb, slope: brightSlope)
}
/// Presence: a post-power-amp high-shelf lift, `[0, 1]` → `[0, presenceMaxGainDb]` dB.
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: presenceSlope)
}
}
@@ -0,0 +1,31 @@
// BritishJTMAmpPedal.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
import LyrebirdSynth
import LyrebirdUI
/// British non-master **JTM** — the earliest Marshall, Bassman-derived: warmer and lower-gain than
/// the plexi Super Lead, a rounder blues-rock crunch.
///
/// A ``BritishComboAmpPedal`` with lower gain and a slightly darker top end.
public final class BritishJTMAmpPedal: BritishComboAmpPedal {
public override var summaryText: String {
"British non-master combo — warm, lower-gain JTM crunch with Presence and Bright."
}
/// Creates a British JTM 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 JTM", inputBus: inputBus, outputBus: outputBus)
gain = 5.0 // warmer, lower-gain than the plexi
treble = 0.5 // a shade rounder on top
cab = 1.0 // British 4×12
}
}
@@ -0,0 +1,31 @@
// BritishPlexiAmpPedal.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
import LyrebirdSynth
import LyrebirdUI
/// British non-master **Super Lead** — the classic plexi-panel stack: big, loud, no master volume,
/// clean-ish until cranked and then a singing midrange roar.
///
/// A ``BritishComboAmpPedal`` with higher gain and the 4×12 cab. Presence + Bright; loudness and
/// breakup both come from `Gain`.
public final class BritishPlexiAmpPedal: BritishComboAmpPedal {
public override var summaryText: String {
"British non-master stack — plexi roar with Presence and a Bright switch."
}
/// Creates a British Plexi 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 Plexi", inputBus: inputBus, outputBus: outputBus)
gain = 7.0 // clean-ish until pushed
cab = 1.0 // British 4×12
}
}
@@ -33,6 +33,9 @@ public enum PedalRegistry {
public static let builtIn: [String: @MainActor () -> Pedal] = [
"California": { CaliforniaAmpPedal() },
"British": { BritishAmpPedal() },
"British Plexi": { BritishPlexiAmpPedal() },
"British JTM": { BritishJTMAmpPedal() },
"British Bluesbreaker": { BritishBluesbreakerAmpPedal() },
"Chime": { ChimeAmpPedal() },
"Fullerton Reverb": { FullertonReverbAmpPedal() },
"Fullerton Deluxe": { FullertonDeluxeAmpPedal() },