292261a088
Follow-up cleanup now that card width is content-derived. Redefine widthUnits as the card's base width in knob columns (1 = 3-wide, 2 = 4-wide) — both the knob-grid column count and the card's minimum width — with selector/switch rows able to push wider. Values above 2 no longer do anything. - Delete the now-misleading widthUnits 3/4 overrides on 11 amps; they inherit AmpVoicePedal's 2 (all full-surface amps → the same tight 4-wide card). - Remove Mutant's redundant override (2 knobs + 2 switches → 3-wide either way). - Cabinet: keep widthUnits 2 so it's 4-wide like the amps — its Cab/Mic/Mic B selector captions (voice names) need the room to stay readable (per request). - Looper keeps widthUnits 3 (the one pedal still using the flat multiple for its bespoke timeline/knobs/transport layout). - Refresh the widthUnits docs (base + AmpVoicePedal + Cabinet); update the amp tests' widthUnits assertions (3/4 → 2; Looper stays 3). 675 tests pass; no visual change to the amps, Cabinet now matches their width. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
54 lines
2.4 KiB
Swift
54 lines
2.4 KiB
Swift
// BritishMasterAmpPedal.swift
|
||
// Lyrebird
|
||
//
|
||
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
||
// SPDX-License-Identifier: MIT
|
||
|
||
import LyrebirdSynth
|
||
import LyrebirdUI
|
||
|
||
/// British **master-volume lead** — the 800-series single-channel hot-rodded Marshall: a cascaded
|
||
/// two-stage preamp for singing lead gain, a Master volume, Presence, and a Bright switch.
|
||
///
|
||
/// A ``BritishComboAmpPedal`` (Presence + Bright) whose ``preampStage(_:)`` cascades a second gain
|
||
/// stage — both driven by `Gain`, so one knob sets the whole preamp grind — and whose `Master`
|
||
/// drives the power-amp stage (via ``AmpVoicePedal/masterDrive(_:minDrive:maxDrive:)``).
|
||
public final class BritishMasterAmpPedal: BritishComboAmpPedal {
|
||
|
||
/// Master volume in [0, 1] → power-amp drive in [`masterMinDrive`, `masterMaxDrive`].
|
||
@UIParam public var master: Double = 0.5
|
||
|
||
private let masterMinDrive: Double = 0.5
|
||
private let masterMaxDrive: Double = 5.0
|
||
|
||
public override var summaryText: String {
|
||
"British master-volume lead — cascaded 800-series gain with Presence, Master, and Bright."
|
||
}
|
||
public override var signatureKnobs: [PedalKnob] {
|
||
super.signatureKnobs + [PedalKnob(label: "Master", node: $master, range: signatureRange)]
|
||
}
|
||
|
||
/// 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 }
|
||
|
||
/// Creates a British Master 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 Master", inputBus: inputBus, outputBus: outputBus)
|
||
gain = 5.73 // cascaded, so already a hot lead at moderate Gain
|
||
cab = 1.0 // British 4×12
|
||
}
|
||
|
||
/// Cascaded two-stage preamp: the base stage, then a second `TriodeStage` also driven by `Gain`.
|
||
public override func preampStage(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput {
|
||
let stage1: any ValidGeneratorInput = super.preampStage(signal)
|
||
return TriodeStage(input: stage1, drive: taperedDrive($gain), bias: leadBias, oversample: preampOversample)
|
||
}
|
||
}
|