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:
2026-08-04 10:42:35 -07:00
parent da2c3328ee
commit f9ddd6b160
41 changed files with 151 additions and 106 deletions
@@ -23,8 +23,8 @@ open class BoutiqueAmpPedal: AmpVoicePedal {
@UIParam public var depth: Double = 0.3
/// Master volume in [0, 1] → power-amp drive in [`masterMinDrive`, `masterMaxDrive`].
@UIParam public var master: Double = 0.5
/// Lead-channel preamp gain (the cascaded stage). Range [1, 30].
@UIParam public var drive: Double = 10.0
/// Lead-channel preamp gain (the cascaded stage). Dial [1, 11], tapered to tube drive.
@UIParam public var drive: Double = 7.77
/// Channel select: `0` = Clean, `1` = Lead (the cascaded gain stage).
@UIParam public var channel: Double = 0.0
@@ -38,7 +38,7 @@ open class BoutiqueAmpPedal: AmpVoicePedal {
private let masterMaxDrive: Double = 5.0
private let channelThreshold: Double = 0.5
private let driveRange: ClosedRange<Double> = 1.0 ... 30.0
private let driveRange: ClosedRange<Double> = 1.0 ... 11.0
public override var toneStackModel: ToneStackModel { .marshall }
public override var signatureKnobs: [PedalKnob] {
@@ -78,7 +78,7 @@ open class BoutiqueAmpPedal: AmpVoicePedal {
public override func preampStage(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput {
let clean: any ValidGeneratorInput = super.preampStage(signal)
guard channel >= channelThreshold else { return clean }
return TriodeStage(input: clean, drive: $drive, bias: leadBias, oversample: preampOversample)
return TriodeStage(input: clean, drive: taperedDrive($drive), bias: leadBias, oversample: preampOversample)
}
/// Presence (top-end high-shelf) then Depth (low-end low-shelf), post power amp.