this is a quick explanation of the role of abstractions in pd, and why it is useful to use $0, $1, etc.. inside these abstractions.
ok. say you want to create a very simple sample player. you'd do something like this.
[0] <-- gui bang object #1
What is an abstraction, and why use $0, $1, etc ??
this is a quick explanation of the role of abstractions in pd, and why it is useful to use $0, $1, etc.. inside these abstractions.
ok. say you want to create a very simple sample player. you'd do something like this.
[0] <-- gui bang object #1
it might have been me that made that blurb
(in many situations, i'm not a big fan of abstractions, and i'd really much prefer if subpatches could use $0 locality like abstractions do.)
if you want to go ahead and edit/extend my explanation, then please do! just post the missing bits here, and i'll attach them to the original post.
Hi Mod (Maelstorm?)
You don't need to add on anything, you already wrote two excellent (and very clear) explanations here expanding on the why $0 and why then $1, $2 etc. :
http://puredata.hurleur.com/sujet-6417-dollar-signs-objects-messages
http://puredata.hurleur.com/sujet-6314-abstractions-problem
That's how I ended up here (on this thread).
I'll look out the other post as I can't see it at the moment.
ok cheers, just added those links to the tutorial.
I'm not Maelstorm, I just wish i was
Sorry Mod, as you can see in the links Maelstorm mentions your post, naturally I thought ..... wrongly.
Nice post though, thanks.
Hi mod,
Thanks for a very clear explanation. I got it now. There's something a bit weird going on when I use the [sample-playa] abstraction: every time I open a file, the table [$0-my-sample] appears on the parent patch as well. I placed 2 [sample-playa] abstractions in the parent patch and got two tables on it. Is it a bug or something?
Thanks!
i think my original patch here will play a different sample from each patch. If you want to play the same sample over a series of patches, then you need to make a global name for the sample array.
is that the issue?
if not, then post your patch with some annotation of the issue. and it should be easy to figure out
Hi mod,
I attach the patches (the ones you wrote in text format in the post)+ a photo of the vicious "bug". After you load an audio file, and right-click-open the abstraction, the table appears in the parent patch.. (I can't move it or delete it from there)...
well, there is an error in your patch, that it uses tabread4~ instead of tabplay~. but that's not the cause of the GUI issue.
yes, i think this is a bug. i have no idea why the table appears on your parent patch. hmmm.... it does not behave that way here. i wonder why it does that for you?
anyway, your patch uses a GUI array in the sample-playa abstraction, so how about if you change that to a non-GUI table?
Yes, you're right about the [tabread4~]...
and your suggestion works perfect! Thanks mod
Oops! Looks like something went wrong!