Pure Data


Pure Data is a visual programming language developed by Miller Puckette in the 1990s for creating interactive computer music and multimedia works. While Puckette is the main author of the program, Pd is an open-source project with a large developer base working on new extensions. It is released under a license similar to the BSD license. It runs on GNU/Linux,, iOS, Android and Windows. Ports exist for FreeBSD and IRIX.
Pd is very similar in scope and design to Puckette's original Max program, developed while he was at IRCAM, and is to some degree interoperable with Max/MSP, the commercial predecessor to the Max language. They may be collectively discussed as members of the Patcher family of languages.
With the addition of the Graphics Environment for Multimedia external, and externals designed to work with it, framestein for Windows, GridFlow, it is possible to create and manipulate video, OpenGL graphics, images, etc., in realtime with extensive possibilities for interactivity with audio, external sensors, etc.
Pd is natively designed to enable live collaboration across networks or the Internet, allowing musicians connected via LAN or even in disparate parts of the globe to create music together in real time. Pd uses FUDI as a networking protocol.

Similarities to Max

Pure Data and Max are both examples of dataflow programming languages. In such languages, functions or "objects" are linked or "patched" together in a graphical environment which models the flow of the control and audio. Unlike the original version of Max, however, Pd was always designed to do control-rate and audio processing on the host central processing unit, rather than offloading the sound synthesis and signal processing to a digital signal processor board. Pd code forms the basis of David Zicarelli's MSP extensions to the Max language to do software audio processing.
Like Max, Pd has a modular code base of externals or objects which are used as building blocks for programs written in the software. This makes the program arbitrarily extensible through a public API, and encourages developers to add their own control and audio routines in the C programming language, or with the help of other externals, in Python, Scheme, Lua, Tcl, and many others. However, Pd is also a programming language. Modular, reusable units of code written natively in Pd, called "patches" or "abstractions", are used as standalone programs and freely shared among the Pd user community, and no other programming skill is required to use Pd effectively.

Language features

Like Max, Pd is a dataflow programming language. As with most DSP software, there are two primary rates at which data is passed: sample rate, usually at 44,100 samples per second, and control rate, at 1 block per 64 samples. Control messages and audio signals generally flow from the top of the screen to the bottom between "objects" connected via inlets and outlets.
Pd supports four basic types of text entities: messages, objects, atoms, and comments. Atoms are the most basic unit of data in Pd, and they consist of either a float, a symbol, or a pointer to a data structure. Messages are composed of one or more atoms and provide instructions to objects. A special type of message with null content called a bang is used to initiate events and push data into flow, much like pushing a button.
Pd's native objects range from the basic mathematical, logical, and bitwise operators found in every programming language to general and specialized audio-rate DSP functions, such as wavetable oscillators, the Fast Fourier transform, and a range of standard filters. Data can be loaded from file, read in from an audio board, MIDI, via Open Sound Control through a FireWire, USB, or network connection, or generated on the fly, and stored in tables, which can then be read back and used as audio signals or control data.

Data structures

One of the key innovations in Pd over its predecessors has been the introduction of graphical data structures. These can be used in a large variety of ways, from composing musical scores, sequencing events, to creating visuals to accompany Pd patches or even extending Pd's GUI.
Living up to Pd's name, data structures enable Pd users to create arbitrarily complex static as well as dynamic or animated graphical representations of musical data. Much like C structs, Pd's structs are composed of any combination of floats, symbols, and array data that can be used as parameters to describe the visual appearance of the data structure or, conversely, to control messages and audio signals in a Pd patch. In Puckette's words:
File:solitude.png|thumb|600px|center|Score for Hans-Christoph Steiner's , created using Pd's data structures.

Language limitations

Though a powerful language, Pd has certain limitations in its implementation of object-oriented concepts. For example, it is very difficult to create massively parallel processes because instantiating and manipulating large lists of objects is impossible due to a lack of a constructor function. Further, Pd arrays and other entities are susceptible to namespace collisions because passing the patch instance ID is an extra step and is sometimes difficult to accomplish.

Projects using Pure Data

Pure Data has been used as the basis of a number of projects, as a prototyping language and a sound engine. The table interface called the Reactable and the abandoned iPhone app RjDj both embed Pd as a sound engine.
Pd has been used for prototyping audio for video games by a number of audio designers. For example, EAPd is the internal version of Pd that is used at Electronic Arts. It has also been embedded into EA Spore.
Pd has also been used for networked performance, in the Networked Resources for Collaborative Improvisation Library.

Code examples

  1. The first patch prints "hello world" to the display.
  2. The second patch applies reverberation to the incoming signal from channel 1, then emits it on channels 1 and 2.
  3. The last, more complex patch filters white noise at 9000 Hz, then fades it in and out each second over the course of a half second. In Pd, time is measured in milliseconds, thus the '1000' is one second and the '500' is a half second.