[PD] Multiple (same) instances, and [sssad]
Frank Barknecht
fbar at footils.org
Tue Aug 8 12:41:27 CEST 2006
Hallo,
Tas Pas hat gesagt: // Tas Pas wrote:
> I have a patch that features the same abstraction many times. Each
> one of these abstractions are connected to different objects so they
> do other things each.
>
> Now, trying to intergrade a snapshot feature to my patch, using the
> [sssad] object, I came to a problem with the abstractions: I opened
> each one within the patch and added the [aaasd xxx] object. When I
> save them all the same abstractions had the [aaasd xxx] object,
> which made my state load difficult (all the abstraction's setting
> are the same).
>
> Can pd load each abstractions the object oriented way? Each
> abstraction to have it's set of properties?
The trick here is to teach Pd to handle each use of an abstraction
differently by "tagging" it with a different name. I do this with the
first argument to the abstraction, and then, inside of that
abstraction use [sssad $1/xxxx] instead of just [sssad xxxx].
So your abstraction "myabs.pd" has this inside:
[sssad $1/something]
and in the main patch you use [myabs] like this:
[myabs one]
[myabs two]
[myabs third]
or similar.
Then the sssad-values stored will be named like this: "one/something",
"two/something" and "third/something" if you save the settings.
$0 would do something like this automatically, but you cannot use
[sssad $0/something] in real life because if you save it to a file,
what gets saved is something like "1004/something" but the "1004"-part
will be different everytime you reopen the patch. So you have to use
explicit names as recommended above.
Ciao
--
Frank Barknecht _ ______footils.org_ __goto10.org__
More information about the Pd-list
mailing list