fix(amps): Phase 5 review nits — base doc, hoist leadBias, test assert

- BritishComboAmpPedal doc now covers the master-volume subclasses (was
  "non-master only").
- Hoist the duplicated leadBias (0.15) constant into BritishComboAmpPedal;
  British Master / Dual use the inherited one.
- Test: assert British Dual's powerAmpOversample == 4.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 13:54:21 -07:00
parent cda596b9d5
commit 651706126c
4 changed files with 11 additions and 11 deletions
@@ -7,15 +7,15 @@
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`.
/// Shared base for the British (Marshall-voiced) amps — the `.marshall` tone stack plus a common
/// **Presence** lift (post-power-amp high-shelf) and a **Bright** switch (pre-preamp high-shelf).
///
/// 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.
/// The non-master voices (Plexi / JTM / Bluesbreaker) run a fixed power-amp drive — loudness comes
/// from cranking `Gain`; the Bluesbreaker additionally overlays tremolo. The master-volume voices
/// (British Master / British Dual) subclass this too, adding a `Master` (via
/// ``AmpVoicePedal/masterDrive(_:minDrive:maxDrive:)``) and a cascaded lead ``preampStage(_:)``.
///
/// Distinct from ``BritishAmpPedal``, which is the master-volume (JCM-style) crunch voice.
/// Distinct from ``BritishAmpPedal``, the standalone master-volume crunch voice.
open class BritishComboAmpPedal: AmpVoicePedal {
/// Presence amount in [0, 1] → 0…`presenceMaxGainDb` of lift above `presenceFreqHz`.
@@ -31,6 +31,9 @@ open class BritishComboAmpPedal: AmpVoicePedal {
private let brightSlope: Double = 0.7
let switchOffValue: Double = 0.0
let switchOnValue: Double = 1.0
/// Grid bias of a cascaded lead/drive `TriodeStage` — a little asymmetry for even-harmonic
/// grind. Shared by the master-volume subclasses' cascaded ``preampStage(_:)``.
let leadBias: Double = 0.15
public override var toneStackModel: ToneStackModel { .marshall }
public override var signatureKnobs: [PedalKnob] {
@@ -27,8 +27,6 @@ public final class BritishDualAmpPedal: BritishComboAmpPedal {
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.
private let leadBias: Double = 0.15
/// Channel-select threshold: `>= this` selects the Lead channel.
private let channelThreshold: Double = 0.5
private let driveRange: ClosedRange<Double> = 1.0 ... 30.0
@@ -20,8 +20,6 @@ public final class BritishMasterAmpPedal: BritishComboAmpPedal {
private let masterMinDrive: Double = 0.5
private let masterMaxDrive: Double = 5.0
/// Grid bias of the cascaded second preamp stage — a little asymmetry for even-harmonic grind.
private let leadBias: Double = 0.15
public override var summaryText: String {
"British master-volume lead — cascaded 800-series gain with Presence, Master, and Bright."
@@ -142,6 +142,7 @@ struct BritishMasterAmpPedalTests {
#expect(pedal.effectSwitches.map { $0.label } == ["Bright", "Channel"])
#expect(pedal.widthUnits == 4)
#expect(pedal.toneStackModel == .marshall)
#expect(pedal.powerAmpOversample == 4)
}
@Test func dualStaysWithinCeilingOnLeadChannel() throws {