From 9b23f99a580a4d0699e8a87dfa568a2e2ec67dac Mon Sep 17 00:00:00 2001 From: Joshua Parmenter Date: Tue, 4 Aug 2026 09:40:09 -0700 Subject: [PATCH] docs(cabinet): fix doc attachment + class-level surface for dual-mic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review follow-ups (all doc-only; DSP/RT/preset verified correct): - The blendSecondMic insertion had detached applyPlacement's summary; give each helper its own complete doc block again. - Update the class-level signal-path diagram + ## Parameters list for micB / micBlend / micOffset and the optional parallel second-convolver branch. - micOffset: note it is a set-and-leave spacing control (live-sweeping it moves the comb, a flanger-like effect) — keeps .linear interp so micOffset=0 is a true zero-delay alignment. - Correct the maxMicOffsetSeconds comment (1.5 ms ~ 0.5 m spacing, not "mic diameters"; first notch near 330 Hz at full offset). 669 tests pass. Co-Authored-By: Claude Opus 4.8 --- .../Pedals/CabinetPedal.swift | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Sources/LyrebirdShoeGaze/Pedals/CabinetPedal.swift b/Sources/LyrebirdShoeGaze/Pedals/CabinetPedal.swift index c6277e8..bd6382b 100644 --- a/Sources/LyrebirdShoeGaze/Pedals/CabinetPedal.swift +++ b/Sources/LyrebirdShoeGaze/Pedals/CabinetPedal.swift @@ -19,6 +19,8 @@ import LyrebirdUI /// Signal path (inside `effect(_:)`): /// ``` /// dry → ConvolutionReverb(ir: cab voice + mic voice) (one IR — mic colour baked in) +/// ├─ (optional) ConvolutionReverb(ir: cab + mic B) → DelayLine(Mic Offset) (parallel 2nd mic) +/// │ blended A·(1−Mic Blend) + Bdelayed·(Mic Blend) (comb of two mics) /// → RBJHighShelf (Position) → RBJLowShelf (Proximity) (live mic-placement shelves) /// → LookAheadLimiter(±1) (transparent peak safety) /// → mono out @@ -36,8 +38,12 @@ import LyrebirdUI /// /// - `cabinet`: Selects the built-in cabinet voicing (stepped selector over ``CabinetVoice``). /// - `mic`: Selects the microphone voicing baked into the IR (stepped selector over ``MicVoice``). +/// - `micB`: Optional second mic (stepped selector over ``MicVoice``; No Mic = single mic). When set, +/// a parallel convolver blends in for the classic two-mic technique. /// - `position` / `proximity`: Live mic-placement shelves in the advanced pop-over (on-axis ↔ edge, /// distant ↔ close). +/// - `micBlend` / `micOffset`: Advanced pop-over — the A/B balance and the mic-B time offset (comb +/// spacing) when a second mic is engaged. public final class CabinetPedal: Pedal { /// One-line description shown in the picker and info panel. @@ -72,6 +78,10 @@ public final class CabinetPedal: Pedal { /// **Mic Offset** in `[0, 1]`: the relative time offset of mic B, `0` = aligned, `1` = the maximum /// spacing. A short live delay on mic B; summing it with the aligned mic A produces the comb /// filtering of two spaced mics. Only active when ``micB`` ≠ No Mic. Surfaced in the pop-over. + /// + /// > Note: intended as a **set-and-leave** spacing control (dial in the comb, then play). It is a + /// > live delay, so *sweeping* it during playback moves the comb — a flanger-like effect rather + /// > than a static mic position. @UIParam public var micOffset: Double = 0.0 // MARK: - Constants @@ -104,8 +114,9 @@ public final class CabinetPedal: Pedal { private let placementShelfSlope: Double = 0.7 /// `[0, 1]` range for the Position / Proximity / Mic Blend / Mic Offset pop-over knobs. private static let placementRange: ClosedRange = 0.0 ... 1.0 - /// Maximum mic-B time offset (seconds) at `micOffset = 1` — a couple of mic diameters of spacing. - /// Sets both the delay-line size and the comb range (first notch ≈ `1 / (2·offset)` Hz). + /// Maximum mic-B time offset (seconds) at `micOffset = 1` — a spaced-mic offset (~0.5 m of path + /// difference). Sets both the delay-line size and the comb range: the first notch is at + /// `1 / (2·offset)` Hz, so full offset places it near 330 Hz (`micOffset = 0` = aligned, no comb). private let maxMicOffsetSeconds: Double = 0.0015 /// Selector stops, one per ``CabinetVoice`` in `allCases` order (value == index). @@ -210,12 +221,6 @@ public final class CabinetPedal: Pedal { ) } - /// Applies the live mic-placement shelves to the convolved signal: a **Position** high-shelf that - /// rolls the top off as the mic moves off-axis toward the cone edge, then a **Proximity** - /// low-shelf that lifts the low end as the mic moves closer. Both map their knob `[0, 1]` to a - /// shelf gain in dB with `0` → `0` dB, so at the default (`0, 0`) each shelf is a bit-exact - /// identity and the cabinet sounds exactly as it did before placement existed. - /// /// Blends a second microphone into the primary convolution when ``micB`` ≠ No Mic — the classic /// two-mic technique. A parallel convolver (same cab voice, mic B's IR) is delayed by up to /// ``maxMicOffsetSeconds`` (``micOffset``) and summed with the aligned primary at the ``micBlend`` @@ -250,7 +255,13 @@ public final class CabinetPedal: Pedal { return primary * (1.0 - $micBlend) + delayedSecondary * $micBlend } - /// - Parameter signal: The cab-convolved signal. + /// Applies the live mic-placement shelves to the convolved signal: a **Position** high-shelf that + /// rolls the top off as the mic moves off-axis toward the cone edge, then a **Proximity** + /// low-shelf that lifts the low end as the mic moves closer. Both map their knob `[0, 1]` to a + /// shelf gain in dB with `0` → `0` dB, so at the default (`0, 0`) each shelf is a bit-exact + /// identity and the cabinet sounds exactly as it did before placement existed. + /// + /// - Parameter signal: The (single- or dual-mic) convolved signal. /// - Returns: The placement-shaped signal. private func applyPlacement(_ signal: any ValidGeneratorInput) -> any ValidGeneratorInput { let positionCutDb: LinLin.Audio = LinLin.Audio(