Hmm, it should work with objects in the same folder as the pd file you open. I have tried that on Bela and I can remove the libpd_add_to_search_path() calls, and - as long as I pass the appropriate relative path to the _main.pd file - then abstractions that live in the same folder as _main.pd are loaded correctly, even if the program is started from a different folder. Actually, can you try with some abstractions instead of externals? Maybe the externals cannot load for other reasons, but if you get the abstractions to work, then you'll have narrowed down your problem.
On Wednesday, 13 February 2019, 12:15:59 GMT, Joseph Larralde joseph.larralde@gmail.com wrote:
Hi Giulio,
Le 13/02/19 à 11:11, Giulio Moro a écrit :
That sounds like an interesting project, although I struggle to understand how it would be used.
Yes it is :) Actually we are working on a project where we make an extensive use of nodejs for distributed local applications, so it's worth using this addon in our case (and that's the kind of scenario for which it was initially created). I must admit that for my own use, I'm only launching pd from a node server and then doing everything else in the patches ... (I was inspired to do so after trying out the Bela once, so thanks for the inspiration)
AFAIK, libpd does not search in any of the default Pd paths. It comes with a `libpd_add_to_search_path()` function that you should use to manually add the search paths. From the README of node-libpd, among the todos there is : • re-enable addToSearchPath and clearSearchPath
Thanks for explaining the path issue before I went crazy. You're right, this is written in the todos of the README, which is a bit minimalistic ...
So that is probably where the issue lies. In the meantime you can consider just copying or symlinking your externals to the current folder.
Unfortunately, copying the external to the current folder didn't help, so I guess I'll have to modify the addon a bit to re-enable the addToSearchPath method and make a PR.
From my experience of pd, I suspect this should be done at
initialization time, so I might have to modify the addon's api to provide another json field in the init method instead. Does this sound right-minded ?
Thanks, Joseph
Giulio
On Wednesday, 13 February 2019, 09:49:08 GMT, Joseph Larralde joseph.larralde@gmail.com wrote:
Hi,
A friend of mine wrote this libpd wrapper for nodejs (which is actually a work in progress) : https://github.com/ircam-jstools/node-libpd It's running fine on a pi3 I'm using ATM.
Now I need to use some externals I wrote, and I can't get them to load properly. But, they're loading when I start my test patch using pd itself.
Before diving into his wrapper code, I'd like to make sure I'm placing the externals in the right path. What makes me think it should be working is this page : https://github.com/libpd/libpd/wiki/misc And also the fact that in his code, he's calling the init() function from PdBase, which is itself calling the libpd_init() function.
I tried putting the externals into /usr/local/lib/pd-externals, /usr/local/lib/pd/extra, /usr/lib/pd/extra and ~/.local/lib/pd/extra. But still no luck ...
Can anyone confirm I'm not mistaken ?
Cheers, Joseph
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev