sebpiq / WebPd

Run your Pure Data patches on the web.
GNU Lesser General Public License v3.0
935 stars 88 forks source link

Issues integrating the compiledJS into html. #136

Closed qlambert-pro closed 1 year ago

qlambert-pro commented 1 year ago

Hi, first I want to specify that I am very new to both pure data and of course WebPd.

I am trying to interact with a simple patch I have written from an static html page, but it seems like I am misunderstanding how to do that. Here are the steps I followed:

I would expect one of them to produce a sound but nothing happens.

Can you explain what I am missing?

sebpiq commented 1 year ago

Hello @qlambert-pro !

Have you tried to compile by specifying appTemplate as output ? This compiles your patch and generates a fully working html page with instructions on how to implement interaction with your patch in the code.

The command goes like this : webpd -i yourPatch.pd -o someFolder -f appTemplate

If you still fail to get sound playing, please send me the patch, tell me what you intend to do and I'll have a look ! The library is still alpha, it is possible that there would be a bug !

qlambert-pro commented 1 year ago

I managed to play sounds!

I don't understand how the fetch call works though. I am trying to use puredata as a sound system for a small video game published on gitlab pages and I am concerned that it won't be supported there. I will try it tomorrow and see if it works.

sebpiq commented 1 year ago

@qlambert-pro fetch is standard browser API, so it will work, no problem. You just need to publish all the files (html, wasm and js) at the right place, or modify the url that is passed to the fetch accordingly ;)

qlambert-pro commented 1 year ago

You were right, it worked! Thank you very much for your help!

sebpiq commented 1 year ago

Glad it worked! Don't hesitate if you have any question! And don't hesitate to share your work once it's done.