DISTRHO / DPF

DISTRHO Plugin Framework
ISC License
658 stars 95 forks source link

Feature - wasm: support Web Audio Modules #475

Open dromer opened 6 days ago

dromer commented 6 days ago

The WebAudioModules API implements a formalized plugin interface for the web. It would be nice if DPF wasm builds could support this: https://github.com/webaudiomodules/api

I have no idea what we need to implement this though. If it would be pure JS to wrap around our current builds or if it requires other work.

falkTX commented 6 days ago

I am kinda against that actually. we dont need yet another plugin API, we can reuse the existing ones with years of experience but just convert a few of the calls to happen on the web.

DSP shouldn't be done with javascript, that doesn't scale, we need something faster which can be web assembly. And if going with web assembly we can just use existing plugin formats, like LV2 or CLAP.

https://ildaeil.kx.studio/ demonstrates already, LV2 plugins on the web. but doesn't need to be LV2 in particular.

All recent plugin formats are extensible, so anyone wishing to have a custom GUI can just propose a way to handle that. For the uses of wasm LV2 GUIs on MOD Audio web gui pedalboard, I simply pass a unique html element id as a property to the LV2 UI instantiation, and if the UI attaches itself to that element everything works as expected.

So I really see no need to pursue yet another plugin standard, specially not this "webaudiomodules" one where it is just reinventing the wheel where they can just take e.g. CLAP and convert the C calls into a JS class or something.

sletz commented 5 days ago

DSP shouldn't be done with javascript, that doesn't scale, we need something faster which can be web assembly. And if going with web assembly we can just use existing plugin formats, like LV2 or CLAP.

This is not usually not the case: DSP is done in wasm (from C++ compiled with Emscripten, DSL like Faust or CSound..etc) and JS is used for "gluing" code.

falkTX commented 4 days ago

DSP shouldn't be done with javascript, that doesn't scale, we need something faster which can be web assembly. And if going with web assembly we can just use existing plugin formats, like LV2 or CLAP.

This is not usually not the case: DSP is done in wasm (from C++ compiled with Emscripten, DSL like Faust or CSound..etc) and JS is used for "gluing" code.

isnt that what I said?

we can reuse the existing ones with years of experience but just convert a few of the calls to happen on the web.

So do DSP in wasm, then add JS code to call into them, can even be the same calls as the plugin API for simplicity.