Working with js libs
emviveros opened this issue · comments
I'm start learning pdjs to check the possibility of run js libs in Pd ecosystem, like Essentia.js.
I can see now pdjs don't work well with js modules very well, export, import and require doesn't seem to work. I'm wrong?
What is missing for these libraries to be accessible via pdjs? And there is someday possible to work with dsp audio streams? Maybe using [block]?
I can see now pdjs don't work well with js modules very well, export, import and require doesn't seem to work. I'm wrong?
Correct. Modules are not supported currently.
What is missing for these libraries to be accessible via pdjs? And there is someday possible to work with dsp audio streams? Maybe using [block]?
Having support for modules would require adding the module-specific glue code to V8. Something like this: https://stackoverflow.com/questions/52023157/how-would-one-enable-and-use-es6-modules-in-the-v8-javascript-engine
About audio: Theoretically, yes. It would require adding code to interface the PD external signal handling function to JS. On the JS side it would probably mean dealing with raw sample data. The Web Audio API is not available in V8 because it is part of the browser, not the JS engine.