[PD] Selfdestroying patches

IOhannes m zmoelnig zmoelnig at iem.at
Mon Nov 18 11:50:30 CET 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

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?
>> 
> 
> 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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQIcBAEBCAAGBQJSifDwAAoJELZQGcR/ejb4PNgP/0OoZW/we31I0NqKLmwMJquB
raZSAfV117IcDXk8lCHn9vJVTdXdzkHbyukbFCEOmdm+gNc8NpG6jpOoqr3wxZzR
sMI04CpaEZO0heFze1WDJjJI/v/+8ap5miizZvj5UP2fbJdiVyoe4tDduHcsXNLK
BPmLPyGnUGg8MnBlOeJ7yhkeFeDuAoyEINRwVGC49JcW8T3v5WEcYtmparVa96Qt
y3T3OonrJub4ud+GdpS3yLkNl7SJ+9Eh5H0bqjGNRbvJOt2smpe8pOU5cQtgLwfo
kmlXgy6p3ouyb/R2773UZL8aoohIhXaD1hx3NClOn3LfLR399AnUBO4knbwgF5di
1+YWgwaEVeRd04/VW/5va4yg0JyZr+JJO/9RV6CTh0MypBw7sDXpkIrwMvXsc3Ps
KT+pHFkVW5BzgPpZ1TVgO206xw29ledWJ+Xp8pXUQiFXNAu50YdhE4Rqk0nI9F0y
Du0Xo14C34kUwSgiG/KYJ61VcdcWDL7TcryPifDe54d3WGjStbdS9aDMVsVci9DT
9CtDaLogje1XO4yJ9DYZ32guucmv2M+uE2Cq4E8+Y2Z0LXPZExFyxRsTQbilLYBN
nrsGUXVwh6voWtfE9nP9aZ+GlOcfgbBSIdV4nCV8rvPl28LqXndzne+pj/wA3VP6
NiIhUEy0BTmoyXAL/K5y
=hhQa
-----END PGP SIGNATURE-----



More information about the Pd-list mailing list