Hi, I wonder if it is possible to get the dollarzero value of parent patch from an abstraction in vanilla Pd.
Thanks!
How to get the dollarzero value of parent patch?
Hi, I wonder if it is possible to get the dollarzero value of parent patch from an abstraction in vanilla Pd.
Thanks!
@cuinjune I get your point too, and it's interesting to know that you can do it in vanilla. Thanks for sharing it.
Perhaps, like you said, it's down to one's style of coding. For now I personally just know that if I make an abstraction that requires to access objects from upstream, the parent $0 is always the first argument, and trade this inconvenience for readability. But if I ever should need it, I'll keep in mind your method.
@cuinjune interesting, but i don't get the point.
If i open your root patch twice, it will break the separation, because abstractions inside the first and the second root patch will all communicate with the same instance of root patch. In your first example with the second instance, in the second example with the first instance.
If you don't open root patch twice, you don't need $0 at all and can just use [table root-array] and access this directly.
What am i missing?
Also note that instead of passing $0 through creation argument, you can just use inlets and outlets for perfect separation.
@cuinjune on a second thought i think it is possible to expand your counting up example to actually get separation. This would require that the abstractions inside the second instance of root patch start counting not at 1000 but ask first if there is a previous count number and start from there (+ 1). This way they will get the answer only from the second root patch.
Ok, this should work:
@cuinjune i just saw that you did a similar thing in your first example. Sorry, i missed that, i should read more carefully. Please disregard my previous posts, sorry for the confusion.
@ingox No worries man.
I just created my draft as an abstraction.
Please see the post below if anyone is interested.
Thanks! [POST DELETED]
https://forum.pdpatchrepo.info/topic/10866/getdollarzero-vanilla-abstraction-to-get-0-from-any-canvas
@cuinjune Great, but they are still not separated. Open root twice and you see. This can be prevented with a spigot like you did above.
@ingox You're right. I tried to avoid using global variable name if possible. now I understand that it can be a problem in some cases.
I just deleted my post. Thank you for pointing it out
I edited and restored the post. Thanks.
https://forum.pdpatchrepo.info/topic/10866/getdollarzero-vanilla-abstraction-to-get-0-value
Oops! Looks like something went wrong!