The final stages of the Smart Grid One DSP engine (private/src/QuadMixer.hpp and private/src/QuadMasterChain.hpp) handle the routing of effects, the mixdown to different channel formats, and the final mastering saturation.
QuadMixerInternal is SquiggleBoy’s mixer, not a general-purpose one. Its input is three trio tracks (each a TrioFloat signal with trio pan coordinates, fader gain, send gains, and the trio’s sub-oscillators) plus four stereo external inputs from the source mixer. One generic Mix function handles every lane group: each lane is routed as follows:
The three send returns can cross-feed each other. Delay and Reverb can send into the Partial Machine, and the Partial Machine can send back into Delay or Reverb. A return never feeds its own send bus.
The system simultaneously generates three parallel mixdowns:
QuadToStereoMixdown). It uses a specific matrix to fold the rear channels into the front channels while preserving spatial width.Before leaving the synthesizer, both the Quad and Stereo mixdowns pass through a DualMasteringChain, which contains a MultibandSaturator (private/src/MultibandSaturator.hpp).
The generated Lean core splits the signal into four bands using phase-compensated fourth-order Linkwitz–Riley crossovers. Each split uses two Butterworth-2 TPT SVF sections (Q = 1/√2): its LP and HP branches are −6.02 dB at the crossover, and their sum is allpass. Sibling allpass compensation aligns the branches throughout the tree, so the complete small-signal sum has flat magnitude at unity band and master gains (for common-channel input when mono bass is enabled). This replaces the old handwritten Butterworth-4 branches, which were −3 dB at crossover and did not reconstruct flat.
All audio channels are processed as one vector with shared coefficients. The three cutoff calculations remain batched across SIMD lanes using Math4096. Knob mappings and cutoff clamps are unchanged: at a 48 kHz host rate, the low cutoff spans 23.4–236.2 Hz, and each subsequent cutoff is 1–32 times the previous one. Default crossovers are approximately 74.4 Hz, 420.9 Hz, and 2.381 kHz.
TanhSaturator.RecordSaturated, preserving meter timing without saturating twice.See the Lean model and theorem inventory for proof assumptions and the generated interface.
The mixer and mastering chains run at the engine rate. The mastered quad, stereo, and sub outputs pass through order-8 Butterworth decimators to the host rate before master volume is applied, and the low-band cutoff range is defined in Hz so the crossovers do not move with the oversampling ratio. Meters accumulate engine samples and update once per host frame, so peak hold and RMS smoothing are counted in host frames. Performance recording decimates each recorded stream and commits one frame per host frame; the master tracks come from the output decimator. All recorded audio is scaled by 0.5 (about -6 dB) to reserve headroom for decimator overshoot, without changing the live audio or pan coordinates. Stereo extraction peak-normalizes both channels with one shared gain; see recording extraction.