Professional Documents
Culture Documents
The
objects allow you to describe data structures and how they are viewed
("template objects") and to traverse lists ("traversal objects.")
The rest of this file gives a highly condensed summary of what's there; the
patches, starting with "1.scalars.pd", act as a tutorial.
1. TEMPLATE OBJECTS.
templates describe data structures. You can add an item to a data structure
using "field" or ask for a shape to be drawn using a "display command."
where the fields are either "float <name>", "symbol <name>", "list <name>"
(don't try that yet); or "array <name> <template-for-elements>.
These are objects which ask Pd to draw a shape corresponding to some fields
of the datum.
1.2.2 PLOT.
2. TRAVERSAL.
In this release of Pd, you can only traverse lists all of whose elements
belong to the same template; this restriction will be relaxed in a future
release. You "traverse" a list either to build it, to get its elements,
or to change their values.
2.1. POINTER.
Point to the "head" of a list. The symbol should match the name of a Pd
window holding the list. The pointer is output, but you can't set or get the
fields of the "head" pointer; you can only get the "next" element or "append"
to the list.
2.1.2. next. Goes to the next element of the list. Either the pointer
is output on the left side, or else a "bang" at right tells you that no
more objects are forthcoming.
2.1.3. bang.
outputs the current pointer.
2.2. APPEND. Adds an element of the specified template to the list. You
specify what fields you want to supply and the last inlet takes a pointer to
the element you want to "append" after.
2.3. GET.
2.4. SET.
send it a pointer (at the rightmost inlet) and values for the specified
fields, and their values are changed accordingly.
2.5. GETSIZE.
outputs the size of the named field, which must be an array, when it receives
a pointer to the owner as input.
2.6. SETSIZE.
Send it a pointer to the owner (right inlet) and then the desired size
(left inlet) and the array is resized. If a template contains an array,
each scalar belonging to the template can have its own size for the array.
2.7. ELEMENT.