feat(amp): Gain/Drive become a 1–11 dial with a musical taper
Every amp's Gain (and the boutique/drive-channel Drive) is now a 1–11 dial — yes, it goes to eleven — instead of the raw 1–30 tube-drive number. - New AmpVoicePedal.taperedDrive(_:) maps the 1–11 dial to the 1–30 tube drive through an exponential LinExp taper, so 1 is nearly clean, 11 is full saturation, and the useful grind spreads across the dial (fine at the bottom, steep at the top) rather than bunching near the low end. - Wired into the base preampStage and every override that feeds a drive: Boutique / Fullerton Drive / Jazz Clean / British Dual (Drive channel), Anaheim (SS preamp), British Master (cascaded stage). - gainRange / driveRange → 1...11; every amp's default gain/drive reconverted from drive-space to the equivalent dial value (dial = 1 + 10·ln(drive)/ln(30)), so each amp's shipped voicing is preserved. - No preset migration (nothing shipped — per product owner); all knob work stays within ShoeGaze (no core Lyrebird change). - Tests updated to the 1–11 scale; added range + exponential-taper assertions. 671 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -49,8 +49,8 @@ struct ModernHighGainAmpPedalTests {
|
||||
|
||||
@Test func buildsNonSilentFiniteWithinCeiling() throws {
|
||||
let hot: [Float] = try render { (p: ModernHighGainAmpPedal) in
|
||||
p.gain = 30.0; p.bass = 1.0; p.treble = 1.0; p.master = 1.0; p.channel = 1.0
|
||||
p.drive = 30.0; p.sag = 1.0; p.tight = 1.0
|
||||
p.gain = 11.0; p.bass = 1.0; p.treble = 1.0; p.master = 1.0; p.channel = 1.0
|
||||
p.drive = 11.0; p.sag = 1.0; p.tight = 1.0
|
||||
}
|
||||
#expect(hasNonSilentOutput(hot) && hot.allSatisfy { $0.isFinite })
|
||||
let peak: Double = hot.reduce(0.0) { Swift.max($0, abs(Double($1))) }
|
||||
@@ -58,8 +58,8 @@ struct ModernHighGainAmpPedalTests {
|
||||
}
|
||||
|
||||
@Test func sagChangesOutput() throws {
|
||||
let stiff: [Float] = try render { $0.gain = 20.0; $0.channel = 1.0; $0.sag = 0.0 }
|
||||
let saggy: [Float] = try render { $0.gain = 20.0; $0.channel = 1.0; $0.sag = 1.0 }
|
||||
let stiff: [Float] = try render { $0.gain = 9.8; $0.channel = 1.0; $0.sag = 0.0 }
|
||||
let saggy: [Float] = try render { $0.gain = 9.8; $0.channel = 1.0; $0.sag = 1.0 }
|
||||
#expect(windowedSSD(stiff, saggy) > 0, "Sag had no effect")
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ struct ModernHighGainAmpPedalTests {
|
||||
// must stay positive (attenuation), never go negative (phase inversion). Assert the sag'd
|
||||
// output correlates positively with the stiff one (not an inverted copy).
|
||||
let cfg: (ModernHighGainAmpPedal) -> Void = { (p: ModernHighGainAmpPedal) in
|
||||
p.gain = 20.0; p.channel = 1.0; p.presence = 1.0; p.depth = 1.0
|
||||
p.gain = 9.8; p.channel = 1.0; p.presence = 1.0; p.depth = 1.0
|
||||
}
|
||||
let stiff: [Float] = try render { cfg($0); $0.sag = 0.0 }
|
||||
let saggy: [Float] = try render { cfg($0); $0.sag = 1.0 }
|
||||
@@ -111,11 +111,11 @@ struct ModernHighGainAmpPedalTests {
|
||||
@Test func controlsRoundTripThroughState() throws {
|
||||
let pedal: ModernHighGainAmpPedal = ModernHighGainAmpPedal()
|
||||
pedal.sag = 0.8; pedal.tight = 1.0; pedal.channel = 1.0
|
||||
pedal.drive = 20.0; pedal.master = 0.7; pedal.cab = 2.0
|
||||
pedal.drive = 9.8; pedal.master = 0.7; pedal.cab = 2.0
|
||||
let restored: ModernHighGainAmpPedal = ModernHighGainAmpPedal()
|
||||
restored.applyState(pedal.captureState())
|
||||
#expect(restored.sag == 0.8 && restored.tight == 1.0 && restored.channel == 1.0)
|
||||
#expect(restored.drive == 20.0 && restored.master == 0.7 && restored.cab == 2.0)
|
||||
#expect(restored.drive == 9.8 && restored.master == 0.7 && restored.cab == 2.0)
|
||||
}
|
||||
|
||||
@Test func registeredInBuiltInRegistry() throws {
|
||||
|
||||
Reference in New Issue
Block a user