The Partial Machine (PartialMachine in private/src/PartialMachine.hpp) is a global send effect that analyzes the incoming send bus as mono, tracks spectral partials, and resynthesizes them into the quadraphonic field.
Unlike the source machines, this is not selected per voice. It is the third global send/return processor beside the Quad Delay and Quad Reverb.
QuadMixerInternal now has three send buses:
Voices can feed the Partial Machine through PartialMachineSend in the Filter and Amp bank. The Delay and Reverb returns can also feed it through DelayPartialMachineSend and ReverbPartialMachineSend.
The Partial Machine return is mixed into the main quad output, and it can feed the other send effects through PartialMachineDelaySend and PartialMachineReverbSend. Encoder 3,3 (PartialMachineVolume) is the mixer return gain, the same scalar path as Delay Return and Reverb Return. Internal reduction volume is held at unity.
The processor sums each engine-rate quad sample to mono and decimates it with an order-8 Butterworth DownsamplerGeneric, writing one sample per host frame into a 4096-host-sample analysis buffer. Every 1024 host samples, it Hann-windows the buffer and calls SpectralModelGeneric<12, FrequencyDependentParameter>::ExtractAtomsAndResidual. Peak frequencies are interpolated between bins; magnitude and frame-start phase are fitted against the same Hann kernel used to write partials. Each fitted partial is subtracted immediately from the analysis spectrum. The remaining bin magnitudes feed the smoothed residual model.
Each tracked atom carries:
During synthesis, each atom is reduced, pitch-shifted, optionally expanded into unison copies, panned into quad, and written to one four-lane synthesis DFT (SynthesisDFT). Each panned copy evaluates its phase and Hann kernel once and scales the magnitude by the pan vector across all four channels. The residual model adds smoothed broadband energy with randomized phase to the same frame, using the same panned bin-centered Hann write. The spectrum stays on the 4096-point host-rate grid, with partial frequencies in cycles per host sample. InverseTransform interpolates it into one engine-rate quad frame of 4096 * x_oversample samples (the same 85.333 ms), and the generic OLAGeneric overlap-adds the frames, launched every 1024 * x_oversample engine samples, into a continuous quad signal. The synthesis window comes from the partial writers; the OLA adds no window or normalization of its own. Tracked atoms come from the input analysis; synthetic harmonic atoms and their separate mix gains have been removed.
Residual reduction feedback preserves zero envelopes. Its magnitude floor is capped by the current envelope, allowing quiet residual tails to decay below the atom death threshold without creating a persistent noise floor.
PartialMachineDensity controls a frequency window measured in octaves. Its range is exponential from one cent to one octave. Counterclockwise gives a broad window, allowing a strong new partial to replace nearby older partials even when their decay is long. Clockwise gives a narrow window, allowing old and new partials to coexist more readily.
Density does not enforce minimum spacing between partials or choose how many partials the sound may contain. A separate 256-partial budget keeps the strongest analysis peaks before matching and the strongest synthesis magnitudes after each update. This bounds matching to at most 256 old atoms by 256 incoming peaks during normal processing. Extraction still examines the full spectrum; discarded analysis peaks have already been subtracted and are not restored to the residual.
AtomMatcher sorts existing atoms by their held analysis-frequency targets and sorts new peaks by frequency. It chooses a one-to-one assignment that preserves that order and maximizes the total score:
theta = analysisMagnitude * max(0, 1 - octaveDistance / density)
The distance is measured from the old atom’s held target, before portamento, detune, or pitch shift. Matching uses density at the old atom’s stored parameter index and excludes peaks below 0.001 times its synthesis magnitude. Equal total scores prefer more matches. Assignment is completed before any tracked frequency or magnitude changes, so synthesis-magnitude order cannot give the first atom a greedy claim on a neighbor’s continuation. The matcher uses Hirschberg reconstruction with quadratic time in the two atom counts and linear member-owned workspace.
A matched atom changes its held pitch target only when the incoming raw analysis magnitude is at least its synthesis magnitude before the envelope update. A weaker match still updates the analysis magnitude and decay envelope, but retains the accepted frequency, cached log frequency, phase, and parameter index. This prevents a quiet peak from moving a loud tail’s target or matching anchor. A later stronger peak can take over normally; this is not a permanent latch.
The hold occurs before portamento. Every surviving matched or unmatched atom continues gliding toward its held target at the normal portamento rate. Attack, decay, and portamento use the held target’s parameter index; a stronger accepted peak updates that index before those controls are evaluated.
An unmatched old atom normally decays. A strong nearby analysis peak can kill it immediately, whether that peak matched another atom or will become a new one: if the peak’s weighted score theta exceeds the old synthesis magnitude, that atom is zeroed and removed before the next synthesis frame. Equality or a weaker cone leaves ordinary decay intact. Already queued overlap-add windows finish normally.
Selection and suppression both evaluate density at the old atom’s stored parameter index, so differing lane values do not change the cone between those two steps.
Every unclaimed analysis peak at or above the death magnitude, 1e-5, starts a new atom. Its initial synthesis magnitude is the attack slew from zero, floored at 1e-5. Attack governs new-atom fade-in and upward tracking; it does not delay suppression by raw analysis peaks. No input peaks means ordinary decay of the existing pad. No existing atoms means all eligible peaks can start new atoms.
Pitch shift and unison scale both the emitted frequency and emitted phase. The stored synthesis phase keeps its original unshifted advance of 1024 * synthesisOmega per hop; each emitted copy uses synthesisPhase * detune * pitchShiftRatio.
The spectral controls use four parameter lanes through FrequencyDependentParameter. A spectral atom asks for the parameter index associated with its analysis frequency, then interpolates between neighboring lanes. Positive parameters interpolate geometrically; bipolar pitch and unison use linear interpolation. The lane pattern wraps from the fourth lane back to the first. Return gain and cross-effect sends are mixer controls.
By default, a Quad bank parameter has the same base value in all four lanes, so the parameter behaves like a normal scalar control. If modulation, gestures, or scene state make the four lanes differ, each frequency maps to a different interpolated value. This turns the Partial Machine into a frequency-dependent processor where lows, mids, highs, and moving in-between regions can evolve with unique attack, decay, density, bandwidth, panning, unison, pitch, and level behavior.
PartialMachineLinearFrequency controls how the frequency axis is folded across the four lanes. Increasing it makes the parameter pattern repeat more quickly across frequency, creating denser spectral variation.
The Partial Machine bank exposes four rows of quad-bank controls:
PartialMachineAttack, PartialMachineDecay, PartialMachineDensity, and PartialMachinePortamento control magnitude slew, replacement versus coexistence, and frequency glide.PartialMachineBWBase, PartialMachineBWWidth, and PartialMachineReductionFeedback shape how strongly each atom survives the reduction curve.PartialMachineBassCutoff, PartialMachineAzimuthFactor, PartialMachineUnison, PartialMachineDelaySend, and PartialMachineReverbSend place atoms in the quad field and route the return into the other effects.PartialMachineLinearFrequency, PartialMachinePitchShiftDepth, and PartialMachinePitchShift control frequency-dependent indexing and pitch offset. PartialMachineVolume is the mixer return gain, not a frequency-dependent atom level.PartialMachineBassCutoff controls radius. Frequencies below the cutoff collapse toward the center. Radius rises as log2(frequency / cutoff) / 3 and reaches one at eight times the cutoff. Pan coordinates use a tanh-shaped orbit with input gain 2 * radius.
PartialMachineAzimuthFactor maps frequency to azimuth. With frequency-dependent modulation, different regions of the spectrum can orbit, widen, or cluster independently.
PartialMachineUnison creates up to five copies per atom: the center and two detuned, azimuth-offset pairs. Their gains are RMS-normalized; overlapping copies can still reinforce or cancel, so this is not a loudness guarantee.
The Partial Machine bank adds three visualizers:
PartialMachineAnalyzer: quad analyzer for the Partial Machine return, including the per-speaker frequency response overlay.PartialMachineInputSpectrum: mono input spectrum with tracked atoms drawn over the incoming Partial Machine send.PartialMachineSpatial: spatial atom view showing each tracked atom’s quad position and reduced magnitude.The shared quad analyzer also includes a Partial Machine scope, and effect-bank analyzer overlays can show Delay, Reverb, and Partial Machine responses together.