ArticleslgStudy

computer science

Pure Data

Pure Data is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Pure Data rather than just read about it. In short: Pure Data (Pd) 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.

Pure Data — main illustration
Pure Data — illustration

Key takeaways

  • Pure Data belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Pure Data to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Pure Data from memory before moving on to harder problems.

Reference excerpt

Pure Data (Pd) 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 BSD-3-Clause. It runs on Linux, MacOS, 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 successor 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 (GEM) external, and externals designed to work with it (like Pure Data Packet / PiDiP for Linux, Mac OS X), framestein for Windows, GridFlow (as n-dimensional matrix processing, for Linux, Mac OS X, Windows), it is possible to create and manipulate video, OpenGL graphics, images, etc., in realtime with many possibilities for interactivity with audio, external sensors, and more. 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. Dataflow languages model a program as a directed graph of the data flowing between operations. In Pure Data and Max, 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 (CPU), rather than offloading the sound synthesis and signal processing to a digital signal processor (DSP) board (such as the Ariel ISPW which was used for Max/FTS). 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 (audio) 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 (in Pd, all numbers are stored as 32-bit floats). 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 many programming languages, to general and specialized audio-rate DSP functions (designated by a tilde (~) symbol), such as wavetable oscillators, the Fast Fourier transform (fft~), and a range of standard filters. Data can be loaded from file, read in from an audio board, MIDI, via Open Sound Control (OSC) 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:

Pd is designed to offer an extremely unstructured environment for describing data structures and their graphical appearance. The underlying idea is to allow the user to display any kind of data he or she wants to, associating it in any way with the display. To accomplish this Pd introduces a graphical data structure, somewhat like a data structure out of the C programming language, but with a facility for attaching shapes and colors to the data, so that the user can visualize and/or edit it. The data itself can be edited from scratch or can be imported from files, generated algorithmically, or derived from analyses of incoming sounds or other data streams.

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 (spawning, etc.) 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.

… excerpt ends here. Continue reading the full article.

Illustrations

Pure Data illustration
Pure Data illustration
Pure Data: Pure Data objects. The text strings to the right of the boxes are comments.
Pure Data objects. The text strings to the right of the boxes are comments.
Pure Data: Score for Hans-Christoph Steiner's Solitude, created using Pd's data structures
Score for Hans-Christoph Steiner's Solitude, created using Pd's data structures
Pure Data illustration

Worked examples

Example 1 — a first encounter with Pure Data

Start with the simplest possible case. Write down what Pure Data claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Pure Data before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Pure Data ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Pure Data

In research
Pure Data appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Pure Data in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Pure Data is common in secondary-school and first-year university syllabi. It links to neighbouring topics Audio programming languages, Electronic music software, Free audio software, so understanding it makes those chapters shorter.
In everyday life
Look for Pure Data outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Pure Data in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Pure Data means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Pure Data out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Pure Data in simple terms?

Pure Data (Pd) 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.

Why does Pure Data matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Pure Data?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Pure Data.

Tags

  • Audio programming languages
  • Electronic music software
  • Free audio software
  • Free software programmed in C
  • Node-graph-based visual programming languages
  • Software synthesizers
  • Software that uses Tk (software)
  • Software using the BSD license

Keep exploring