Lab

kernels

The audio.js kernels each device of the registry runs in an AudioWorklet, from @audio-ui/engine: every module as published, in a string, since a worklet cannot import.

pnpm add @audio-ui/engine
import { BASS_ENHANCER_KERNELS, BINAURAL_PANNER_KERNELS, CHORUS_KERNELS, COMPANDER_KERNELS, COMPRESSOR_KERNELS, /* … */ } from "@audio-ui/engine/kernels";
audio.js@audio/biquad, @audio/dynamics-compand, @audio/dynamics-compressor, @audio/dynamics-deesser, @audio/dynamics-ducker, @audio/dynamics-envelope, @audio/dynamics-expander, @audio/dynamics-fet, @audio/dynamics-gate, @audio/dynamics-limiter, @audio/dynamics-opto, @audio/dynamics-transient-shaper, @audio/dynamics-unlimit, @audio/dynamics-varimu, @audio/dynamics-vca, @audio/effect-autowah, @audio/effect-bitcrusher, @audio/effect-chorus, @audio/effect-exciter, @audio/effect-freqshift, @audio/effect-graindelay, @audio/effect-lofi, @audio/effect-multitap, @audio/effect-noiseshaper, @audio/effect-phaser, @audio/effect-pingpong, @audio/effect-ringmod, @audio/effect-rotary, @audio/effect-stutter, @audio/effect-subbass, @audio/effect-wah, @audio/eq-crossover, @audio/eq-tilt, @audio/filter-diode-ladder, @audio/filter-korg35, @audio/filter-moog-ladder, @audio/filter-oberheim, @audio/spatial-binaural, @audio/spatial-microshift
ExportKindWhat it is
BASS_ENHANCER_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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_KERNELSconstaudio.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.

Built by Ouest Labs, the source code is available on GitHub.
RSS