Hi,
could anyone with some internal knowledge of pd give me a hint in which order pd objects are created when loading a patch ?
For example when i create a patch with 2 objects that are not connected in any way, in which order will they be created by pd when the patch is loaded ?
Thanks!
-robert
Hallo, Robert Gr?ndler hat gesagt: // Robert Gr?ndler wrote:
For example when i create a patch with 2 objects that are not connected in any way, in which order will they be created by pd when the patch is loaded ?
The order you created them, but it's very bad practice to rely on that, because it's an implementation detail that may change in future versions and it's generally error prone because you cannot see the creation order.
You can test this with an abstraction that prints something with a loadbang, like:
testme.pd:
[loadbang] | [f $1] | [print]
testme-for-real.pd:
[testme 1] [testme 2]
Then open testme-for-real.pd again.
Frank
On Feb 25, 2009, at 3:50 PM, Frank Barknecht wrote:
Hallo, Robert Gr?ndler hat gesagt: // Robert Gr?ndler wrote:
For example when i create a patch with 2 objects that are not
connected in any way, in which order will they be created by pd when the patch is loaded ?The order you created them, but it's very bad practice to rely on
that, because it's an implementation detail that may change in future versions and it's generally error prone because you cannot see the creation order.You can test this with an abstraction that prints something with a loadbang, like:
testme.pd:
[loadbang] | [f $1] | [print]
testme-for-real.pd:
[testme 1] [testme 2]
Then open testme-for-real.pd again.
I agree with Frank here, but I will give you the gun of knowledge with
which to shot yourself in the foot with:
If you read the .pd file in a text editor, you can see the order of
creation. The file is read top-to-bottom, in one pass.
.hc
Ciao
Frank
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Computer science is no more related to the computer than astronomy is
related to the telescope. -Edsger Dykstra
the problem i'm facing is the following:
i'm trying to write an extension to pd which allows people to create custom gui objects that can communicate with the underlying pd patch.
So far i've a prototype where i use Gtk+ for the gui, and the communication works fine so far.
But that's where the loading order of objects become important. First i need to create the canvas object in pd, and then i can create additional objects which add user interface objects inside the gtk canvas.
If i can't rely on a specific loading order in future implementations of pd, a workaround would be that a simple gtk gui widget would first check if there's a canvas existing, and if that's not the case, it needs to create one itself. But i'm not sure if i can create pd objects in a patch programmatically.
I'd also be glad about feedback from the pd community if such an extension would be considered useful in general.
best
-robert
Frank Barknecht wrote:
Hallo, Robert Gr?ndler hat gesagt: // Robert Gr?ndler wrote:
For example when i create a patch with 2 objects that are not connected in any way, in which order will they be created by pd when the patch is loaded ?
The order you created them, but it's very bad practice to rely on that, because it's an implementation detail that may change in future versions and it's generally error prone because you cannot see the creation order.
You can test this with an abstraction that prints something with a loadbang, like:
testme.pd:
[loadbang] | [f $1] | [print]
testme-for-real.pd:
[testme 1] [testme 2]
Then open testme-for-real.pd again.
Ciao
hi all,
What I do when I have abstractions that I can't predict how they will be patched in the future and order is important, is to have the loading order as an argument for abstractions at loading time and connect that variable to a del, so that I have del 1, del 2, del 3, etc. In fixed patches (that won't change in the future) I use something like:
[loadbang]
|
[t b b]
|
[s lb1] [s lb2] [etc....]
J
On Wed, Feb 25, 2009 at 2:09 PM, Robert Gründler doobre@gmail.com wrote:
the problem i'm facing is the following:
i'm trying to write an extension to pd which allows people to create custom gui objects that can communicate with the underlying pd patch.
So far i've a prototype where i use Gtk+ for the gui, and the communication works fine so far.
But that's where the loading order of objects become important. First i need to create the canvas object in pd, and then i can create additional objects which add user interface objects inside the gtk canvas.
If i can't rely on a specific loading order in future implementations of pd, a workaround would be that a simple gtk gui widget would first check if there's a canvas existing, and if that's not the case, it needs to create one itself. But i'm not sure if i can create pd objects in a patch programmatically.
I'd also be glad about feedback from the pd community if such an extension would be considered useful in general.
best
-robert
Frank Barknecht wrote:
Hallo, Robert Gr?ndler hat gesagt: // Robert Gr?ndler wrote:
For example when i create a patch with 2 objects that are not connected in any way, in which order will they be created by pd when the patch is loaded ?
The order you created them, but it's very bad practice to rely on that, because it's an implementation detail that may change in future versions and it's generally error prone because you cannot see the creation order.
You can test this with an abstraction that prints something with a loadbang, like:
testme.pd:
[loadbang] | [f $1] | [print]
testme-for-real.pd:
[testme 1] [testme 2]
Then open testme-for-real.pd again.
Ciao
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi Robert, mabye you need to do some dynamic patching?
Apart from that, what we did in the vibrez application is that the canvas/widget dependencies are rechecked at every new patcher object (and there is no implicit generation of a canvas), so the widgets will only come to life as soon as the canvas object has been loaded in the patch.
gr~~~
2009/2/25 Robert Gründler doobre@gmail.com:
the problem i'm facing is the following:
i'm trying to write an extension to pd which allows people to create custom gui objects that can communicate with the underlying pd patch.
So far i've a prototype where i use Gtk+ for the gui, and the communication works fine so far.
But that's where the loading order of objects become important. First i need to create the canvas object in pd, and then i can create additional objects which add user interface objects inside the gtk canvas.
If i can't rely on a specific loading order in future implementations of pd, a workaround would be that a simple gtk gui widget would first check if there's a canvas existing, and if that's not the case, it needs to create one itself. But i'm not sure if i can create pd objects in a patch programmatically.
I'd also be glad about feedback from the pd community if such an extension would be considered useful in general.
best
-robert
Frank Barknecht wrote:
Hallo, Robert Gr?ndler hat gesagt: // Robert Gr?ndler wrote:
For example when i create a patch with 2 objects that are not connected in any way, in which order will they be created by pd when the patch is loaded ?
The order you created them, but it's very bad practice to rely on that, because it's an implementation detail that may change in future versions and it's generally error prone because you cannot see the creation order.
You can test this with an abstraction that prints something with a loadbang, like:
testme.pd:
[loadbang] | [f $1] | [print]
testme-for-real.pd:
[testme 1] [testme 2]
Then open testme-for-real.pd again.
Ciao
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list