From: Ludwig Maes ludwig.maes@gmail.com To: Pd List pd-list@iem.at Sent: Wednesday, September 28, 2011 1:31 PM Subject: Re: [PD] Variable number of objects?
Perhaps better rephrased: how does one use arrays of .pd objects? or variable length vectors/lists?
Variable list message: [list] family objects and the list-abs library
Variable length glists: dynamic patching (search the list and see patches in doc/manuals/pd-msg/ )
Variable length vectors: hm.. not sure what this means ( [block~] ? )
Arrays of .pd objects: I don't think it's possible, but I'd love to do something like that with data structures.
You'd have a "template" subpatch, define a field of the struct as type "glist", then use that struct as the
template for an array:
[pd my-template-patch]
[struct foo float y glist my-template-patch]
[filledpolygon 900 0 1 -5 -5 5 -5 5 5 -5 5]
Then the container struct:
[struct bar float x float y array a foo]
[plot a 0 1 0 0 20]
Now when you create a scalar "bar", each element of array "a" would have a little red rectangle,
a yvalue, and a glist copied from the contents of my-template-patch.
The issues are:
members (like "y" in the above example).
(Seems like you'd have the same problem as with current dynamic-patching where you need to turn off dsp
before the new objects get created, then turn it back on once they exist.
-Jonathan
On 28 September 2011 19:29, Ludwig Maes ludwig.maes@gmail.com wrote:
---------- Forwarded message ---------- From: Ludwig Maes ludwig.maes@gmail.com Date: 28 September 2011 19:29 Subject: Re: [PD] Variable number of objects? To: Ingo ingo@miamiwave.com
I actually meant more in general, also for non-~ signals (i.e. also control rate .pd patches). I referred to polysynth such that people would see more easily what I meant. Are there really no such primitives? That seems like quite a restriction...
How can that take 10 seconds?? I dont see what would cause such a huge overhead, i'd expect an increase in computations & memory though (say from 10 voices to 11: 10% increase in cpu workload & ram dedicated to these voices..., I fail to see what would necessitate a long initialization...)
also, how is it done even with the long delays?
On 28 September 2011 18:33, Ingo ingo@miamiwave.com wrote:
To my experience there will be definitely audio dropouts with dynamic voice
creation. In the case of my rather complex patch (with currently only 8 voices) I have to wait up to ten seconds until the patch is ready again for playback. I am using a 3.2 GHz Athlon II X2 which is not that slow. Simpler synth voices might be faster, though.
I think it is much better to create as many voices as needed beforehand and turn unused voices off with the [switch~] object.
Ingo
Von: pd-list-bounces@iem.at [mailto:pd-list-bounces@iem.at] Im Auftrag von Ludwig Maes Gesendet: Mittwoch, 28. September 2011 17:56 An: Pd List Betreff: [PD] Variable number of objects?
Im not sure what the best way is to instantiate variable number of objects, for example consider polysynth.pd:
Theres a fixed number of manually placed voices, suppose I want to have the top patch to contain a counter through which one may increase or decrease the number of voices, how would I go about that (without manually placing a load of voices and disabling them...)?
Whats the vanilla way to do this? Whats the pd-extended way to do this? ...
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list