[PD] "get" method for Pd
Mathieu Bouchard
matju at artengine.ca
Fri Nov 18 18:49:23 CET 2011
Le 2011-11-17 à 10:42:00, Miller Puckette a écrit :
> This leads to an interesting larger design issue. I've so far resisted
> the idea of using send/receive as a back channel for getting return
> values because of the unreadablity of the resulting patch.
It doesn't have to be written as such in the patch. A send/receive pair
can be bundled together as one object. It would solve a more general
problem of making things more readable in pd which would reach beyond just
[samplerate~] or queries to canvases.
A few convenient shortcuts are sometimes all it takes to make a big
difference in readability. Trying to stick to a minimal set of basic
constructs forces the user to do more work than what would be necessary.
> The other way, assuming you want locality, would be to confect a unique
> symbol name and then somehow to "receive" it (I'm not even sure that's
> possible without making a self-editing patch).
Pd has a cool and very important feature named « abstractions », and using
$0, you can create a unique receiver name without even having to think
about it. No need for dynamic naming.
But if you want dynamic naming, there's [receives] with an s, which allows
a single object to receive from many names at once and distinguish them
while having always 2 outlets. You can use it with 1-element lists if you
want. See this patch (screenshot) :
http://gridflow.ca/help/receives-help.html
BTW, [receives] was actually meant to manage large number of GUI objects
matching attributes, method names, and a get-method, without making
patches unreadable.
> although it's migraine-inducing, the neatest solution would be to allow
> "info" style objects to have a right-hand outlet that you connect to,
> say, the "textfile" object like so:
You don't give any explanation of why you think it's migraine-inducing. I
don't think that it's obvious why [get( and right-outlet could be more
migraine-inducing than the average pd construct.
> I think Krzystof Chaya did something like this in his wonderful "xeq"
> object (first Pd convention, Graz.)
I don't remember Czaja's talk in particular, but the idea must have been
in the air back then. Flext 0.4 (nov 2002) introduced Jitter-style
attributes in Pd, and I added my own kind of attributes in GridFlow in
2005 by introducing parsing of the comma in objectboxes so that attributes
setters always counted as ordinary messages.
______________________________________________________________________
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
More information about the Pd-list
mailing list