102715ded1
First stereo (widener) amp, modeling the JC-style ultra-clean combo whose signature is a lush stereo chorus fed to two power amps / speakers. Refactor AmpVoicePedal.effect() into two reusable, behavior-preserving pieces: - preCabinetCore(_:) — inputShaping → preamp → tone → onboardEffects → power → shapeVoice (mono) - cabinetAndLimit(_:) — selected cab convolver → tanh soft-limit → Clip(±1) (per channel) effect() = cabinetAndLimit(preCabinetCore(dry)); the four existing amps are unchanged (verified by their suites). JazzCleanAmpPedal (widener, .fender): mono core (with spring reverb + bright) → Chorus (mono → stereo split) → per-channel cabinetAndLimit. Controls: Gain/Bass/Mid/Treble + Reverb/Rate/Depth knobs, Bright + Chorus switches, Cab selector; widthUnits 3; defaults to the Full-Range cab for a hi-fi voice. The Chorus footswitch gates the wet mix to 0 (dry pass-through, Rate/Depth kept). Registered across registry/type/category/palette/enclosure; Help acknowledgment lists its tone stack. 10 tests (chorus rate/depth, reverb, bright, footswitch bit-exact bypass, ceiling with FX, stereo/control-surface config, round-trip, registry). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
107 lines
4.0 KiB
Swift
107 lines
4.0 KiB
Swift
// PedalType.swift
|
|
// Lyrebird
|
|
//
|
|
// Copyright (c) 2026 Joshua Parmenter / realizedsound
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
/// A type-safe identifier for a pedal type, used by the board-edit API instead of a raw string.
|
|
///
|
|
/// `PedalType` is an extensible token (the `RawRepresentable` struct pattern, à la
|
|
/// `Notification.Name`): the built-in pedals are exposed as static members for discoverable,
|
|
/// autocompleting call sites —
|
|
///
|
|
/// ```swift
|
|
/// try shoeGaze.appendPedal(.overdrive, to: board)
|
|
/// ```
|
|
///
|
|
/// — while staying open for custom pedals, since any `PedalType("My Pedal")` is valid and a
|
|
/// third party can add their own static members in an extension.
|
|
///
|
|
/// `rawValue` is the pedal's `displayName`, which is exactly what the rig save format stores
|
|
/// (`PedalState.type`) and what ``PedalRegistry`` keys on. `PedalType` therefore changes only the
|
|
/// authoring call site — the JSON format and load path are unchanged.
|
|
///
|
|
/// > Note: named `PedalType` rather than `PedalKind` to avoid colliding with Lyrebird's
|
|
/// > score-notation `PedalKind` enum, which is visible whenever both modules are imported.
|
|
public struct PedalType: RawRepresentable, Hashable, Sendable {
|
|
|
|
/// The pedal's `displayName`; the key used by ``PedalRegistry`` and stored in saved rigs.
|
|
public let rawValue: String
|
|
|
|
/// Creates a type from a raw `displayName` string.
|
|
public init(rawValue: String) {
|
|
self.rawValue = rawValue
|
|
}
|
|
|
|
/// Creates a type from a raw `displayName` string.
|
|
public init(_ rawValue: String) {
|
|
self.rawValue = rawValue
|
|
}
|
|
}
|
|
|
|
// MARK: - Built-in pedals
|
|
|
|
public extension PedalType {
|
|
|
|
// Drive & dynamics
|
|
static let california = PedalType("California")
|
|
static let british = PedalType("British")
|
|
static let chime = PedalType("Chime")
|
|
static let fullertonReverb = PedalType("Fullerton Reverb")
|
|
static let jazzClean = PedalType("Jazz Clean")
|
|
static let neuralAmp = PedalType("Neural Amp")
|
|
static let overdrive = PedalType("Overdrive")
|
|
static let distortion = PedalType("Distortion")
|
|
static let fuzz = PedalType("Fuzz")
|
|
static let compressor = PedalType("Compressor")
|
|
static let limiter = PedalType("Limiter")
|
|
static let noiseGate = PedalType("Noise Gate")
|
|
static let cabinet = PedalType("Cabinet")
|
|
|
|
// EQ & filter
|
|
static let graphicEQ = PedalType("Graphic EQ")
|
|
static let autoWah = PedalType("Auto-Wah")
|
|
static let wah = PedalType("Wah")
|
|
static let mutant = PedalType("Mutant")
|
|
static let phaser = PedalType("Phaser")
|
|
|
|
// Modulation
|
|
static let tremolo = PedalType("Tremolo")
|
|
static let modulation = PedalType("Modulation")
|
|
static let chorus = PedalType("Chorus")
|
|
static let flanger = PedalType("Flanger")
|
|
static let vibrato = PedalType("Vibrato")
|
|
static let rotary = PedalType("Rotary")
|
|
static let ringModulator = PedalType("Ring Modulator")
|
|
static let diffuser = PedalType("Diffuser")
|
|
static let bitcrusher = PedalType("Bitcrusher")
|
|
static let granulator = PedalType("Granulator")
|
|
static let autoGranulator = PedalType("Auto Granulator")
|
|
|
|
// Dynamics (additional)
|
|
static let sustainer = PedalType("Sustainer")
|
|
|
|
// Gain (additional)
|
|
static let volume = PedalType("Volume")
|
|
|
|
// Delay & reverb
|
|
static let delay = PedalType("Delay")
|
|
static let feedbackDelay = PedalType("Feedback Delay")
|
|
static let multiTapDelay = PedalType("Multi-Tap Delay")
|
|
static let pingPong = PedalType("Ping-Pong")
|
|
static let reverseDelay = PedalType("Reverse Delay")
|
|
static let reverb = PedalType("Reverb")
|
|
static let shimmerReverb = PedalType("Shimmer Reverb")
|
|
static let plateReverb = PedalType("Plate Reverb")
|
|
static let roomReverb = PedalType("Room Reverb")
|
|
static let springReverb = PedalType("Spring Reverb")
|
|
|
|
// Pitch & octave
|
|
static let octaveSplitter = PedalType("Octave Splitter")
|
|
static let bassOctaver = PedalType("Bass Octaver")
|
|
static let harmonizer = PedalType("Harmonizer")
|
|
|
|
// Looper
|
|
static let looper = PedalType("Looper")
|
|
}
|