pnpm add @audio-ui/engine
import { highshelf, lowshelf, magnitude, compandStream, compressorGain, /* … */ } from "@audio-ui/engine/dsp";| Export | Kind | What it is |
|---|---|---|
highshelf | function | High-shelf. |
lowshelf | function | Low-shelf. |
magnitude | function | |H(f)| of one section at frequency f — analysis/plotting. |
compandStream | function | { write, flush } streaming primitive underlying the default export's streaming form. |
compressorGain | function | Soft-knee downward compression curve. |
compressor | const | The smooth compressor's manifest: an AudioWorklet processor's parameters and state, as its package publishes them. |
deesser | const | The de-esser's manifest: its processor's parameters and latency. |
expanderGain | function | Soft-knee downward expansion curve. |
upwardExpanderGain | function | Soft-knee upward expansion curve — the above-threshold complement of expanderGain. |
expander | const | The expander's manifest: its processor's parameters and modes. |
fet | const | The FET compressor model's manifest. |
limiterLatency | function | Samples the output trails the input by: the lookahead, and 96 with truePeak. |
opto | const | The opto compressor model's manifest. |
unlimitDeficitGain | function | adaptive (default) pure mapping: transient deficit (crestTarget − peak-held transientness) → target lift (dB), gated by onset presence. |
unlimitGain | function | adaptive:false pure mapping: transientness (fast-over-slow envelope gap, dB) → target lift (dB), before ballistic smoothing. |
unlimit | const | The de-limiter's manifest: its processor's parameters. |
varimu | const | The vari-mu compressor model's manifest. |
vca | const | The VCA compressor model's manifest. |
distortion | function | Mutates data in place and returns the same reference. |
diodeLadder | function | The diode ladder filter, run over a buffer in place. |
korg35 | function | The Korg35 filter, run over a buffer in place. |
moogLadder | function | The Moog ladder filter, two or four poles, run over a buffer in place. |
oberheim | function | The Oberheim SEM state-variable filter, run over a buffer in place. |
dattorro | function | Process in place. |
fdn | function | Process in place. |
freeverb | function | Process in place. |
schroeder | function | Process a mono buffer in place; returns the same array. |
spring | function | Process a mono buffer in place; returns the same array. |
Usage
A device describes its parameters itself, and takes the processors it is made of from here: the models a compressor offers, the gain curve a panel draws, the circuits of a filter, the reverbs a room is rendered with. They are the audio.js atoms' own, under the names the devices use, so a project depends on @audio-ui/engine and not on each atom:
import { compressorGain, moogLadder } from "@audio-ui/engine/dsp";
// At -10 dB in, a -20 dB threshold, 4:1 and a 6 dB knee: -7.5 dB of gain.
compressorGain(-10, -20, 4, 6);| What | Exports |
|---|---|
Dynamics models, each the manifest of an AudioWorklet processor | compressor, fet, opto, varimu, vca, deesser, expander, unlimit |
| Gain curves, for a panel's transfer curve | compressorGain, expanderGain, upwardExpanderGain, unlimitGain, unlimitDeficitGain, compandStream |
| Filter circuits | moogLadder, diodeLadder, korg35, oberheim |
| Reverbs | dattorro, fdn, freeverb, schroeder, spring |
| Shaping and filters | distortion, lowshelf, highshelf, magnitude, limiterLatency |
A device's engine runs the same atoms in an AudioWorklet through kernels.