A Pd’s message-system

Non-audio-data are distributed via a message-system. Each message consists of a “selector” and a list of atoms.

A.1 atoms

There are three kinds of atoms:

Numerical values are always floating point-values (t_float), even if they could be displayed as integer values.

Each symbol is stored in a lookup-table for reasons of performance. The command gensym looks up a string in the lookup-table and returns the address of the symbol. If the string is not yet to be found in the table, a new symbol is added.

Atoms of type A_POINTER are not very important (for simple externals).

The type of an atom a is stored in the structure-element a.a_type.

A.2 selectors

The selector is a symbol that defines the type of a message. There are five predefined selectors:

Since the symbols for these selectors are used quite often, their address in the lookup-table can be queried directly, without having to use gensym:

selector lookup-routine lookup-address



bang gensym("bang") &s_bang
float gensym("float") &s_float
symbol gensym("symbol") &s_symbol
pointer gensym("pointer")&s_pointer
list gensym("list") &s_list
— (signal)gensym("signal") &s_symbol

Other selectors can be used as well. The receiving class has to provide a method for a specifique selector or for “anything”, which is any arbitrary selector.

Messages that have no explicit selector and start with a numerical value, are recognised automatically either as “float”-message (only one atom) or as “list”-message (several atoms).

For example, messages “12.429” and “float 12.429” are identical. Likewise, the messages “list 1 for you” is identical to “1 for you”.