audio/ui
Toggle Mode D
Copy to Clipboardpnpm dlx shadcn@latest add @audio-ui/engine-kernels
Copy to Clipboardimport { BASS_ENHANCER_KERNELS, BINAURAL_PANNER_KERNELS, CHORUS_KERNELS, COMPANDER_KERNELS, COMPRESSOR_KERNELS, /* … */ } from "@/lib/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.3.1 (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.2.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.1.1 (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.2.1 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, timeCoef, GLIDE, glide, as module2 - @audio/dynamics-compand 0.2.1 (MIT, Dmitry Iv.): compand, compandStream, compandBlock, as module3 - @audio/dynamics-compand 0.2.1 (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.): db2lin, lin2db, writer, concat, as module2 - @audio/dynamics-compressor 0.2.1 (MIT, Dmitry Iv.): compressor, compressorStream, compressorGain, upwardGain, as module3 - @audio/dynamics-vca 0.3.1 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, timeCoef, keyed, link, linAt, coefAt, GLIDE, glide, as module4 - @audio/dynamics-vca 0.3.1 (MIT, Dmitry Iv.): vca, vcaStream, vcaBlock, vcaLevel, vcaGain, as module5 - @audio/dynamics-vca 0.3.1 (MIT, Dmitry Iv.): vca - @audio/dynamics-fet 0.3.1 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, timeCoef, keyed, link, linAt, coefAt, GLIDE, glide, as module7 - @audio/dynamics-fet 0.3.1 (MIT, Dmitry Iv.): fet, fetStream, fetBlock, fetLevel, fetGain, as module8 - @audio/dynamics-fet 0.3.1 (MIT, Dmitry Iv.): fet - @audio/dynamics-opto 0.3.1 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, timeCoef, keyed, link, linAt, coefAt, GLIDE, glide, as module10 - @audio/dynamics-opto 0.3.1 (MIT, Dmitry Iv.): opto, optoStream, optoBlock, optoLevel, optoGain, as module11 - @audio/dynamics-opto 0.3.1 (MIT, Dmitry Iv.): opto - @audio/dynamics-varimu 0.3.1 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, timeCoef, GLIDE, glide, as module13 - @audio/dynamics-varimu 0.3.1 (MIT, Dmitry Iv.): varimu, varimuStream, varimuBlock, as module14 - @audio/dynamics-varimu 0.3.1 (MIT, Dmitry Iv.): varimu - @audio/dynamics-compressor 0.4.1 (MIT, Dmitry Iv.): db2lin, lin2db, timeCoef, writer, concat, keyed, link, linAt, coefAt, GLIDE, glide, as module16 - @audio/dynamics-compressor 0.4.1 (MIT, Dmitry Iv.): compressor, compressorStream, compressorState, compress, compressBlock, compressLevel, compressGain, gainDb, detector, smoother, compressorGain, upwardGain, as module17 - @audio/dynamics-compressor 0.4.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.): db2lin, lin2db, writer, concat, as module2 - @audio/dynamics-compressor 0.2.1 (MIT, Dmitry Iv.): compressor, compressorStream, compressorGain, upwardGain, as module3 - @audio/biquad 1.3.0 (MIT, Dmitry Iv.): lowpass, highpass, bandpass, notch, allpass, peaking, lowshelf, highshelf, state, process, step, cascade, filter, magnitude, cascadeMagnitude, tail, as module4 - @audio/dynamics-deesser 0.5.2 (MIT, Dmitry Iv.): writer, concat, db2lin, lin2db, timeCoef, as module5 - @audio/dynamics-deesser 0.5.2 (MIT, Dmitry Iv.): latency, tail, deesser, deesserStream, deesserSet, deesserState, deesserBand, deessBlock, as module6 - @audio/dynamics-deesser 0.5.2 (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.2.1 (MIT, Dmitry Iv.): pingPong - @audio/effect-multitap 1.1.8 (MIT, Dmitry Iv.): multitap - @audio/effect-graindelay 1.2.1 (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.): db2lin, lin2db, writer, concat, as module2 - @audio/dynamics-compressor 0.2.1 (MIT, Dmitry Iv.): compressor, compressorStream, compressorGain, upwardGain, as module3 - @audio/dynamics-ducker 0.2.1 (MIT, Dmitry Iv.): db2lin, lin2db, timeCoef, writer2, concat, keyed, GLIDE, glide, as module4 - @audio/dynamics-ducker 0.2.1 (MIT, Dmitry Iv.): ducker, duckerStream, duckBlock, as module5 - @audio/dynamics-ducker 0.2.1 (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.3 (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.3.1 (MIT, Dmitry Iv.): db2lin, lin2db, timeCoef, writer, concat, keyed, link, linAt, coefAt, GLIDE, glide, as module2 - @audio/dynamics-expander 0.3.1 (MIT, Dmitry Iv.): expander, expanderStream, expandBlock, expandLevel, expandGain, expanderGain, upwardExpanderGain, as module3 - @audio/dynamics-expander 0.3.1 (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.3.1 (MIT, Dmitry Iv.): moogLadder - @audio/filter-diode-ladder 1.3.1 (MIT, Dmitry Iv.): diodeLadder - @audio/filter-korg35 1.3.1 (MIT, Dmitry Iv.): korg35 - @audio/filter-oberheim 1.3.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.2.1 (MIT, Dmitry Iv.): frequencyShifter - @audio/effect-ringmod 1.1.7 (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.2.1 (MIT, Dmitry Iv.): writer, concat, db2lin, timeCoef, keyed, link, linAt, coefAt, GLIDE, glide, as module2 - @audio/dynamics-gate 0.2.1 (MIT, Dmitry Iv.): gate, gateStream, gateState, gateBlock, gateLevel, gateGain, as module3 - @audio/dynamics-gate 0.2.1 (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.3.1 (MIT, Dmitry Iv.): writer, concat, db2lin, timeCoef, link, linAt, coefAt, as module0 - @audio/dynamics-limiter 0.3.1 (MIT, Dmitry Iv.): limiter, latency, limiterStream, limiterLine, as module1 - @audio/dynamics-limiter 0.3.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.2.1 (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.2.1 (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.2.1 (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.7 (MIT, Dmitry Iv.): bitcrusher - @audio/effect-noiseshaper 1.1.7 (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.3.0 (MIT, Dmitry Iv.): step, state - @audio/effect-rotary 0.2.1 (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.2.1 (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.3.0 (MIT, Dmitry Iv.): lowshelf, highshelf, filter - @audio/eq-tilt 1.3.1 (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.2.1 (MIT, Dmitry Iv.): transientShaper, transientSet, transientBlock, as module0 - @audio/dynamics-transient-shaper 0.2.1 (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.): db2lin, lin2db, writer, concat, as module2 - @audio/dynamics-expander 0.2.2 (MIT, Dmitry Iv.): expander, expanderStream, expanderGain, upwardExpanderGain, as module3 - @audio/dynamics-unlimit 0.2.1 (MIT, Dmitry Iv.): db2lin, lin2db, timeCoef, writer, concat, GLIDE, glide, as module4 - @audio/dynamics-unlimit 0.2.1 (MIT, Dmitry Iv.): unlimit, unlimitStream, unlimitState, unlimitBlock, unlimitGain, unlimitDeficitGain, as module5 - @audio/dynamics-unlimit 0.2.1 (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.7 (MIT, Dmitry Iv.): autoWah - @audio/effect-wah 1.2.1 (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:
Copy to Clipboardimport { DELAY_KERNELS } from "@/lib/engine/kernels"; import { loadWorklet } from "@/lib/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 engine:kernels in apps/www, and a test fails when one no longer matches its package, after a version bump.