DSP library
Reusable, prepared audio building blocks for filters, effects, synthesis, and analysis.
@maruaudio/dsp is the reusable signal-processing library behind modules
and processors. It provides focused leaves with explicit state, configuration,
per-sample processing, and reset behavior. A module composes the leaves it
needs with the Audio SDK; it does not need a separate
browser or native DSP implementation.
The library is designed for prepared realtime use. Allocate persistent state before processing, update controls through named setters, then tick the leaf in the audio callback. Product modules own their parameters, routing, presets, and user interface.
Effects
Filters and EQ
- RBJ biquad filters and tone stages
- State-variable responses
- Parametric, three-band, and fixed-band EQ building blocks
- Envelope and LFO filter composites
- Bounded direct FIR convolution
Dynamics
- Peak and RMS envelope followers
- Keyed and linked stereo compression
- Gates, hold behavior, and downward expansion
- Transient shaping with mid and side balance
- Lookahead limiting for products that declare its alignment
Drive and destruction
- Tone shaping and direct overdrive
- Bitcrusher and Decimator reduction
- Wavefolder and voiced drive stages
- Oversampled waveshaping and Chebyshev shaping
- Tape-style companding, flutter, bias, and head-bump stages
Delays
- Bounded and fractional delay lines
- Feedback and ping-pong delay structures
- Saturated feedback and cross-feed stereo delay
- Click-safe retuning and staged clearing primitives
Modulation
- Chorus, flanger, phaser, tremolo, and vibrato
- LFOs, glide, and bounded parameter slew helpers
- Auto panning and stereo modulation utilities
- Dual-carrier ring modulation
Space, stereo, and spectral
- Schroeder, Dattorro, and feedback delay network reverbs
- Stereo width, panning, and stereo-to-mono utilities
- Single-sideband frequency shifting
- Bounded pitch shifting and channel vocoding primitives
Synthesis and analysis
Synthesis and physical sound
- Band-limited and variable-shape oscillators
- ADSR and other envelope primitives
- Modal resonators, mallets, strikes, and radiation stages
- Deterministic noise and wavetable/sample readers
Analysis and composition
- Streaming pitch detection
- Deterministic MIDI timelines
- One-to-six slot serial-effect scheduling
- Control gain, level, mix, and decibel helpers
Use focused imports
Import the leaf your processor needs, initialize its state during preparation, and retain that state for the callback. A narrow import makes the dependency and the eventual compiled closure clear.
import {
BIQUAD_LOWPASS,
biquadNodeTick,
initBiquadNode,
setBiquadNodeFrequency,
setBiquadNodeQ,
setBiquadNodeType,
updateBiquadNodeCoefficients,
} from "@maruaudio/dsp/filters/biquad"
const filter = initBiquadNode(48_000)
setBiquadNodeType(filter, BIQUAD_LOWPASS)
setBiquadNodeFrequency(filter, 2_400)
setBiquadNodeQ(filter, 0.7071)
updateBiquadNodeCoefficients(filter)
function process(input: number): number {
return biquadNodeTick(filter, input)
}
Use the leaf documentation and exported bounds to choose valid parameter ranges. Stateful leaves also export reset functions. Prepared storage, clear behavior, and the product's dry/wet policy belong to the consumer.
From a leaf to a module
The DSP library supplies algorithms and controls. The Audio SDK supplies module declarations, ports, parameter schemas, saved state, and host activation. Use the module boundary for a musician-facing product and keep its DSP source in the module's processor implementation.
Many leaves can be tested directly in JavaScript and compiled as part of a Processor. How it works introduces the module workflow; Export explains how projects are built and verified for their supported targets.
Qualification is specific to a product and target
The presence of a reusable leaf does not promise that every composition is available in every host, has zero processing alignment, or matches a named commercial effect. A module chooses its topology and controls, then qualifies the selected source and target combination for audio quality, state, and realtime behavior.
Parity and determinism describes the checks used to compare repeatable scenarios across supported runtimes.