PD – Pure Data – A Public Domain Patching Environment for Music and Video


PD is a useful and very versatile visual (and free) programming language for sound and video in which you can build your own composing systems from the ground up.


by Warren Burt, Jan. 2016

In David Baer’s review of Andy Farnell’s “Designing Sound” in this issue of SoundBytes, he points out that the book is filled with examples using Pure Data, more commonly referred to simply as ”PD”.  So what, exactly, is PD?  Briefly, it’s a free public domain visual composing language for music and video.  It uses graphic objects instead of computer code to make its functions.  You place these objects into a window (a canvas), and connect them with virtual patch cords, just as you would in an old fashioned analog synthesizer.  Your patches (the diagrams you make in PD) can be as simple or as complex as you like.  It is supported by a very large international community of developers, enthusiasts, and academics.  And there are a lot of resources out on the web for people who need help, or who want to try out resources that others have developed using the program.  It works on PCs, Macs, and Linux machines, and if you use the MobMuPlat app, you can even run PD patches developed on your computer on your iOS or Android tablet or phone.  A number of programs already released for both computer and tablet formats are based on PD, such as Elastic Drums (for iOS) and the Hayward Tuning Vine (for PC).

Your starting point for investigating PD is https://puredata.info/. This is a comprehensive site for those interested, with lots of documentation, examples, shared patches, etc.  It’s from this site that you can download a version of PD that will be suited to your machine.  Currently, up-to-date versions of, for example, PD-Vanilla for Linux, PC, OSX (from 10.3 to the present) and the Raspberry Pi single-board processor are available. (The other version is called PD-Extended, and includes a lot of resources developed by members of the PD community.)

Next, to learn PD, you’ll need an instruction manual.  PD is a very complex language, just like, say, Finnish, or Pitjantjatjara, and you’ll need to learn the vocabulary (the objects and what they do) and the syntax (how those objects are put together).  And then, just like any language, you have to practice with it.  But, like any other language, once you’ve learned a bit of it, you can start to function with it, and learn more and more of it as you go on.  Fortunately, there is a free on-line manual to learn this free program: http://en.flossmanuals.net/pure-data/. This is part of the Floss Manuals series which are instruction manuals for many of the most useful of current free programs.  Among the current sound programs that Floss Manuals cover are Ardour, Audacity, CSound, and ChucK.  I would highly recommend that if you’re wanting to learn PD, use the Floss Manual – it’s comprehensive and filled with examples.  I had difficulty downloading the zip files of the example patches, but I didn’t mind that, because that forced me to construct the patches from the pictures in the manual, and that provided a lot of practice in learning the program, or relearning in my case.  I had learned PD back in 2005, and then taught it at an introductory level in 2012 and 2013, but I had pretty completely forgotten everything I knew in the intervening years.

