[PD] a story for Lists

Derek Holzer derek at umatic.nl
Mon Apr 6 12:31:37 CEST 2009

This is all well and good, but no new Pd user is going to read all this, 
let alone know what to do with it ;-)

For the FLOSS Manuals book, I've asked people to be less theoretical and 
more concentrated on real life examples which do real life things, 
rather than extended lists of taxonomies. So if we can come up with 
proper examples which illustrate the properties of lists and when you 
use what, that would be a lot better.

best wishes!

Frank Barknecht wrote:
> Hallo,
> padawan12 at obiwannabe.co.uk hat gesagt: // padawan12 at obiwannabe.co.uk wrote:
>> This has always confused me, and even in my book I took a simplified
>> approach to explaining lists. 
>> It is definitely worth working hard on this passage
>> to choose clear and agreed words.
> I think, the main obstacle is using the word "list" with its multiple, general
> meanings. For example it's totally confusing to say: "1 2 3 x y z" is a list,
> but "x y z 1 2 3" is not a list as in the current version of the flossmanual
> page. I would really change this because:
> Nobody will understand you. Common sense says: Of course "x y z 1 2 3" is a
> list as well. And it is a "list" in languanges like English and even here on
> this list(!) people often don't make any distinction between both examples and
> call them just "a list".
> However in certain contexts in Pd both example-lists are treated differently. (But
> not even in all contexts!)
> To indicate that I'm talking about these Pd-contexts, I generally prefer to
> talk about messages instead. Both "x y z 1 2 3" and "1 2 3 x y z" are messages
> consisting of multiple items - no confusion up to here. 
> The first element in such a message is used to give each message a special
> meaning/type (semantic) when a Pd object receives such a message. An
> overview of message types can be found here:
> http://puredata.info/dev/PdMessages
> To be clear I like to prefix these messages according to their type when
> talking about them: list-messages, float-messages, bang-messages,
> symbol-messages, pointer-messages and all the others as meta-messages.
> The type is taken from the first item in a message:
> "x y z 1 2 3" is a meta-message, and it's meta-type is "x" (the first item).
> "list x y z 1 2 3" would be a list-message (or even a meta-message with type
> "list"), "1 2 3 x y z" also is a list-message for convenience: Because it starts
> with a number, Pd treats it as list-message. 
> "set 100" is a meta-message of the "set"-subtype.
> And so on.
> Now there is some vocabulary to memorize: Every Pd object responds to
> messages, and very often the type of a message including the subtype of
> meta-messages makes an object do different things. 
> Take a [delay]: Sending it a "bang"-message will make it send a bang itself
> after a certain delay time. Sending it a number or a float-message will change
> its delay time and then wait for that time to generate a bang.
> Sending it a "stop" message will cancel pending bangs.
> So [delay] accepts three message types:
>  - bang-message
>  - float-message (incl. numbers and list-messages downcastable to a number)
>  - meta-messages of type "stop"
> Most other messages like "symbol"-messages generate errors. Every Pd
> objectclass has such a bunch of messages it accepts and others it ignores or
> reports as errors. That's just something you have to learn for each objectclass
> or look up in its help file and then act accordingly.
> Some things are reoccuring when dealing with messages of mixed type:
> [list] is a very useful object because it has the special property that
> it doesn't care at all about the type of a message and treats everthing as if
> it would be a list-message by internally prepending "list" as first element if
> missing. After that you can be sure that every object you use will receive
> proper list-messages only. 
> [list trim] does the opposite: It removes the first element if it's "list" so
> every object after that will always get a meta-message that is not a
> "list"-message (unless you deal with lists starting with numbers). For example
> in front of [route] you often want to use a [list trim] to be extra sure that
> you get the meta-messages you want to route - and trimming doesn't hurt when you
> route numbers like in [route 0 1 2].
> Stuff like that is not really tied to the message system in Pd, but a
> consequence of the various objectclass behaviours used in the builtins and in
> externals.
> Ciao

::: derek holzer ::: http://blog.myspace.com/macumbista ::: 
http://www.vimeo.com/macumbista :::
---Oblique Strategy # 49:
"Display your talent"

More information about the Pd-list mailing list