I'm doing a lot of dynamic creation of objects and came to a point where I would like to create objects with unique names. Unique names, because I want to create objects within these uniquely named objects. So, as far as I know, I can only achieve unique naming by creating an abstraction. But I don't want it to pop up, once created. I could of course send a vis 0 message to the abstraction right after it's creation, but that would lead to a lot fast popping, which I'd rather skip.
Any thoughts on this?
..ailo
--- On Fri, 3/26/10, ailo ailo.at@gmail.com wrote:
From: ailo ailo.at@gmail.com Subject: [PD] How to create abstraction without it popping up To: "pd list" pd-list@iem.at Date: Friday, March 26, 2010, 4:40 AM I'm doing a lot of dynamic creation of objects and came to a point where I would like to create objects with unique names. Unique names, because I want to create objects within these uniquely named objects. So, as far as I know, I can only achieve unique naming by creating an abstraction. But I don't want it to pop up, once created. I could of course send a vis 0 message to the abstraction right after it's creation, but that would lead to a lot fast popping, which I'd rather skip.
Any thoughts on this?
What your calling an abstraction Miller calls a "one-off subpatch." This is: [pd blah]
An abstraction is a separate pd file, which is created as an object in a patch. One-off subpatches spring open as you describe-- unless you're doing dynamic patching, you typically want to start working inside the newly-created subpatch. Abstractions don't do this (for obvious reasons).
I'm not sure why you need to dynamically instantiate several subpatches, but I suppose you could take advantage of abstractions in your case to avoid popups. For example:
[obj 20 20 container 1, obj 20 80 container 2( | [s pd-test.pd] 5) Now you've got two "container" objects, one with an argument of "1", and one with an argument of "2". To create objects inside [container 1], you can now take advantage of the [namecanvas] object you created earlier: [obj 20 20 osc~ 440( | [s 1-c] <- this goes to the first abstraction but not the second one.
Hope that helps. -Jonathan
Jonathan Wilkes wrote:
- Make a new patch and save it as "container" in folder named "folder"
- In patch "container" put a [namecanvas $1-c], save and close.
- Make a new patch named "test" and save it in "folder"
- Now in patch "test" do this:
[obj 20 20 container 1, obj 20 80 container 2( | [s pd-test.pd] 5) Now you've got two "container" objects, one with an argument of "1", and one with an argument of "2". To create objects inside [container 1], you can now take advantage of the [namecanvas] object you created earlier: [obj 20 20 osc~ 440( | [s 1-c] <- this goes to the first abstraction but not the second one.
Hope that helps. -Jonathan
[namecanvas] will do the trick. Thanks.