PD was written by Miller Puckette when he was at IRCAM (the French computer music research facility) in the 1980s.  Two programs, very similar, but which by now have evolved into distinctly different environments, came out of this work, PD and Max/MSP.  Both programs feature visual programming environments, both connect modules (functions) with patch-cords, and both can be used for real-time, or non-real-time applications in both music and video.  PD is free, and relies on the work of a large international community of volunteers to keep it going and growing.  Max/MSP is a commercial program, available from Cycling 74 (https://cycling74.com/products/max/) and has a lot of in-line documentation.  Skills acquired in using one language are directly applicable in the other.

The Floss Manual has an excellent guide to downloading the version of PD that would be right for you, and how to install it on your computer.  Assuming you were able to do that ok, let’s take a look at the bare beginnings of how to program in PD.

When you first start up PD, you’ll get a screen that looks like the left hand half of the screenshot below.  This is the basic window for PD.  I’ve also selected the “Media” menu and brought up Audio and MIDI settings, which you can see in the right half of the image.  Also, I’ve checked the “DSP” checkbox in the upper right of the main window, to turn on sound processing in PD so it will talk to your computer.

I then go to the “File” menu at the top left of the main window, and select “New.” This gives me a blank canvas that I can now patch things in.  The original window will be used for giving you messages about the program’s running.  In image below, you can see that numbers selected in the right screen are being printed in the original window on the left.


The Canvas has two different modes, “Edit” and “Perform.”  You move back and forth between them by clicking CTRL + E, or by selecting the Edit Mode from the Edit Menu.  In Edit Mode, you select objects, label them, connect them, etc.  In Perform Mode, you make adjustments to your controls and change your sound in real time.  I personally find this a minor problem – I’m continually wondering why things aren’t happening the way they should, until I realize that I’m in the mode where what I want to do is not possible.  For example, being in Edit mode and trying to change a number in a number box.  That’s only possible in Perform mode.  With some experience, though, you’ll learn to get comfortable with the two modes.

Once you’re in Edit Mode, you can now begin to select objects of various kinds and place them on the screen.  The next image shows most of the kinds of objects that you can select in Edit mode with the Put menu. 


In this screen, we can see the list of objects in the upper left, then a series of objects in the middle and the right.  Starting from the top middle, we have an object which handles data, in this case, “print”.  PD is case sensitive, so be careful here!  There are a couple of hundred kinds of objects that handle data in PD, so exploring all of them will take a while.  Below that is another object, but this one is for generating or processing audio.  The use of the tilde {~} at the end of a function says that this is an audio object.  In this case “osc~ 441.25” is a sine wave oscillator playing at 441.25 cycles per second.  It’s important to be careful with the final tilde for audio objects.  For example, “tabread” is a function to read data from an array (or a table); while “tabread~” is a function that will read the data in an array as a waveform.

Below the osc~ are four special kinds of objects: Message, Number, Symbol and Comment.  They all have different functions for sending and loading data around a patch, except for “Comment” which is what it says, and which you should make a lot of use of so that when you reopen your patch months later, you can remember what it does.

To the right are a number of useful objects: “Bang” is an all-purpose trigger, “Toggle” is a simple on-off switch.  “Number 2” is another number box, with a couple of different functions.  “Vertical Slider” and “Horizontal Slider” are slide controls for generating numbers.  By right clicking on them, a properties menu comes up (as it does on all PD objects) in which you can set the ranges and behaviors of the objects.  Similarly “Vertical Radio Button” and “Horizontal Radio Button” allow you to select between a series of values.  Notice that I’ve set the Vertical to 8 steps and the Horizontal to 12 steps for this example. 

Below this is a VU meter, and at the bottom left is a “Drawable Array.”  This is one of the most versatile modules in PD.  It can be used to store data, or audio, or to draw patterns in real time, or many other functions.  It can function as an oscilloscope, or to store samples. 

Connecting the objects is done as in this excerpt from the Floss Manual.  This diagram shows, while in the Edit Mode, how to connect and disconnect objects. 


Learning to patch in PD is an art all its own.  The Floss Manual covers this in great detail.  However, just to get you started, here’s a small patch, heavily commented, in which as you play on a MIDI keyboard, you can get a monophonic melody.  You can change the relative volumes of a sine wave, and a sawtooth wave playing a perfect 5th above the sine wave, and you can change the envelope slopes as well.  Note that data connections are represented by thin lines, while audio connections use thick ones.   It’s a very rudimentary patch, but it shows some of the capabilities of the program.  Remember, the more you practice programming, and the more elaborate your patches get, the more you’ll be able to accomplish.


This article is just a bare beginning look at the PD environment.  In the next issue of SoundBytes, in Music on Tablets, I’ll go a little deeper into PD, when I review the iOS and Android app “MobMuPlat” which enables you to turn your PD patches into functions which play on mobile platforms.  Until then, happy patching.


Browse SB articles
SoundBytes mailing list


Welcome to SoundBytes Magazine, a free online magazine devoted to the subject of computer sound and music production.


If you share these interests, you’ve come to the right place for gear reviews, developer interviews, tips and techniques and other music related articles. But first and foremost, SoundBytes is about “gear” in the form of music and audio processing software. .


We hope you'll enjoy reading what you find here and visit this site on a regular basis.

Hit Counter provided by technology news