[PD] opening patch from pd message
reduzent at gmail.com
Wed Nov 27 13:37:21 CET 2019
On Tue, 2019-11-26 at 18:33 +0100, IOhannes m zmölnig wrote:
> # anatomy of a message
> i think it is pretty easy:
> - any message in pd-land consists of a single selector and any number
> atoms (including none).
> - an atom can be a number, a symbol, a gpointer and "other things"
> - a selector must always be a symbol.
> some special selectors need a fixed number of atoms, of a fixed type
> ("float" and "symbol" require exactly 1 atom of the resp. type;
> requires exactly 0 atoms); but these are special cases.
> dollar-arguments in msgboxes (e.g. [open $1.wav() always refer to the
> ## implicit selectors
> if you have a msgbox [foo bar 1(, then this is a message with the
> selector "foo" and two atoms, a symbol "bar" and a number "1".
> if you have a msgbox [1(, then the 1st element would be "1" (a
> since messages must always start with a selector (a symbol), it
> start with the number "1". and Pd implicitely adds a default selector
> this message. since the msg only consists of a single number atom,
> implicitely added selector is "float".
> if you have a msgbox [1 bar foo(, we also miss a (symbol) selector,
> the "float" selector requires a single atom (and our message has 3
> atoms, once we add a selector), so Pd adds a "list" selector.
> # why do we need selectors?
> so why are messages like they are in the first place?
> each object in Pd has a number of methods (functions that interact
> the internal state of the object). objects and methods are something
> know from object-oriented programming (C++, ...)
> in Pd, objects communicate via messages - and communication boils
> to calling methods in other objects.
> so messages need some way to encode which method of the downstream
> object is being called: and this is what the selector does.
> e.g. an object might have a method for messages with the "foo"-
> and messages with the "bang" selector, but no messages with the
> so if you want to stop a delay, you want to call the "stop" method of
> the [delay] object, thus sending a [stop( message (selector is
> no atoms).
This sums up the nature of Pd's message much more comprehensively than
what can be found in Pd's own HTML documentation, I find at least.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 488 bytes
Desc: This is a digitally signed message part
More information about the Pd-list