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.
| Control | Range | Default | Notes |
|---|---|---|---|
| ON | OFF / ON | OFF | 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 / ON | OFF | Inverts the LFO polarity before the depth multiplier. |
| DEST | See destinations table | --- | Routing target. Combobox with 9 options. |
| # | Name | Shape |
|---|---|---|
| 0 | SIN | Classic sine. |
| 1 | TRI | Symmetric triangle. |
| 2 | SAW | Ascending ramp (-1 → +1). |
| 3 | RSAW | Descending ramp (+1 → -1). |
| 4 | SQR | 50% square wave. |
| 5 | PULSE | 25% pulse wave. |
| 6 | STAIR | 8-step staircase across the cycle. |
| 7 | UPDN | Asymmetric triangle: fast up (30%), slow down (70%). |
| 8 | RAND | Sample & hold — new random value each cycle. |
| 9 | RCOS | Rectified cosine, symmetric about 0. |
| 10 | EXPO | Exponential rising curve (slow start, fast end). |
| 11 | LOG | Logarithmic rising curve (inverse of EXPO). |
| 12 | SINE2 | Sine at 2× rate (double-frequency overlay). |
| 13 | PULS2 | 12.5% narrow pulse. |
| 14 | CHIRP | Frequency-sweeping sine (up-chirp) within each cycle. |
| 15 | PAT | Complex gate-like rhythmic pattern. |
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 }
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.
| Destination | Target Knob | Internal scale |
|---|---|---|
| --- | (none) | 0.0 |
| CUTOFF | Filter CUTOFF | 0.45 |
| FLT RES | Filter RESO | 0.35 |
| SEM CUT | SEM CUT | 0.45 |
| SEM RES | SEM RES | 0.35 |
| CLOUD POS | Death Cloud POSITION | 0.40 |
| CLOUD SIZE | Death Cloud SIZE | 0.40 |
| RINGS STRUCT | Death Rings STRUCTURE | 0.40 |
| RINGS DAMP | Death Rings DAMPING | 0.40 |
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.
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.
When sync is on, each LFO's rate knob snaps to a nine-step table (beats per full LFO cycle):
| Knob norm | Beats / cycle | Musical name |
|---|---|---|
| 0.00 | 8.0 | 2 bars (8 beats) |
| 0.125 | 4.0 | 1 bar (whole note, 4 beats) |
| 0.25 | 2.0 | half note |
| 0.375 | 1.0 | quarter note |
| 0.50 | 0.5 | eighth note |
| 0.625 | 0.25 | sixteenth note |
| 0.75 | 0.125 | thirty-second note |
| 0.875 | 0.0625 | 1/64 note |
| 1.00 | 0.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.
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.
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.
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:
| Pad | Target | Scale | Notes |
|---|---|---|---|
| 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.
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.