Creating a simple delay effect with Pd

This post aims at showing new Pd users how to build a first patch that can be used as a real-time effect for the electric guitar (actually for just about any instrument). I will first show you how to create objects in a blank Pd patch. Then we’ll make a simple delay effect for the guitar (you can listen to a sample at the end of this post). It is aimed at people who have NEVER used Pd before. Anyone with a basic knowledge of Pd should move on to the next post.

Once you have installed Pd, you should see the following window on launching it :

Pure Data console

Click on “File” –> “New” to open a blank patch. A blank window pops up :

Pure Data blank patch

Click on “Put” to view a list of objects that you can use to build a patch.If you click on vslider for instance, a vertical slider appears in the patch.

Pure Data objects - example

The most useful object in the picture above is the one in the upper left corner with a red line around. It is a generic object, which can be used to create any object in Pd’s libraries.

You can create a [adc~] object by clicking in this generic object box and typing “adc~”. “Adc” means Analog-to-Digital Converter : this object capture the incoming audio data from your soundcard. The tilda (“~”) is shared by most “audio” objects in pd. It simply means that this object takes audio signals as inputs and/or outputs.

Now that you know how to create virtually any object in Pd, you can delete all the objects in our patch but [adc~] (we’ll use it to create the delay effect). To delete an object, just click on it and press Delete. You can select more than one object by clicking somewhere in the patch and dragging the mouse : a rectangle should appear that highlights (selects) every object it covers.

Let’s stop a few seconds to explain how objects in Pd work together. There are two types of objects : the “audio” objects and the “control” objects. The first process audio signals, whereas the later deal with all the rest (numbers, symbols, lists, etc.). In order to create a patch, objects must be connected together by “cords”. You must click one outlet of an object and drag the mouse to the input of another object to connect them together (they’re only connected if you can see the cord). Please note that audio inlets and outlets are represented by a grey rectangle, while control inlets and outlets are empty rectangles. You must connect audio outlets with audio inlets.

Below is a picture of the finished patch to get a delay effect for the guitar. It is a good idea to start by copying patches in Pd off a picture of a working patch (like those in the FLOSS manuals). I encourage you to copy this patch “by hand” in order to get familiar with the creation of objects and connecting them together.

In the picture above, the path of the audio signal follows the green arrows (the one to the right means that we feed the output of the delay line back into its input to get a repeating delay effect, like an echo). If you try to copy this patch into a blank patch in Pd, you have to only copy the objects and cords (the arrows and comments were added by myself in Gimp 🙂 ).

The above patch will work with any sound source, either a guitar plugged in the soundcard or a voice through a microphone. You can try it easily (without using JACK, and even without an external soundcard) by plugging your guitar or a microphone into your laptop (or by using the internal mic). Just turn the audio on by clicking on “Media” –> “Audio ON”, and enjoy your first effect created with Pure Data!

  • Simple delay for guitar using Pd for dummies (really, you should try and build the patch yourself!) : download the patch here.
  • Listen to a sample :
This entry was posted in Simple effects and tagged , , , , , . Bookmark the permalink.

8 Responses to Creating a simple delay effect with Pd

  1. Pingback: Use the value from a pot connected to Arduino in Pd | Guitar Extended

  2. steve says:

    Thank you – that was a very simple and useful tutorial!

    • Hi, thanks for your comment. As you get better in Pd and DSP, you’ll see that delay lines are a very versatile tool that can be used for many different effects (phasing, vibrato, pitchshifting, arpegiator, and what not). So understanding how they work is a very good start.

  3. esaruoho says:

    Hi, I really appreciate that you took the time to explain about feedback (delwrite~ – delread~ – delwrite~) 🙂 I now have delay length control over both left & right channels, a gain slider and a feedback slider.

    I would love it if you could post something about pitchshifting and arpeggiator usage of delwrite~ / delread~ .. If possible?

  4. Question from a complete newbie. Is it possible to attach a slider or something to control the delay?

    • Of course. Simply link the outlet of your slider to the inlet of the [delread~] object. Make sure the maximum value sent by the slider does not exceed the maximum length of your delay line, as set in the [delwrite~] object (500 ms in my patch).
      You can similarly control the feedback amount by connecting a slider to the [*~ 0.6] box (make sure the max doesn’t go much above 0.9 or it could rapidly get extremely loud and distorted !).

  5. esaruoho says:

    Whenever I move a slider to alter the delay length in ms, there is an audible click – how do I get rid of the click? Some sort of ramp or glide for parameters?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s