[PD] Selfdestroying patches
IOhannes m zmoelnig
zmoelnig at iem.at
Mon Nov 18 11:50:30 CET 2013
-----BEGIN PGP SIGNED MESSAGE-----
On 2013-11-18 11:06, Patrice Colet wrote:
>> De: "Ronni Montoya" <ronni.montoya at gmail.com> Hi, im opening
>> multiple instances of a pd patch from openframeworks using the
>> ofxPd library .
>> My patch generates a grain, so when i create multiple instances
>> of this patch from openframeworks it generates a granular cloud.
>> I need that after the grain is generated ( when sound finishes)
>> the patch can selfdestroy itself ( instance get closed) .
>> How can i do this?
> you can do this with internal message "menuclose" to a canvas
> [; my_patch_name menuclose(
the full syntax would be
[; pd-<my_patch_name>.pd menuclose(
with "<my_patch_name>" expanded to the patch-name.
so if you open a patch named "foo.pd", you could do
[; pd-foo.pd menuclse(
the problem with this is, that it will not only destroy the patch, but
make Pd commit suicide, if part of the message-chain that triggers the
self-destruction is within the patch itself.
e.g. if your foo.pd contains the above example and you click it, your
Pd will go poof.
so make sure that the destruction logic is (completely) outside of
another problem is, that this method will delete *all* instances of a
if using an external is an option (i don't know how this is with
ofxPd), the [canvasdelete] object in iemgut's might help you here: it
allows single instances of abstractions to commit suicide without
killing Pd. (afair it only works on abstractions, not on top-level
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/
-----END PGP SIGNATURE-----
More information about the Pd-list