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?
cheers
R.
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(
Here is a method I've found yet to send internal messages through FUDI:
http://blog.tridek.com/post/29834155461/using-libpd-with-unity3d-on-mobile-d...
In your patch create a [receive 3000] object with '3000' connected to an empty message box, then you can fill the message box with the internal message and bang it. By this way it's possible to create dynamically whatever you want in the patch, or simply close it.
pc
-----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