gogins / cloud-5

Complete browser-based computer music studio for algorithmic composition and live coding
Other
9 stars 1 forks source link

Investigate embedding Cardinal in cloud-5 similarly to Strudel #59

Closed gogins closed 9 months ago

gogins commented 9 months ago
gogins commented 9 months ago

The question is: is this just running in the sandbox, or is there an API or a hook to an API?

I'll save time by asking the Cardinal developers. _Not much help there. It's possible there is a WebAssembly LV2 host that could be used if Cardinal is compiled to WASM as an LV2 plugin. But no support for LV2 UIs._ See https://github.com/desttinghim/wasm4-lv2.

I might be able to inspect the WASM and put together an interface that could access Cardinal in an IFrame as I did with Strudel.

gogins commented 9 months ago

The exports readonly property of the WebAssembly.Instance object prototype returns an object containing as its members all the functions exported from the WebAssembly module instance, to allow them to be accessed and used by JavaScript.

gogins commented 9 months ago

The module exports show the C runtime library, the Standard C++ Library, SDL, and OpenGL. And that's it as far as I can see.

gogins commented 9 months ago

This is a Web-based host for various kinds of plugins: https://github.com/DISTRHO/Ildaeil.

I don't see how the plugin hosts are created or accessed. But Carla and DPF are Git submodules.

gogins commented 9 months ago

The code is cryptic in the extreme. Raw makefiles are used, with the options for WASM that Emscripten would use, e.g. -s options. The "shell.html" is the Web page demo of Idaeil. Internally the code references the Emscripten SDL port. It's obvious that shell.html loads the WASM binary but after that nothing at all is clear.

I am guessing that Idaeil uses Carla code and simply compiles that and a bit of glue, along with the list of plugins, to WebAssembly... and that's that!

gogins commented 9 months ago

Idaeil's license is GPL 2, not compatible with any of my code. So, I can't use this code.

If there's any way to embed Cardinal in the JavaScript context, it's going to be rather a hack.

gogins commented 9 months ago

Closing this for now. But Cardinal is great, so I'll probably try again at some point.