feat(amps): master-volume enabler + Master knob on British

Add powerAmpDriveInput hook to AmpVoicePedal: an overridable drive into the
power-amp TriodeStage, defaulting to the fixed powerAmpDrive so the five existing
amps are byte-for-byte unchanged. A master-volume amp overrides it with a live
knob mapped to a drive range — so Master pushes the power-amp stage into
saturation (real master-volume behaviour), unlike `level`, which only attenuates
the finished output post-cab/post-limiter.

British gains a Master knob (LinLin [0,1] → power-amp drive [0.5, 5.0]): crank
Gain for preamp grind, set Master for power-amp saturation. signatureKnobs now
[Presence, Master]. Other current amps are non-master (Fender blackface, Vox,
JC) and keep the fixed drive.

Tests: Master changes the power-amp tone (not just level), round-trips through
state; British control-surface updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 09:53:03 -07:00
parent 9588d77137
commit b9a63eeaf5
3 changed files with 48 additions and 6 deletions
@@ -127,6 +127,24 @@ struct AmpVoicePedalTests {
#expect(windowedSSD(flat, lifted) > 0, "British Presence had no effect")
}
@Test func britishMasterDrivesPowerAmp() throws {
// Master drives the power-amp stage, so at fixed preamp Gain a low vs high Master must
// change the tone (power-amp saturation), not merely the level — verify the waveform differs
// after normalizing out any overall level change.
let low: [Float] = try render({ BritishAmpPedal() }) { $0.gain = 12.0; $0.master = 0.1 }
let high: [Float] = try render({ BritishAmpPedal() }) { $0.gain = 12.0; $0.master = 1.0 }
#expect(hasNonSilentOutput(low) && hasNonSilentOutput(high))
#expect(windowedSSD(low, high) > 0, "Master had no effect on the power-amp stage")
}
@Test func britishMasterRoundTripsThroughState() throws {
let pedal: BritishAmpPedal = BritishAmpPedal()
pedal.master = 0.8
let restored: BritishAmpPedal = BritishAmpPedal()
restored.applyState(pedal.captureState())
#expect(restored.master == 0.8, "Master did not round-trip")
}
@Test func chimeCutChangesOutput() throws {
let open: [Float] = try render({ ChimeAmpPedal() }) { $0.cut = 0.0 }
let dark: [Float] = try render({ ChimeAmpPedal() }) { $0.cut = 1.0 }
@@ -137,7 +155,7 @@ struct AmpVoicePedalTests {
@Test func exposesControls() throws {
#expect(CaliforniaAmpPedal().effectKnobs.map { $0.label } == ["Gain", "Bass", "Mid", "Treble", "Bright"])
#expect(BritishAmpPedal().effectKnobs.map { $0.label } == ["Gain", "Bass", "Mid", "Treble", "Presence"])
#expect(BritishAmpPedal().effectKnobs.map { $0.label } == ["Gain", "Bass", "Mid", "Treble", "Presence", "Master"])
#expect(ChimeAmpPedal().effectKnobs.map { $0.label } == ["Gain", "Bass", "Mid", "Treble", "Cut"])
for voice in voices {
let pedal: AmpVoicePedal = voice.make()