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:
@@ -58,14 +58,14 @@ struct FullertonDriveAmpPedalTests {
|
||||
// The value is read at build time (rebuildsOnChange); configure runs before build, so the
|
||||
// Drive channel cascades its extra stage.
|
||||
let clean: [Float] = try render { $0.channel = 0.0 }
|
||||
let drive: [Float] = try render { $0.channel = 1.0; $0.drive = 15.0 }
|
||||
let drive: [Float] = try render { $0.channel = 1.0; $0.drive = 9.0 }
|
||||
#expect(hasNonSilentOutput(clean) && hasNonSilentOutput(drive))
|
||||
#expect(windowedSSD(clean, drive) > 0, "channel switch had no effect")
|
||||
}
|
||||
|
||||
@Test func driveKnobChangesDriveChannel() throws {
|
||||
let low: [Float] = try render { $0.channel = 1.0; $0.drive = 2.0 }
|
||||
let high: [Float] = try render { $0.channel = 1.0; $0.drive = 25.0 }
|
||||
let high: [Float] = try render { $0.channel = 1.0; $0.drive = 10.5 }
|
||||
#expect(windowedSSD(low, high) > 0, "Drive knob had no effect on the drive channel")
|
||||
}
|
||||
|
||||
@@ -87,13 +87,13 @@ struct FullertonDriveAmpPedalTests {
|
||||
@Test func outputStaysWithinCeilingOnDriveChannel() throws {
|
||||
let ceilingEpsilon: Double = 1.0e-4
|
||||
let hot: [Float] = try render { (pedal: FullertonDriveAmpPedal) in
|
||||
pedal.gain = 30.0
|
||||
pedal.gain = 11.0
|
||||
pedal.bass = 1.0
|
||||
pedal.treble = 1.0
|
||||
pedal.reverb = 1.0
|
||||
pedal.bright = 1.0
|
||||
pedal.channel = 1.0
|
||||
pedal.drive = 30.0
|
||||
pedal.drive = 11.0
|
||||
}
|
||||
let peak: Double = hot.reduce(0.0) { Swift.max($0, abs(Double($1))) }
|
||||
#expect(peak <= 1.0 + ceilingEpsilon, "peak \(peak) exceeds the ±1 ceiling on the drive channel")
|
||||
@@ -112,13 +112,13 @@ struct FullertonDriveAmpPedalTests {
|
||||
@Test func controlsRoundTripThroughState() throws {
|
||||
let pedal: FullertonDriveAmpPedal = FullertonDriveAmpPedal()
|
||||
pedal.reverb = 0.6
|
||||
pedal.drive = 12.0
|
||||
pedal.drive = 8.3
|
||||
pedal.bright = 1.0
|
||||
pedal.channel = 1.0
|
||||
pedal.cab = 2.0
|
||||
let restored: FullertonDriveAmpPedal = FullertonDriveAmpPedal()
|
||||
restored.applyState(pedal.captureState())
|
||||
#expect(restored.reverb == 0.6 && restored.drive == 12.0)
|
||||
#expect(restored.reverb == 0.6 && restored.drive == 8.3)
|
||||
#expect(restored.bright == 1.0 && restored.channel == 1.0 && restored.cab == 2.0)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user