fix(amps): master review follow-ups — tone-proving test, headroom, default
- britishMasterDrivesPowerAmp now uses an RMS-normalized SSD so it proves Master changes the *waveshape* (power-amp saturation), not merely level — a raw SSD couldn't distinguish the two, and distinguishing them is the whole point vs `level`. - Add powerAmpOversample hook (default 2); British overrides to 4 so the higher Master drive (up to 5.0 vs the fixed 1.5) has anti-alias headroom. - British Master default 0.3 → 0.22 so it maps to ≈1.5 drive, keeping the amp's out-of-box tone unchanged. - Add a max-Master (gain 30 + Master 1.0) ceiling test; DocC no longer links the private powerAmpDrive symbol. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -85,13 +85,19 @@ open class AmpVoicePedal: Pedal {
|
||||
signal
|
||||
}
|
||||
|
||||
/// Drive into the power-amp `TriodeStage`. Defaults to the fixed ``powerAmpDrive``; a
|
||||
/// Drive into the power-amp `TriodeStage`. Defaults to the fixed power-amp drive; a
|
||||
/// master-volume amp overrides this to return a live `Master` knob mapped to a drive range, so
|
||||
/// turning Master up pushes the power-amp stage into saturation — the real master-volume
|
||||
/// behaviour — rather than merely attenuating the finished output the way `level` does. Non-
|
||||
/// master amps leave it at the fixed value and are unaffected.
|
||||
open var powerAmpDriveInput: any ValidGeneratorInput { powerAmpDrive }
|
||||
|
||||
/// Oversampling factor for the power-amp stage — `2` or `4`. Amps that drive the power amp hard
|
||||
/// (a `Master` control) override to `4` for more anti-alias headroom, since higher drive
|
||||
/// generates more high-order harmonics. Defaults to `2` (ample for the lightly-driven fixed
|
||||
/// power stage of the non-master amps).
|
||||
open var powerAmpOversample: Int { 2 }
|
||||
|
||||
// MARK: - Constants
|
||||
|
||||
private static let defaultMix: Double = 1.0
|
||||
@@ -208,7 +214,7 @@ open class AmpVoicePedal: Pedal {
|
||||
input: preamp, bass: $bass, mid: $mid, treble: $treble, model: toneStackModel)
|
||||
let processed: any ValidGeneratorInput = onboardEffects(toned)
|
||||
let powerAmp: TriodeStage = TriodeStage(
|
||||
input: processed, drive: powerAmpDriveInput, bias: powerAmpBias, oversample: 2)
|
||||
input: processed, drive: powerAmpDriveInput, bias: powerAmpBias, oversample: powerAmpOversample)
|
||||
return shapeVoice(powerAmp)
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,10 @@ public final class BritishAmpPedal: AmpVoicePedal {
|
||||
|
||||
/// Presence amount in [0, 1] → 0…`presenceMaxGainDb` of lift above `presenceFreqHz`.
|
||||
@UIParam public var presence: Double = 0.4
|
||||
/// Master volume in [0, 1] → power-amp drive in [`masterMinDrive`, `masterMaxDrive`].
|
||||
@UIParam public var master: Double = 0.3
|
||||
/// Master volume in [0, 1] → power-amp drive in [`masterMinDrive`, `masterMaxDrive`]. The
|
||||
/// default maps to ≈1.5 drive — the amp's prior fixed power-amp drive — so the out-of-box tone
|
||||
/// is unchanged; turn it up for power-amp saturation.
|
||||
@UIParam public var master: Double = 0.22
|
||||
|
||||
private let presenceFreqHz: Double = 4500.0
|
||||
private let presenceMaxGainDb: Double = 8.0
|
||||
@@ -44,6 +46,10 @@ public final class BritishAmpPedal: AmpVoicePedal {
|
||||
LinLin.Audio($master, inLo: 0.0, inHi: 1.0, outLo: masterMinDrive, outHi: masterMaxDrive)
|
||||
}
|
||||
|
||||
/// 4× oversampling on the power-amp stage — Master can drive it well past the fixed value used
|
||||
/// by the non-master amps, so the extra anti-alias headroom keeps the added harmonics clean.
|
||||
public override var powerAmpOversample: Int { 4 }
|
||||
|
||||
/// Creates a British amp.
|
||||
///
|
||||
/// - Parameters:
|
||||
|
||||
Reference in New Issue
Block a user