I've been trying to get data to stream from a Pd patch running with the pd-extended engine to a libpd embedded engine and am having no luck.
I've tried using Olaf Matthes' netsend~ and netreceive~ objects, as well as the mrpeach library's udpsend~ and udpreceive~ objects.
What I find is that if I load up the receiver patch in the pdextended engine, the data will connect and flow fine, but if I load up the receiver patch in the embedded libpd engine, the sender will connect, but no data will flow. I've verified it's connecting to the libpd's patch by closing the program running the embedded engine and watching the connection break, but no matter what the data won't flow, and debug prints I put in the patch make it seem like the connection is never getting established (for example, when using udpreceive~ it reports a format type of unknown and 0 received packets).
Is there some compatibility issue with using networking patches in libpd as opposed to the full up pd engine?
In looking at the Pd files created with 0.43.4-extended and 0.45.4 vanilla, I notice that the floatatom in 0.45.4 is:
#X floatatom XPOS YPOS 0 0 0 - - -, f 5;
However, in 0.43.4 extended, the same floatatom would look like:
#X floatatom XPOS YPOS 0 0 0 - - -;
The online documentation of the file format mentions nothing about the ", f 5;" portion added in the newer vanilla version. Is this a new change or something specific to Pd extended? The 0.45.4 vanilla Pd can't load Pd files using the other floatatom specification, so this seems to break backwards compatibility.
What is the easiest way to find the nearest power of 2 + 3 in Pd for tabosc4~ to work correctly?
Basically, what I'm doing is as follows:
Copying one table multiple times into a larger table so that I get X copies in the larger table (the reason I'm doing this is so I can modify each copy slightly, say in amplitude, or even use a different table at that position).
I correctly resize the larger table so that it can hold X copies of the smaller table, but I need to be able to use tabosc4~ on this larger table, so what I really need is a patch that can compute the larger table's pow2 +3 size.
I'm having trouble using the sinesum message atom. When I point it at my array, I get "0-arrayname: no such object."
My message looks like the following:
$0-wavtable sinesum 1024 $1
And I'm feeding the message with a list (of the harmonic levels).
Is it possible at all to use local arrays with sinesum, and of so, how?
Is there a single object that can take an array and resize it while interpolating the data within it?
For example, say I have a 64 element array representing a spectrum, but I need a 512 element array so that it will fit my block size.
How can I take the 64 element array and "expand" it to 512 elements (i.e. the 64th element becomes the 512th element and all points in between are interpolated)?
I thought about using tabread4~ with an until loop, but this seems inefficient and highly cluttered, but I'm not entirely sure how to get the size of the array. Please tell me there's an easier way to do this that I've somehow missed!
I'm trying to use the output of the list-inter Pd object to fill an array, but it doesn't seem to be working. What is the proper way to accomplish this?
I can unpack the list into v-sliders and print out the list just fine (the same way the help shows), but I can't get the output to fill an array. I've tried using tabwrite and messages, but nothing seems to work.
Attached is my attempted patch that shows what I'm trying to do (obviously it doesn't work).
Say I have a table A, representing the output for an input variable X=1.
Now say I also have a table B, representing the output for an input variable of X=2.
How would I create a patch that can interpolate between A and B (and so on with tables C, D, etc...) for any X (i.e. X = 1.5 would be halfway between tables A and ?
Is it possible to define a custom frequency response for a filter?
Essentially, I'm trying to do this:
Starting with white noise (Gaussian), I want to filter it to give me a different coloration based on a spectrum.
Since the filter isn't lowpass, bandpass, nor hipass, but a combination of all three, I can't use the lop~ or hip~ objects.
Is there a patch that essentially does frequency-domain filter design with Pd?
Basically, I'd like to feed a list of frequencies and their dB levels (interpolating in between) to an object along with a noise input, and get out colored noise that matches the new spectrum.
I have successfully managed to embed libpd into a project I'm working on, however in testing with even the most rudimentary patches, I'm getting: "error: ... couldn't create" on simple things (metro and dac~ being good examples).
I assume this is due to the fact that libpd isn't loading the external modules that define these blocks. How can I get the library to load these externals?
Also, when setting up a receiver for a signal message in my patch, it doesn't seem to receive anything. I have an absolute minimum patch as follows:
Yet the following code:
class PdRec : public pd::PdReceiver
void receiveFloat(const std::string & dest, float num)
std::cout << "Received float from: " << dest << " : " << num << std::endl;
pd::Patch patch = pdEngine.openPatch("test.pd", "path/to/my/pd_patches");
float inbuf, outbuf;
for(int i = 0; i < 10 * 44100 / 64; i++)
pdEngine.processFloat(1, inbuf, outbuf);
does not seem to receive anything from the patch. I am, however, able to receive the aforementioned error messages, as well as print commands from the patch if I use polling (but still none of the [s~ toCPP] messages).
What am I doing wrong?