User Tools

Site Tools


Pure Data

Pure Data (PD) is a graphical programming language. You place different elements on the screen and connect them to create programs.

Running PD

In a terminal, navigate to the PD directory and run ./pd in the bin/ directory:

cd ~/Desktop/pd-0.40-1/bin

To start a new project, go to File → New. You will be in edit mode at the beginning. To toggle between edit and run modes, press Ctrl + E, or go to Edit → Edit mode.

Adding and Connecting Elements

To add an element, just go to the “Put” menu and choose the type. To select an element, just click on it or drag a box around it. You can move objects with the mouse and delete object with the Delete key.

Every element can have one or more inputs and one or more outputs. Inputs are always on the top, and outputs are always on the bottom. These are marked with thicker black lines. You connect objects by dragging a line from the output of one elements to input of another.

Move your mouse over the first object's output bar and your cursor will change to a black circle. Click and drag to the second object's input slot (your cursor will change back to a circle) and release. The second object will now recieve the first object's output!

To delete a connection, click on it (your cursor will turn to an X) and hit “Delete”.

Bangs, Messages and Objects

A “bang” is an element that initiates other events and start the flow of data. When it is clicked or when it receives any sort of input, it will activate elements at its outputs. The message that a bang sends is equivelant to a “1”, or “true”.

A “message” contains a string that is passed to another element. When clicked (or activated by a bang), it sends its message to its outputs.

An “object” is a function, which takes input and produces output.

Numbers, Symbols and Comments

A number can recieve a bang, in which case it acts like a message, and sends its number to its outputs. A number can also act like a read-out for other things (we'll see more of this in the next section). For now, we can think of numbers as variable messages. While running the program, you can click and drag on the number box to change the value (it will output its number every time it changes). You can also click on the number box and type in a number. Press enter to store the typed value.

A symbol is similar in operation to a number. If you click on a symbol while the program is running, then type a character and press enter, the symbol element will take on that value. When a symbol element recieves a bang, it outputs “symbol (value entered)”.

A comment is the same basic principle as a comment in any language. Add a comment from the menu, then click and type. Comments will show up while the program is running but will have no impact on the execution of the program.

Sliders, Toggles and Metros

There are two types of sliders: horizontal (hslider) and vertical (vslider). Both can accept number inputs (which will set their values), and both can output their values. You can set properties such as background color and range by right-clicking and going to “Properties”. The following image shows the relationship between input, slider and output:

Toggles are simply buttons that send alternating 1's and 0's. When a 1 is sent, the elements at the toggles outputs are activated. Toggles are interchangeable with bangs. The only difference is that toggles can be stopped, whereas a bang continually sends a true signal.

A metro (short for metronome) is an example of an object. To create a metro, put in an object box and type “metro 500”. This will create an object that, when it receives a 1 (from a bang or a toggle), will send a bang every 500 milliseconds.

pure_data.txt · Last modified: 2007/08/30 13:53 (external edit)