feat(pedals): add Vibe pedal + Psychedelic Vibe Lead rig

New "Vibe" pedal: a photocell-style vibe built as four staggered all-pass
stages swept by one shared sine LFO (unequal centre frequencies give the
uneven, vocal throb that distinguishes a vibe from a phaser). Speed and
Intensity knobs, Chorus/Vibrato mode switch (chorus blends dry+swept,
vibrato passes swept only). Composed from RBJAllPass in effect(), mirroring
PhaserPedal — no new RT generator.

Registered in PedalType/PedalRegistry, enclosure colour, and palette order.
Tests cover build+non-silent, each control measurably changing output, the
knob/switch listing, and preset round-trip.

Adds the Psychedelic Vibe Lead factory rig (Fuzz -> Vibe -> Delay -> Plate).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-09 13:06:17 -07:00
parent 779c55493d
commit 965633de34
7 changed files with 293 additions and 1 deletions
+1
View File
@@ -92,6 +92,7 @@ public extension PedalType {
static let chorus = PedalType("Chorus")
static let flanger = PedalType("Flanger")
static let vibrato = PedalType("Vibrato")
static let vibe = PedalType("Vibe")
static let rotary = PedalType("Rotary")
static let ringModulator = PedalType("Ring Modulator")
static let diffuser = PedalType("Diffuser")
@@ -0,0 +1,154 @@
// VibePedal.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
import LyrebirdSynth
import LyrebirdUI
/// Photocell "vibe" pedal: four staggered all-pass stages swept by one shared LFO.
///
/// Signal chain (inside `effect(_:)`):
/// ```
/// dry → RBJAllPass(freq₀(t)) → RBJAllPass(freq₁(t)) → RBJAllPass(freq₂(t)) → RBJAllPass(freq₃(t)) → wet
/// out = wet·wetAmount + dry·dryAmount (mode: chorus blends dry+wet, vibrato is wet only)
/// ```
///
/// Unlike a phaser (evenly-spaced stages producing symmetric notches), the vibe cascades all-pass
/// stages at **staggered** centre frequencies, so the phase relationships between stages produce the
/// characteristic uneven, vocal throb. A single low-frequency sine modulates every stage's centre
/// frequency together; the `intensity` knob scales the sweep depth and the `speed` knob sets the LFO
/// rate. In *chorus* mode the swept signal is blended 50/50 with the dry signal (comb-filter throb);
/// in *vibrato* mode only the swept (phase-modulated) signal passes, for a pitch-vibrato-like warble.
///
/// The bypass switching is handled by the `Pedal` base class. The base `mix` is fixed fully wet — the
/// chorus/vibrato dry blend is handled internally so the two modes behave correctly.
///
/// ## Parameters
///
/// Inherits `bypass` and `level` from `Pedal`, plus:
///
/// - Parameters:
/// - speed: LFO sweep rate in Hz. Range `[0.1, 12.0]`. Defaults to `3.0`.
/// - intensity: Sweep depth as a fraction of each stage's centre frequency. Range `[0, 0.7]`.
/// Defaults to `0.5`.
/// - mode: `0` = chorus (dry + swept), `1` = vibrato (swept only). Defaults to chorus.
public final class VibePedal: Pedal {
/// One-line description shown in the picker and info panel.
public override var summary: String {
"Throbbing photocell vibe — swirling chorus and warbling pitch-vibrato motion."
}
// MARK: - Parameters
/// LFO sweep rate in Hz. Range [0.1, 12.0].
@UIParam public var speed: Double = 3.0
/// Sweep depth as a fraction of each stage's centre frequency. Range [0, 0.7].
@UIParam public var intensity: Double = 0.5
/// Mode select: `0` = chorus (dry + swept), `1` = vibrato (swept only).
@UIParam public var mode: Double = 0.0
// MARK: - Constants
/// Default wet/dry blend — fully wet; the chorus/vibrato dry mix is handled inside `effect`.
private static let defaultMix: Double = 1.0
/// Q for each all-pass stage. Gentle phase transition for a smooth, vocal vibe (not sharp notches).
private let vibeQ: Double = 0.6
/// Staggered all-pass stage centre frequencies in Hz. Unequal spacing is what distinguishes the
/// vibe's uneven throb from an evenly-spaced phaser.
private let stageCenterFreqs: [Double] = [300.0, 620.0, 1300.0, 2200.0]
/// `mode` value selecting chorus (dry + swept).
private let modeChorusValue: Double = 0.0
/// `mode` value selecting vibrato (swept only).
private let modeVibratoValue: Double = 1.0
/// Wet gain at chorus mode (`mode == 0`); the swept signal sits 50/50 with dry.
private let chorusWetGain: Double = 0.5
// MARK: - UI knobs
/// Speed knob range in Hz (LFO sweep rate).
private let speedRange: ClosedRange<Double> = 0.1 ... 12.0
/// Intensity knob range (sweep depth fraction). Capped below `1.0` so a stage's swept frequency
/// never collapses toward `0 Hz` at the bottom of the sweep.
private let intensityRange: ClosedRange<Double> = 0.0 ... 0.7
public override var tempoSyncableParams: [TempoSyncableParam] {
[
TempoSyncableParam(key: "speed", label: "Speed", node: $speed, kind: .rate, range: speedRange),
]
}
public override var effectKnobs: [PedalKnob] {
[
PedalKnob(label: "Speed", node: $speed, range: speedRange),
PedalKnob(label: "Intensity", node: $intensity, range: intensityRange),
]
}
public override var effectSwitches: [PedalSwitch] {
[
PedalSwitch(
label: "Mode",
node: $mode,
options: [
PedalSwitch.Option(title: "Chorus", value: modeChorusValue),
PedalSwitch.Option(title: "Vibrato", value: modeVibratoValue),
]
),
]
}
// MARK: - Init
/// Creates a vibe pedal.
///
/// - Parameters:
/// - inputBus: Audio bus index to read the dry input from. Defaults to `0`.
/// - outputBus: Audio bus index to write the processed output to. Defaults to `0`.
public init(
inputBus: Int = 0,
outputBus: Int = 0
) {
super.init(
name: "Vibe",
inputBus: inputBus,
outputBus: outputBus,
initialMix: VibePedal.defaultMix
)
}
// MARK: - Effect
/// Cascades four staggered all-pass stages swept by a shared sine LFO, then blends per mode.
///
/// - Parameter dry: Dry mono input signal.
/// - Returns: Wet mono vibe output.
public override func effect(_ dry: any ValidGeneratorInput) -> any ValidGeneratorInput {
// One shared low-frequency sine drives every stage: ±1 scaled by intensity gives the sweep.
let lfo: any ValidGeneratorInput = OscSin.Audio(freq: $speed)
let sweep: any ValidGeneratorInput = lfo * $intensity // ±intensity
// Cascade the stages. Each stage's centre frequency is centre·(1 + sweep) = centre + centre·sweep.
var signal: any ValidGeneratorInput = dry
for center: Double in stageCenterFreqs {
let stageFreq: any ValidGeneratorInput = sweep * center + center
signal = RBJAllPass.Audio(input: signal, freq: stageFreq, q: vibeQ)
}
let wet: any ValidGeneratorInput = signal
// Blend by mode. Chorus (mode 0): 0.5·dry + 0.5·wet. Vibrato (mode 1): wet only.
let wetAmount: any ValidGeneratorInput = $mode * chorusWetGain + chorusWetGain // 0.5 → 1.0
let dryAmount: any ValidGeneratorInput = (modeVibratoValue - $mode) * chorusWetGain // 0.5 → 0.0
return wet * wetAmount + dry * dryAmount
}
}
@@ -79,6 +79,7 @@ public enum FactoryRigLibrary {
dubDelayThrow,
ringModTexture,
rockabillySlapback,
psychVibeLead,
]
// MARK: Shoegaze walls
@@ -508,6 +509,36 @@ public enum FactoryRigLibrary {
}
}
/// Fuzz swirled by a throbbing vibe into delay and plate — vintage psychedelic lead.
static let psychVibeLead: FactoryRig = FactoryRig(
id: stableID("Psych Vibe Lead"),
name: "Psychedelic Vibe Lead",
blurb: "Thick fuzz swirled by a throbbing photocell vibe, into delay and plate — the "
+ "late-'60s psychedelic lead voice. Hold notes and let the vibe pulse underneath.",
category: .classic
) { _, board in
try board.append(FuzzPedal()) { p in
p.fuzz = 30.0
p.tone = 3000.0
}
try board.append(VibePedal()) { p in
p.speed = 2.5
p.intensity = 0.6
// Chorus mode: dry + swept, the classic vibe throb.
p.mode = 0.0
}
try board.append(DelayPedal()) { p in
p.time = 0.4
p.feedback = 2.0
}
try board.append(PlateReverbPedal()) { p in
p.decay = 0.6
p.tone = 0.75
p.damp = 0.3
p.mod = 0.5
}
}
// MARK: - Seeding
/// Builds every factory rig into a ``RigEntry`` snapshot suitable for the rig library.
@@ -91,6 +91,7 @@ public enum PedalRegistry {
"Chorus": { ChorusPedal() },
"Flanger": { FlangerPedal() },
"Vibrato": { VibratoPedal() },
"Vibe": { VibePedal() },
"Rotary": { RotaryPedal() },
"Sustainer": { SustainerPedal() },
"Ring Modulator": { RingModulatorPedal() },