Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with js libs #4

Open
emviveros opened this issue Jun 21, 2021 · 1 comment
Open

Working with js libs #4

emviveros opened this issue Jun 21, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@emviveros
Copy link

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]?

@mganss
Copy link
Owner

mganss commented Jun 22, 2021

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.

@mganss mganss added the enhancement New feature or request label Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants