Plans to make this work within web browsers? #215
Replies: 2 comments 4 replies
-
This would be amazing. Little by little, web browsers are creating open standards for every modern computer interaction. The overall goal is that they should be capable of most any interaction an OS can do. Being able to integrate CLAP into a browser environment would vastly lower the entry level for building your own DAW. It would also likely lead to a slew of new open-source DAWs being built, with CLAP plugins being the work horses. Compiling a CLAP to WASM alone would not be enough, there would also need to be some basic loader interface which could convert the plugins to a child of AudioNodes. I'm going to dare to dream for a moment, and outline what would be an amazing imaginary interaction: // Not real code, for those who skim read this isn't real.
const audioCtx = new AudioContext();
const clapLoaderWasm = await WebAssembly.instantiateStreaming(fetch("CLAP_Loader.wasm"), importObject);
const clapLoader = clapLoaderWasm .instance.exports;
//type ClapAudioNode = AudioNode & {
// renderUI(): HTMLCanvasElement;
// getParam(id): ParamObject;
//}
const plugins: ClapAudioNode[] = await clapLoader.load("./root/path/", ["eq.clap.wasm", "osc.clap.wasm", "valhalla_reverb.clap.wasm"]);
const [eq, osc, valhalla] = plugins;
osc.connect(valhalla);
valhalla.connect(eq);
eq.connect(audioCtx);
document.body.append(osc.renderUI()); If parameter states were exposed, one could even go so far as to build a web UI to control each plugin. |
Beta Was this translation helpful? Give feedback.
-
I have no clue about wasm. But if its possible at all, it should be not too difficult to build a very basic minimalistic wasm-based clap: first without any extension, then maybe only with the maybe obvious but interesting in this context: by itself, clap is pure c, so does not depend on the standard library or anything else |
Beta Was this translation helpful? Give feedback.
-
It would be really cool (if this isn't going on already) to have a simple bridge that could allow CLAP plugins to run within the web browser, something like maybe https://www.webaudiomodules.org/ is doing, using web assembly. Would something like this be possible, or is it being considered?
Beta Was this translation helpful? Give feedback.
All reactions