Modulation and distortion

Shape control motion, pitch motion, nonlinear colour and reduced-resolution textures.

Modulation changes a signal or control over time. Distortion changes the amplitude transfer, adding harmonics and colour. Combine the shared motion, filtering and nonlinear stages to make a tremolo, animated filter, tape echo, drive pedal or reduced-resolution texture.

Separate control motion from audio effects

modulation/lfo generates a waveform; modulation/slew smooths a changing value. They do not by themselves process your audio. Tremolo changes amplitude, vibrato changes delay/pitch, chorus combines detuned delay with dry material, and phaser mixes an allpass network with the original signal.

For paired mono effects, prepare separate channel histories and use the provided phase-offset controls if you want related stereo motion. Stereo adapters supply their own defined relationship. Advancing one shared LFO once per channel doubles its rate; advance it once per frame and reuse its output.

Choose the nonlinear stage

SoundStart withIntegration choice
Immediate soft drivedistortion/direct-overdrive, distortion/tone-shapeSimple transfer; add product tone/mix/trim as needed.
Oversampled shapingdistortion/drive, distortion/oversampled-waveshaper, distortion/chebyshevFixed 4× stages; account for their filter histories/alignment.
Folded or clipped colourdistortion/wavefolder, distortion/color-shaperHard corners add high-frequency energy; audition at high pitch/drive.
Complete voiced stagedistortion/voiced-overdrive, distortion/voiced-wavefolderShared shaping with tone/DC treatment and output trim.
Tape or amp characterdistortion/taper, distortion/classic-ampMulti-stage composition rather than one transfer curve.
Coarse digital texturedistortion/bitcrusher, distortion/decimator, distortion/sample-rate-reducerDifferent hold, quantization and smoothing laws.

A normalizer or hard clip is not a substitute for choosing headroom. Compare at matched output levels and test sustained, transient and silent input. Raw wavefold offsets can create DC; the voiced adapter includes DC removal. triode-stage prepares a static transfer table, rather than solving a complete dynamic amplifier circuit in the callback. A sample-rate reducer creates a sound at the existing host rate; it does not change the host’s processing rate.

Physical controls and normalized product macros are different. Map the schema value into Hz, dB, seconds or the documented ratio before calling a leaf. The DSP overview gives ranges and storage notes for the newer effect profiles.

Toolkit reference

Import paths below are suffixes of maruaudio/dsp/. Use the exported types and setters in your installed version for complete signatures and defaults.

Modulation

Import suffixPurposeSelected API
modulation/flangerShort sine-modulated fractional delay with signed feedback, phase-locked stereo support, and staged lifecycle clearing.initFlangerNode, flangerNodeTick
modulation/tremoloSine amplitude modulation with depth and phase offset; does not amplify above the dry peak by its modulation law.initTremoloNode, tremoloNodeTick
modulation/vibratoFully wet sine-swept fractional-delay vibrato state, DelayNode-ordered tick and fresh-instance-identical reset semantics.initVibratoNode, vibratoNodeTick
modulation/lfoAudio-rate low-frequency oscillator producing offset + depth * wave over the shared voice oscillator stages, so an LFO wave and an audio wave are the same curve at different rates.initLfoNode, lfoNodeTick
modulation/chorusMono chorus: a sine-modulated bounded fractional delay over the fractional-delay line, with optional regeneration, a dry/wet mix and a degrees-authored static LFO rotation for phase-locked stereo fields.initChorusNode, chorusNodeTick
modulation/phaserFour swept first-order allpass sections summed against dry, with a live relative phase-offset control for paired stereo lanes; four f32 histories are allocated once at initialization.initPhaserNode, phaserAllpassStageTick
modulation/stereo-ring-modulatorStereo ring modulation with related carrier frequencies and phase. Multiplication produces sidebands; carrier band-limiting does not remove all aliasing.initStereoRingModulatorNode, stereoRingModulatorNodeTick
modulation/glideAmplitude-dependent pitch glide as a per-quantum frequency multiplier: the Duffing-backbone initial detune, the reciprocal per-mode falloff, the one-pole envelope coefficient/step and the settled-glide activity test.glideInitialDetune, glideModeFalloff
modulation/slewShared one-pole parameter smoothing and bounded scalar slew limiter for click-sensitive controls such as delay read positions.onePoleSmoothingCoefficient, onePoleSmoothingStep
modulation/stereo-auto-pannerShared sine-LFO motion of a stereo input through the constant-power stereo pan law; exact identity at zero depthinitStereoAutoPannerNode, stereoAutoPannerNodeTick
modulation/auto-pannerMono-to-stereo equal-power sine auto-pan with prepared oscillator state.initAutoPannerNode, autoPannerNodeTick
modulation/retunePitch-correction control: retune speed, amount, humanize, transition dwell, unvoiced hold and delayed vibrato to a per-sample shift ratio.initRetune, retuneTick
modulation/f32-slewDaisySP one-pole and stmlib asymmetric rise/fall control smoothing with float32 arithmetic.f32OnePoleStep, f32AsymmetricSlewStep
modulation/warbleFirmware-derived seeded tape-wow motion over paired interpolated delay lines.initWarbleNode, warbleNodeTick
modulation/borrowed-rotaryTwo-rotor speaker approximation with independent motor inertia and caller-owned Doppler rings.initBorrowedRotary, borrowedRotaryTick

