home/ atoms/ pd-atoms-selector-message

Every Pd message is a selector plus arguments, built from float, symbol, and pointer atoms

The data units passing through Pd’s control cables are atoms, of three kinds: a float (a 32-bit number), a symbol (a string of letters), or a pointer (an address). A message has two parts - a selector (always a symbol) that names the message, and zero or more argument atoms. Bare values are shorthand: ‘5’ is really the message ‘float 5’; ‘1 2 3’ is ‘list 1 2 3’; ‘bang’ is a selector with no arguments. The selector lets an object react differently to different message types. Understanding this selector+arguments structure explains why objects respond to ‘bang’, ‘float’, ‘list’, ‘set’, etc.

Examples

The message ‘5’ is internally ‘float 5’ (atoms: symbol ‘float’ + float 5). ‘bang’ is a lone selector. ‘1 2 3 4 5’ is ‘list 1 2 3 4 5’.

Assessment

Decompose the message ‘2 4 8’ into selector and atoms. What are the three atom types, and why must the selector always be a symbol?

“A message for an object has two parts: a method designation (selector) and zero, one, or several values (arguments).”