I've stumbled across this by accident and have found it quite useful.
If you create an abstraction that uses creation arguments. if you use $0 as an argument it will pass the containing patches unique ID
to that argument which can be used to address a known $0-receiving-object in the containing patch from within the abstraction. This keeps things local. I've not seen this documented but I sure it will be somewhere.
Using $0 as a creation arg
On Mac OS X 10.6 (Pd-0.47-1-64bit) sadly i get the weird error below opening your patch.
main-patch.pd: read failed; Device not configured
@Jojo-Lapin Thanks for checking. I've just tried it on Windows 10 Pd-o.47.0 and got a similar error
"main-patch.pd: read failed; Bad file descriptor". So it looks like a pd-extended only use
Yep, works fine now.
$0 is just a number, so this should work reliably across all systems.
You can similarly hand down creation arguments from one abstraction to another using $1 $2... as the creation arguments. So if I create the abstraction [george 10 20 30], and [george] contains the abstraction [ringo $1 $3], then [ringo] will have the creation arguments 10 and 30.
i use this method very often. if you wonder how to create abstractions with $0 arguments dynamically, you can do it with a little hack using zexy/makesymbol like this:
[obj 100 100 myabs $1(
this makes polyphonic/granular abstractions very easy to handle.