Distortion

Import suffixPurposeSelected API
distortion/bitcrusherSample-rate and bit-depth reducer: anti-imaging one-pole, held-sample phase accumulator, quantization steps, boost and dry/wet with boost compensation.initBitcrusherNode, bitcrusherNodeTick
distortion/decimatorWet-only DaisySP Decimator port: raw sample-and-hold cadence and defined fixed-point bit clearing without filtering or added latency.initDecimatorNode, decimatorNodeTick
distortion/chebyshevChebyshev first-kind polynomial waveshaper over the shared fixed-4x oversampled interpolation and FIR decimation stage.initChebyshevNode, chebyshevNodeTick
distortion/driveFixed-4x rational-drive transfer, FIR state, tick and reset semantics.initDriveNode, driveNodeTick
distortion/oversampled-waveshaperFixed 4× oversampled nonlinear transfer with prepared FIR histories.initOversampledWaveshaperNode, oversampledWaveshaperNodeTick
distortion/taperTape processor: nine-control cook, companding encode/decode, flutter fractional delay, bias slew, mid/sub split, head-bump resonators and stereo soft clip.initTaperNode, taperNodeTick
distortion/direct-overdriveDirect zero-latency DaisySP overdrive with bounded drive-dependent gain and soft clipping.initDirectOverdriveNode, directOverdriveNodeTick
distortion/tone-shapeBounded rational drive transfer with silence gating.initDistortionNode, distortionNodeTick
distortion/voiced-overdriveWet voiced drive composing transfer, input low-cut, tone filtering and output trim.initVoicedOverdriveNode, voicedOverdriveNodeTick
distortion/wavefolderDaisySP periodic triangular wavefold with signed pre-gain and offset; raw offset can produce DC and the fold intentionally aliases.initWavefolderNode, wavefolderNodeTick
distortion/voiced-wavefolderWet wavefolder composed from the Daisy fold, post-fold RBJ DC blocker, ToneFilter and output trim.initVoicedWavefolderNode, voicedWavefolderNodeTick
distortion/rational-soft-clipRational soft-limit curve x(27 + x²)/(27 + 9x²), plus its ±3-bounded soft-clip variant.rationalSoftLimit, rationalSoftClip
distortion/sample-rate-reducerFractional sample-rate reduction with interpolated crossings and PolyBLEP step smoothing; ratio is relative to host rate.initSampleRateReducerNode, sampleRateReducerTick
distortion/triode-stageBounded static triode load-line solver and prepared tone/DC filtering.initTriodeStage, triodeStageTick
distortion/octave-dividerThresholded zero-crossing octave divider with envelope, tone and DC filtering.initOctaveDivider, octaveDividerTick
distortion/jitter-reducerDeterministic sample-and-hold reducer with sampling-clock jitter.initJitterReducer, jitterReducerTick
distortion/color-shaperWet hard clipping, asymmetric saturation and rectification with tone/DC filtering.initColorShaper, colorShaperTick
distortion/classic-ampPre-cabinet amp voice: high-pass/pre-emphasis, 4× oversampled preamp/power shaping and three-band tone stack.initClassicAmpStage, classicAmpStageTick

Return to DSP fundamentals for I/O, lifecycle, units and the category map.