theallelectricsmartgrid

PolyXFader LFOs

The primary Low-Frequency Oscillators (LFOs) in the Smart Grid One are implemented using the PolyXFaderInternal struct (private/src/PolyXFader.hpp). Despite the somewhat unconventional name, this struct evaluates and mixes periodic waveforms.

Phase-Synchronized Mixing

PolyXFader reads absolute loop phase through GetPhase, with an explicit PhaseDomain. The Theory of Time’s own phase-modulation LFO uses unmodulated phase; voice LFOs use modulated phase. It has no independent phase accumulator or reset input.

Waveform evaluation first reduces phase + phaseShift + 0.75 to a fractional cycle in double precision, then applies the shaping multiplier. A multiplier of 2.5 produces two full lobes and a final shorter lobe with half amplitude in each input cycle. This periodic shaping is preserved even at large absolute phase values.

Running topology edits require simultaneous old/new parent modulated boundaries. Integer phase offsets at an exact shared boundary therefore evaluate to the same periodic waveform. Interpolation uses global phase and the interval’s topology, avoiding a sweep through the absolute integer jump. Sampled boundary overshoot still reflects the new rate, and unmodulated LFO drive can differ from the modulated boundary used to accept an edit.

Components are shaped, weighted and mixed; components with zero blend weight are skipped. There is no waveform quantization. The normalized mix then passes through one OPLowPassFilter. Its per-sample phase distance is abs(modulated phase increment) × maximum active cycle ratio × PolyX multiplier × 8. This keeps the smoothing scale tied to logical travel as warp speed changes. Zero travel holds the mix. Reverse travel uses the same positive decay as equal forward travel; it does not undo the filter’s history.

The warp-producing oscillator uses nominal unmodulated phase travel, avoiding a self-dependent derivative. Stopped LFO slew also uses nominal travel so it can settle while musical phase is stationary. Coefficients update when phase distance changes, retaining the filter state. Small steps use the stable coefficient approximation; large steps use expm1 without a frequency cutoff clamp. The ideal forward law is proved in the phase model; sampled varying inputs still have integration error.

LFO scopes publish the clock’s continuous-phase offset and a period of 1 / gcd(active cycle ratios). The period GCD and axis update run during PopulateUIState, before the scope bank publishes, rather than on each engine sample. They do not record start markers or aggregate loop-top offsets. The display reads the corresponding phase in the current or previous cycle through the shared inverse, keeping a full logical-period axis even before one cycle has been recorded.

Blend weights, mixed-waveform slew, sample-and-hold and its slew are shared across LFO uses. Sample-and-hold captures the smoothed mix, then its held value passes through a 500 Hz OPLowPassFilter before blending with the continuous smoothed mix. This S+H filter runs every sample even at zero S+H mix, preserving its history across triggers and blend changes. There is no additional filter after the blend. Voice, quad and tempo LFOs share the Shape curve below. The tempo LFO retains its narrower Skew range.

Features

The PolyXFader LFOs support a variety of shaping and modulation options:

Usage

These LFOs are used extensively throughout the system: