@audio/compile
v0.1.3
Published
Compile audio.js atoms to audio plugin targets — AudioWorklet, WAM, CLAP, VST3, AU, LV2
Readme
@audio/compile
Compile audio.js atoms to audio plugin targets — AudioWorklet, WAM, CLAP, VST3, AU, LV2.
A single JS factory function with attached metadata becomes a plugin for every host — same source, every target. This package holds the contract (CONTRACT.md, GUIDE.md) and the compiler CLI.
Status
- [ ] CLI + native-binary targets (CLAP, VST3, AU, LV2) — land with the WASM compiler
- [x] WAM / AudioWorklet (JS runtime) — ships as
@audio/wam - [x] batch / stream hosting — ships in the engine as
audio/batch;audio.use(atom)hosts factories natively
The contract
export const gain = (ctx) => (inputs, outputs, params) => {
let g = 10 ** (params.value[0] / 20)
let inp = inputs[0], out = outputs[0]
for (let c = 0; c < inp.length; c++)
for (let i = 0; i < inp[c].length; i++)
out[c][i] = inp[c][i] * g
}
gain.params = {
value: { type: 'number', min: -60, max: 6, default: 0 }
}Ship it as audio.js in your package with an "audio": "./audio.js" field — every host and this compiler finds it. See CONTRACT.md for the full shape and GUIDE.md for examples, coverage, and migration.
