Spacechild1 / vstplugin

VST plugin support for Pd and SuperCollider (mirror of https://git.iem.at/pd/vstplugin). If possible, use the issue tracker at https://git.iem.at/pd/vstplugin/-/issues.
Other
87 stars 6 forks source link

Use vstplugin~ with Ofelia Emscripten #1

Closed Jonathhhan closed 4 years ago

Jonathhhan commented 4 years ago

Hi Spacechild, thanks for the nice library. I wonder if it is possible to use the vstplugin~ external together with Ofelia Emscripten. In general it should be possible to include externals to Ofelia Emscripten if the sources are included and linked. But with vstplugin~ I get some compile errors, I assume because the external wants to acceess the filesystem. This is the error message:

/home/jonathan/Schreibtisch/of_v20191215_linux64gcc6_release/addons/ofxOfelia/src/vstplugin-master/vst/Plugin.cpp:201:37: error: 
      use of undeclared identifier 'ACCESSPERMS'
    int result = mkdir(dir.c_str(), ACCESSPERMS);
                                    ^
/home/jonathan/Schreibtisch/of_v20191215_linux64gcc6_release/addons/ofxOfelia/src/vstplugin-master/vst/Plugin.cpp:205:32: error: 
      use of undeclared identifier 'ACCESSPERMS'
        if (chmod(dir.c_str(), ACCESSPERMS) == 0){
                               ^
/home/jonathan/Schreibtisch/of_v20191215_linux64gcc6_release/addons/ofxOfelia/src/vstplugin-master/vst/Plugin.cpp:734:17: warning: 
      unused variable 'ext' [-Wunused-variable]
    const char *ext = ".so";
                ^
2 warnings and 2 errors generated.
Spacechild1 commented 4 years ago

Hi, I've just pushed a fix to develop which defines ACCESSPERMS if not defined (apparantely this can happen on some systems). But this certainly won't be the last stumbling block ;-)

Apart from that, I don't think it makes sense to compile [vstplugin~] for WASM (I guess this is your target platform), unless VST plugins are available as well. Some people are definitely working on this (see https://www.youtube.com/watch?v=ORIpeFQqR9c), but I don't know if it's production ready. Once WASM VST plugins really become a thing, I can imagine adding support for it.

Jonathhhan commented 4 years ago

Thanks for your answer. Yes, WASM is the target platform. I was thinking a bit naivly the VST itself could be easily compiled to WASM too. Your link is about WAM(Web Audio Module), it is somethink like VST, but you have to port them for that. Here are some examples, they work quite well: https://www.webaudiomodules.org/wamsynths/ Those are Juce PlugIns ported to WASM if I understand it right: https://forum.juce.com/t/juce-plugins-in-webassembly/25255 But then it is perhaps the easier (and perhaps the only possible) way just to use Pure Data for sound synthesis with Ofelia Emscripten.

Spacechild1 commented 4 years ago

Ah, you're right, they didn't really port VST to WASM, but added a WAM target. Since VST plugins currently can't be built for WASM, I'm closing this for now.