refactor(amps): hoist shared switch/leadBias constants to AmpVoicePedal
switchOffValue (0.0) / switchOnValue (1.0) were re-declared in six amp files and leadBias (0.15) in two. Hoist all three onto AmpVoicePedal as internal `let`s so every subclass inherits them; remove the per-file duplicates. Pure refactor — no behavior change; 610 tests stay green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -160,6 +160,12 @@ open class AmpVoicePedal: Pedal {
|
||||
private let preampBias: Double = 0.2
|
||||
/// Oversampling factor for the preamp stage (4× — the preamp can be driven hard by `Gain`).
|
||||
let preampOversample: Int = 4
|
||||
/// Grid bias of a cascaded lead/drive `TriodeStage` — a little asymmetry for even-harmonic
|
||||
/// grind. Shared by the channel/master amps' cascaded ``preampStage(_:)`` overrides.
|
||||
let leadBias: Double = 0.15
|
||||
/// Generic `PedalSwitch` off / on values, shared by every amp that publishes switches.
|
||||
let switchOffValue: Double = 0.0
|
||||
let switchOnValue: Double = 1.0
|
||||
/// Fixed power-amp stage drive/bias (gentler than the preamp).
|
||||
private let powerAmpDrive: Double = 1.5
|
||||
private let powerAmpBias: Double = 0.0
|
||||
|
||||
@@ -36,13 +36,9 @@ open class BoutiqueAmpPedal: AmpVoicePedal {
|
||||
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.
|
||||
private let leadBias: Double = 0.15
|
||||
private let channelThreshold: Double = 0.5
|
||||
|
||||
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] {
|
||||
|
||||
@@ -29,11 +29,6 @@ open class BritishComboAmpPedal: AmpVoicePedal {
|
||||
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
|
||||
/// 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] {
|
||||
|
||||
@@ -50,8 +50,6 @@ public final class ChimeTopBoostAmpPedal: AmpVoicePedal {
|
||||
private let cutRange: ClosedRange<Double> = 0.0 ... 1.0
|
||||
private let speedRange: ClosedRange<Double> = 0.5 ... 12.0
|
||||
private let intensityRange: ClosedRange<Double> = 0.0 ... 1.0
|
||||
private let switchOffValue: Double = 0.0
|
||||
private let switchOnValue: Double = 1.0
|
||||
|
||||
// MARK: - Voice configuration
|
||||
|
||||
|
||||
@@ -36,8 +36,6 @@ public final class FullertonDriveAmpPedal: AmpVoicePedal {
|
||||
|
||||
private let reverbRange: ClosedRange<Double> = 0.0 ... 1.0
|
||||
private let driveRange: ClosedRange<Double> = 1.0 ... 30.0
|
||||
private let switchOffValue: Double = 0.0
|
||||
private let switchOnValue: Double = 1.0
|
||||
|
||||
public override var toneStackModel: ToneStackModel { .fender }
|
||||
public override var summaryText: String {
|
||||
|
||||
@@ -53,8 +53,6 @@ open class FullertonReverbAmpPedal: AmpVoicePedal {
|
||||
private let reverbRange: ClosedRange<Double> = 0.0 ... 1.0
|
||||
private let speedRange: ClosedRange<Double> = 0.5 ... 12.0
|
||||
private let intensityRange: ClosedRange<Double> = 0.0 ... 1.0
|
||||
private let switchOffValue: Double = 0.0
|
||||
private let switchOnValue: Double = 1.0
|
||||
|
||||
// MARK: - Voice configuration
|
||||
|
||||
|
||||
@@ -63,8 +63,6 @@ public final class JazzCleanAmpPedal: AmpVoicePedal {
|
||||
private let chorusRateRange: ClosedRange<Double> = 0.1 ... 5.0
|
||||
private let chorusDepthRange: ClosedRange<Double> = 0.0005 ... 0.015
|
||||
private let driveRange: ClosedRange<Double> = 1.0 ... 30.0
|
||||
private let switchOffValue: Double = 0.0
|
||||
private let switchOnValue: Double = 1.0
|
||||
|
||||
// MARK: - Voice configuration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user