next up previous contents index
Next: How to find and Up: About the Software Examples Previous: About the Software Examples   Contents   Index

Quick Introduction to Pd

Pd documents are called ``patches." They correspond roughly to the boxes in the abstract block diagrams shown earlier in this chapter, but in detail they are quite different, reflecting the fact that Pd is an implementation environment and not a specification language.

A Pd patch, such as the one shown in Figure 1.6, consists of a collection of boxes connected in a network called a patch. The border of a box tells you how its text is interpreted and how the box functions. In part (a) of the figure we see three types of boxes. From top to bottom they are:

In fig. 1.6(a) the message box, when clicked, sends the message ``21" to an object box which adds 13 to it. The lines connecting the boxes carry data from one box to the next; outputs of boxes are on the bottom and inputs on top.

Figure 1.6: (a) three types of boxes in Pd (message, object, and GUI); (b) a simple patch to output a sinusoid.
\begin{figure}\psfig{file=figs/fig01.08.ps}\end{figure}

Figure 1.6(b) shows a Pd patch which makes a sinusoid with controllable frequency and amplitude. The connecting patch lines are of two types here; the thin ones are for carrying sporadic messages, and the thicker ones (connecting the oscillator, the multiplier, and the output ``dac ") carry digital audio signals. Since Pd is a real-time program, the audio signals flow in a continuous stream. On the other hand, the sporadic messages appear at specific but possibly unpredictable instants in time.

Whether a connection carries messages or signals is a function of the box the connection comes from; so, for instance, ``+" outputs messages, but ``*~" outputs a signal. The inputs of objects may or may not accept signals (but they always accept messages, even if only to convert them to signals). As a naming convention, object boxes which input or output signals are all named with a trailing tilde (``~") as in ``*~" and ``osc~".


next up previous contents index
Next: How to find and Up: About the Software Examples Previous: About the Software Examples   Contents   Index
Miller Puckette 2005-04-01