pnpm add @audio-ui/engine
import { BASS_ENHANCER_KERNELS, BINAURAL_PANNER_KERNELS, CHORUS_KERNELS, COMPANDER_KERNELS, COMPRESSOR_KERNELS, /* … */ } from "@audio-ui/engine/kernels";| Export | Kind | What it is |
|---|---|---|
BASS_ENHANCER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/effect-subbass 1.2.0 (MIT, Dmitry Iv.): subbass |
BINAURAL_PANNER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/spatial-binaural 0.1.1 (MIT, Dmitry Iv.): binaural |
CHORUS_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/effect-chorus 2.0.2 (MIT, Dmitry Iv.): chorus |
COMPANDER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): timeCoef, as module0 - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): envelope, as module1 - @audio/dynamics-compand 0.1.7 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, as module2 - @audio/dynamics-compand 0.1.7 (MIT, Dmitry Iv.): compandStream, as module3 - @audio/dynamics-compand 0.1.7 (MIT, Dmitry Iv.): compand |
COMPRESSOR_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): timeCoef, as module0 - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): envelope, as module1 - @audio/dynamics-compressor 0.2.1 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, as module2 - @audio/dynamics-compressor 0.2.1 (MIT, Dmitry Iv.): compressorGain, as module3 - @audio/dynamics-vca 0.2.5 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, timeCoef, as module4 - @audio/dynamics-vca 0.2.5 (MIT, Dmitry Iv.): vcaStream, as module5 - @audio/dynamics-vca 0.2.5 (MIT, Dmitry Iv.): vca - @audio/dynamics-fet 0.2.5 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, timeCoef, as module7 - @audio/dynamics-fet 0.2.5 (MIT, Dmitry Iv.): fetStream, as module8 - @audio/dynamics-fet 0.2.5 (MIT, Dmitry Iv.): fet - @audio/dynamics-opto 0.2.5 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, timeCoef, as module10 - @audio/dynamics-opto 0.2.5 (MIT, Dmitry Iv.): optoStream, as module11 - @audio/dynamics-opto 0.2.5 (MIT, Dmitry Iv.): opto - @audio/dynamics-varimu 0.2.4 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, timeCoef, as module13 - @audio/dynamics-varimu 0.2.4 (MIT, Dmitry Iv.): varimuStream, as module14 - @audio/dynamics-varimu 0.2.4 (MIT, Dmitry Iv.): varimu - @audio/dynamics-compressor 0.3.1 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, timeCoef, as module16 - @audio/dynamics-compressor 0.3.1 (MIT, Dmitry Iv.): compress, compressorState, as module17 - @audio/dynamics-compressor 0.3.1 (MIT, Dmitry Iv.): compressor |
DEESSER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): timeCoef, as module0 - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): envelope, as module1 - @audio/dynamics-compressor 0.2.1 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, as module2 - @audio/dynamics-compressor 0.2.1 (MIT, Dmitry Iv.): compressorGain, as module3 - @audio/biquad 1.2.2 (MIT, Dmitry Iv.): lowpass, highpass, step, state, as module4 - @audio/dynamics-deesser 0.4.1 (MIT, Dmitry Iv.): writer, db2lin, timeCoef, smoother, as module5 - @audio/dynamics-deesser 0.4.1 (MIT, Dmitry Iv.): deesserStream, latency, as module6 - @audio/dynamics-deesser 0.4.1 (MIT, Dmitry Iv.): deesser |
DELAY_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/effect-pingpong 1.1.5 (MIT, Dmitry Iv.): pingPong - @audio/effect-multitap 1.1.6 (MIT, Dmitry Iv.): multitap - @audio/effect-graindelay 1.1.6 (MIT, Dmitry Iv.): graindelay |
DUCKER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): timeCoef, as module0 - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): envelope, as module1 - @audio/dynamics-compressor 0.2.1 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, as module2 - @audio/dynamics-compressor 0.2.1 (MIT, Dmitry Iv.): compressorGain, as module3 - @audio/dynamics-ducker 0.1.9 (MIT, Dmitry Iv.): db2lin, lin2db, as module4 - @audio/dynamics-ducker 0.1.9 (MIT, Dmitry Iv.): ducker |
EXCITER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/effect-exciter 1.2.1 (MIT, Dmitry Iv.): exciter |
EXPANDER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): timeCoef, as module0 - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): envelope, as module1 - @audio/dynamics-expander 0.2.2 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, as module2 - @audio/dynamics-expander 0.2.2 (MIT, Dmitry Iv.): expanderGain, upwardExpanderGain, as module3 - @audio/dynamics-expander 0.2.2 (MIT, Dmitry Iv.): expander |
FILTER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/filter-moog-ladder 1.2.0 (MIT, Dmitry Iv.): moogLadder - @audio/filter-diode-ladder 1.2.2 (MIT, Dmitry Iv.): diodeLadder - @audio/filter-korg35 1.2.1 (MIT, Dmitry Iv.): korg35 - @audio/filter-oberheim 1.2.1 (MIT, Dmitry Iv.): oberheim |
FREQUENCY_SHIFTER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/effect-freqshift 1.1.6 (MIT, Dmitry Iv.): frequencyShifter - @audio/effect-ringmod 1.1.5 (MIT, Dmitry Iv.): ringMod |
GATE_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): timeCoef, as module0 - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): envelope, as module1 - @audio/dynamics-gate 0.1.7 (MIT, Dmitry Iv.): writer, concat, db2lin, timeCoef, as module2 - @audio/dynamics-gate 0.1.7 (MIT, Dmitry Iv.): gateStream, as module3 - @audio/dynamics-gate 0.1.7 (MIT, Dmitry Iv.): gate |
LIMITER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/dynamics-limiter 0.2.1 (MIT, Dmitry Iv.): writer, concat, db2lin, timeCoef, as module0 - @audio/dynamics-limiter 0.2.1 (MIT, Dmitry Iv.): limiterStream, latency, as module1 - @audio/dynamics-limiter 0.2.1 (MIT, Dmitry Iv.): limiter |
LOFI_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/effect-lofi 1.1.6 (MIT, Dmitry Iv.): lofi |
MID_SIDE_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/spatial-microshift 1.1.3 (MIT, Dmitry Iv.): shifter |
PHASER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/effect-phaser 1.1.6 (MIT, Dmitry Iv.): phaser |
REDUX_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/effect-bitcrusher 1.1.5 (MIT, Dmitry Iv.): bitcrusher - @audio/effect-noiseshaper 1.1.5 (MIT, Dmitry Iv.): noiseShaping |
ROTARY_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - digital-filter 2.4.3 (MIT, Dmitry Iv.): polesSos - digital-filter 2.4.3 (MIT, Dmitry Iv.): butterworth - digital-filter 2.4.3 (MIT, Dmitry Iv.): linkwitzRiley - @audio/eq-crossover 1.0.2 (MIT, Dmitry Iv.): crossover - @audio/biquad 1.2.2 (MIT, Dmitry Iv.): step, state - @audio/effect-rotary 0.1.2 (MIT, Dmitry Iv.): rotary |
STUTTER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/effect-stutter 1.1.6 (MIT, Dmitry Iv.): stutter |
TILT_EQ_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/biquad 1.2.2 (MIT, Dmitry Iv.): lowshelf, highshelf, filter - @audio/eq-tilt 1.2.3 (MIT, Dmitry Iv.): tilt |
TRANSIENT_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/dynamics-transient-shaper 0.1.6 (MIT, Dmitry Iv.): transientShaper, as module0 - @audio/dynamics-transient-shaper 0.1.6 (MIT, Dmitry Iv.): transientShaper |
UNLIMITER_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): timeCoef, as module0 - @audio/dynamics-envelope 0.1.4 (MIT, Dmitry Iv.): envelope, as module1 - @audio/dynamics-expander 0.2.2 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, as module2 - @audio/dynamics-expander 0.2.2 (MIT, Dmitry Iv.): upwardExpanderGain, as module3 - @audio/dynamics-unlimit 0.1.2 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, as module4 - @audio/dynamics-unlimit 0.1.2 (MIT, Dmitry Iv.): unlimitGain, unlimitDeficitGain, as module5 - @audio/dynamics-unlimit 0.1.2 (MIT, Dmitry Iv.): unlimit |
WAH_KERNELS | const | audio.js kernels, each module as published, in its own scope, for an AudioWorklet, which cannot import them: - @audio/effect-autowah 1.1.5 (MIT, Dmitry Iv.): autoWah - @audio/effect-wah 1.1.5 (MIT, Dmitry Iv.): wah |
Usage
An AudioWorklet cannot import a module, so a processor that runs audio.js code carries it with it. Each constant here is a device's kernels, every module as published in its own scope, with its package's name, version and license in the comment above it. A device writes its processor after them and loads the whole with loadWorklet:
import { DELAY_KERNELS } from "@audio-ui/engine/kernels";
import { loadWorklet } from "@audio-ui/engine/worklet";
const DELAY_WORKLET = `${DELAY_KERNELS}
class DelayProcessor extends AudioWorkletProcessor { /* calls pingPong, multitap, graindelay */ }
registerProcessor("audioui-delay", DelayProcessor);`;
await loadWorklet(ctx, DELAY_WORKLET);The strings are written from the installed packages by bun run kernels:build in packages/engine, and a test fails when one no longer matches its package, after a version bump.