“library_setup()” in this case is probably “xsample_setup();”
EDIT: Looks like it might be “xsample_main()” judging from the main.cpp, although the usual pd external conventions noted in the readme is LIBRARYNAME_setup(). In this case, xsample is using Flext which abstracts writing dsp externals between pd and max so I imagine “xsample_setup()” is probably declared via Flext for compatibility with pd.
Yeah, that’s due to the instance functions not being currently thread safe and the main and audio threads trying to grab them at the same time. I added a mutex to the example so it no longer segfaults.
Is there a way to get around the dropouts you get when you refill a soundfiler? Is this is due to soundfiler not being multithreaded?
We have to do this dynamically in app. At the moment we use ofsoundplayer to mask the loading dropouts whilst PD silently starts and stops underneath.
This feels a bit hacks to me, so I was wondering if there was any c++ trickery that can solve this issue
I created a “reinit” branch which automatically reinits the libpd audio settings if the current values are different than the incoming sound stream values aka buffer size & number of channels. This should be helpful on iOS since the incoming buffer size seems to change depending on other apps.
Awesome, thanks! I’ve been using a somewhat hacky way of doing this in the past, but this solution is much better. I’ll give it a try when I can get a few minutes.
Went ahead and merged the reinit branch. Seems to be working as far as I can tell. Note: produces a verbose log print on a change, so turn on verbosity when debugging.
Sorry, i should have followed up…
I found that i had to define the AudioSession Category, ofSoundplayer seemed to set it as just Playback, not Playback and record.
Also I’ve found that ofSoundplayer crashes on iPhone 6s, i beleiiive to be because of the 48Khz capability
gotcha, so it’s a case of making sure that sample calculations for timings etc within PD are done using a value relative to the sample rate, not just a fixed int of 44100.
ofxPd now updated to libpd 0.9.0 which include pd vanilla 0.47-0:
new clone object
expr now BSD licensed
Also, now that OF uses C++11, ofxPd now uses the PdBase std::mutex.
It is recommended to regenerate your projects with the ProjectGenerator as there are new pd source files and a define which needs to be set for the mutex.
Hey guys, I am interested in using this addon too. But I am on Windows so wondering if it’s even remotely possible: I don’t use Code::block anymore, looking for a solution for either Visual Studio or Qt Creator.
So far I couldn’t find anything compiling but looking at the libpd page, I see that it can be compiled on Windows using msys2, which is installed on my computer since it is needed for Qt Creator.
Do you guys have any hint if it would be possible to compile libpd with msys2, then include it in Qt Creator for example?
If the openFrameworks Project Generator can generate QT Creator project files, it should build fine in QT Creator as long as it’s using MinGW & the gcc compiler on Windows. libpd currently doesn’t compile well in Visual Studio, but should be fine in gcc.
I’ve updated ofxPd to use Semantic Versioning. The changelog has been updated and ofxPd-specific version tags to replace the previous tags which were based on OF versions.