QUAD LFO

four routable modulation sources with a Modcan-style paging UI

The Quad LFO provides four independent low-frequency oscillators whose outputs are written once per audio block into a shared ModulationBus and added as offsets to target knob values by the voice and effects DSP. One set of edit controls (wave, rate, depth, invert, destination) is "live" for the currently-selected LFO, paged via the 1 / 2 / 3 / 4 buttons. The per-LFO ON toggle is independent of the page selector — you can edit LFO 2 while only LFO 1 is running, etc.

4 independent LFOs 16 wave types 16 rate stops 9 destinations Per-LFO on/off Live lock + animate

Per-LFO parameters (via the live edit controls)

ControlRangeDefaultNotes
ON OFF / ONOFF Master enable for this LFO slot. OFF LFOs don't advance their phase, don't contribute to the bus, and render a flat zero line on the scope — zero CPU overhead.
WAVE 0..15 (stepped)0 (SIN) 16 selectable wave shapes (table below). The big display window next to the WAVE knob shows the current wave name.
RATE/DIV 0..15 (stepped)0 16 discrete rate positions from 0.02 Hz to 32 Hz. The RATE knob is drawn with 1..16 markers around its rim indicating the step positions.
DEPTH 0.0 → 1.0 (continuous)0.0 Modulation amount applied to the routed destination.
INV OFF / ONOFF Inverts the LFO polarity before the depth multiplier.
DEST See destinations table--- Routing target. Combobox with 9 options.

Wave types

#NameShape
0SINClassic sine.
1TRISymmetric triangle.
2SAWAscending ramp (-1 → +1).
3RSAWDescending ramp (+1 → -1).
4SQR50% square wave.
5PULSE25% pulse wave.
6STAIR8-step staircase across the cycle.
7UPDNAsymmetric triangle: fast up (30%), slow down (70%).
8RANDSample & hold — new random value each cycle.
9RCOSRectified cosine, symmetric about 0.
10EXPOExponential rising curve (slow start, fast end).
11LOGLogarithmic rising curve (inverse of EXPO).
12SINE2Sine at 2× rate (double-frequency overlay).
13PULS212.5% narrow pulse.
14CHIRPFrequency-sweeping sine (up-chirp) within each cycle.
15PATComplex gate-like rhythmic pattern.

Rate table

The RATE knob snaps to 16 discrete positions. Low positions are slow evolution (good for filter sweeps over bars); high positions are audio-rate adjacent (tremolo / chirp territory).

// kLfoRateTable -- position 0..15 -> Hz
{ 0.02, 0.05, 0.1, 0.2, 0.35, 0.5, 0.75, 1.0,
  1.5,  2.0,  3.0, 5.0, 8.0,  12.0, 20.0, 32.0 }

ROUTING DESTINATIONS

the 9 targets exposed via the DEST combobox

Each LFO routes to one destination (or --- for none). Multiple LFOs can target the same destination; their contributions sum in the bus. Per-destination depth-scaling factors are tuned so a fully-open LFO sweeps the target meaningfully without overwhelming the base knob.

DestinationTarget KnobInternal scale
---(none)0.0
CUTOFFFilter CUTOFF0.45
FLT RESFilter RESO0.35
SEM CUTSEM CUT0.45
SEM RESSEM RES0.35
CLOUD POSDeath Cloud POSITION0.40
CLOUD SIZEDeath Cloud SIZE0.40
RINGS STRUCTDeath Rings STRUCTURE0.40
RINGS DAMPDeath Rings DAMPING0.40

Lock + animate

When an LFO has ON, DEPTH > 0, and a destination other than ---, the target knob becomes locked (disabled for user interaction) and paints a second amber indicator showing the live modulated position. A 30 Hz Timer on the panel reads the current bus value and repaints the locked knobs so you see the modulation tracking the LFO in real time. Disengaging the LFO (toggle OFF, depth to 0, or destination to ---) releases the lock.

CLOCK SYNC

phase-lock every LFO to the master tempo

The SYNC SYNTH toggle (inside the drum sequencer panel's CLOCK column) is the one global switch that re-roots every free-running LFO on the synth to the shared master clock. When it's on:

Flipping sync off returns every LFO to its free-run behaviour (rate knob back to continuous Hz; phase drifts naturally). Note that turning sync off mid-note does not audibly glitch because the daisysp voice-LFO oscillator keeps its internal phase valid in parallel to the synced override.

Musical-division table

When sync is on, each LFO's rate knob snaps to a nine-step table (beats per full LFO cycle):

Knob normBeats / cycleMusical name
0.008.0 2 bars (8 beats)
0.1254.0 1 bar (whole note, 4 beats)
0.252.0 half note
0.3751.0 quarter note
0.500.5 eighth note
0.6250.25 sixteenth note
0.750.125 thirty-second note
0.8750.0625 1/64 note
1.000.03125 1/128 note

Internal helper: mapLfoSyncBeats(norm) in SynthEngine.cpp. Raising the knob halves the cycle length each step — one musical octave of tempo resolution per step.

How it works internally

The engine maintains a masterClockSamples counter (monotonic double, survives uptime without drift) and publishes it into the shared ModulationBus at the start of each audio block, along with the derived samplesPerBeat = sr × 60 / bpm.

// per-block publish, before any voice or Quad LFO reads
modBus.clockSamples   = masterClockSamples;
modBus.samplesPerBeat = sampleRate * 60.0 / bpm;
modBus.syncEnabled    = params.clockSyncEnabled.load();

// ... later, at the end of the block:
masterClockSamples += (double) numSamples;

The voice LFO then reads modBus.clockSamples per sample and computes its value as sin(2π · fmod(clock, cycleSamples) / cycleSamples). The Quad LFO does the same per-block (once per processing block) since its output is block-rate anyway.

Envelopes are intentionally not tempo-synced — beat-quantising the ADSR times would mean a held note's release tail changes as you drag the tempo, which almost never sounds good. If you want beat-locked amplitude pulses, that's what the arp's GATE mode and the drum sequencer are for.

QUAD SCOPE

four-channel visualisation of the LFO outputs

At the top of the Quad LFO plate, four stacked scope lanes show each LFO's raw output waveform. Every audio block each LFO pushes one sample into a 256-entry ring buffer per channel; the scope component reads these at 30 fps. Disabled LFOs draw a flat zero line. The scope is purely visual (no audio side-effect) and independent of the main CRT oscilloscope.

MOD PADS

two vertical mod-wheel strips, left of the keyboard

Two vertical strips that each output a 0..1 value on click/drag. They add to the modulation bus like LFOs but with no routing matrix — each is hard-wired to a specific destination:

PadTargetScaleNotes
MOD1 Filter cutoff offset (× 0.35) 0.0 → 0.35 Mod-wheel equivalent — opens the filter as you drag up.
MOD2 Filter resonance offset (× 0.25) 0.0 → 0.25 Aux modulator — adds resonance. Use with slow MOD1 sweeps for classic filter-wail riffs.

Mod pad values are added on top of any Quad LFO contributions to the same destinations. If you want them to route to something else, edit the two lines in SynthEngine::renderNextBlock that write to modBus.filterCutoff and modBus.filterRes.

MODULATION BUS INTERNALS

why this is all block-rate

All modulation is accumulated once per audio block into a plain struct of floats (ModulationBus). Voice and effect DSP code reads these fields per-sample within the block. Block-rate updates are more than enough for LFOs running up to 32 Hz (one update per ~128 samples ≈ ~3 ms); the tiny stepping artefact is below audibility.

The bus is cleared at the start of each block before LFOs write their contributions. Voice + effect code adds offsets into their parameter values with juce::jlimit clamps, so the base knob value defines the "centre" around which modulation swings.

// ModulationBus has 8 floats (one per routable destination).
// QuadLFO::processBlock() clears it, then each enabled LFO adds
// contribution = out * depth * destScale[dest] into the relevant field.
// Voice code reads modBus->filterCutoff etc. per sample.