-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 2013-11-18 11:06, Patrice Colet wrote:
De: "Ronni Montoya" ronni.montoya@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?
Hello,
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 your patch.
another problem is, that this method will delete *all* instances of a given name.
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 patches though).
fgmasdr IOhannes