Puredata
Puredata
1
Pure Data is a data flow programming environment. This means that instead of using written lines
of code it looks a bit like a flow chart. PD works in a similar way to a modular synth; by
connecting different processing modules (called objects) together, you can create and control
different audio and data signals.
Block Types
- There are several different types of processing block/box in PD, each with a different job.
- Different types of boxes have different shapes to distinguish them.
- To add a box, use the put menu. Each type of box has a useful keyboard shortcut.
Object
- Used for processing sound and data.
- There are many different objects that perform a range of processes.
- When you create an object, you can write in it to change what it does.
- Some objects can be further customised with arguments (other numbers after the initial
object name). - Rectangular shape.
Message Box
- Used to send numbers/messages to other objects.
- Sends its message when receiving a signal or when manually pressed. -
Rectangle with the end cut out like flag.
Number Box
- Used to display or edit numbers.
- Value can be changed by clicking and dragging the number in performance mode. -
Rectangle with the corner cut off.
(If the block says symbol then you have the wrong one.)
Symbol
- Used to display text.
- We won’t be using this one. Just including it for completeness.
Bang
- Used to send a signal (bang) that can trigger other objects.
- Sends a bang when receiving a signal or when manually pressed. - Square
with a circle inside.
Toggle
- Used to turn objects on or off.
- Sends out a number value of 0 or 1. - Square.
Practice Task
Using edit mode
, create each type of
object.
Signal Types
- Blocks can communicate with each other using a variety of different signals.
- The connection points at the top of a block are inlets and the connection points at the
bottom are outlets. Only outlets can connect to inlets.
Bang
- A short signal used to trigger other objects.
Number (Float) - A
raw number.
Audio
- Raw audio signal.
- Objects that process audio are denoted by a ~ (tilde) - Audio
connections look thicker.
The letters after the t indicate the type of signal that will be
sent. a can send any signal. b can send a bang. The number of
extra letters equals the number of outlets.
Maths Objects
- Maths objects are used to perform calculations and transform numbers.
Add Adds the value of the left inlet to the value of the left inlet.
Subtract Subtracts the value of the right inlet from the value of the left
inlet.
Multiply Multiplies the value of the left inlet with the value of the right
inlet.
Divide Divides the value of the left inlet with the value of the right
inlet.
Practice Task
Create Pure Data patches to solve the following maths problems:
- 765 24
- 0.4 x 0.56
- 65 –/ 8.5
- 34 +9
5
Basic Counter
- One of the most useful things to know how to build is a counter.
- To build a counter we need to be able to store numbers. We do this using a float object.
- Below is an example of a simple counter where the value increases by + 1 each time the
bang is pressed.
- When the float receives a bang, it outputs the number it has stored. This number goes
through a [+ 1] maths object and then back into the float where the new value is stored.
- In the example below, the counter will count up to 10 before resetting back to 0.
- When select detects a 10 it sends a bang out which activates the 0 message. This message
changes the value of the float.
- A trigger is used to make sure that the 0 message will arrive at the float last. This ensures
that it is the number that will be stored.
Practice Task
Create the following types of : counter
- A counter thatcounts up from 70 before resetting0.
- A counter thatcounts downto from 10
before
to to resetting to
. 10
- (Extra) A counter that
continuously
0 counts upfrom 0 to 10 and back . down
to 0
Creating a simple sequencer
Example
- The counter counts from 0 to 7 (8 beats).
- The select object detects each number in the sequence outputs a bang for each one. The
number 7 is used to reset the counter.
- These bangs are then used to trigger messages containing MIDI numbers.
- The MIDI numbers are then converted to the correct frequency (Hz) before being played
back by an oscillator.
Practice Task
Create asequencer as shown above.
Create your own melody message
by boxes
to thedifferent steps in the sequence.
adding
Session 2
Randomness
- To automate a counter, we need a metronome to automatically trigger it.
- True randomness is impossible to create electronically. We can alter the random algorithm
using a seed message. This is useful when you have multiple identical random objects.
- This message requires a number after the word ‘seed’.
- Random can be combined with select to pick a random value from a set of options (similar
to a [ ].choose in sonic pi).
- This example shows a random object selecting and playing from three pitches.
Session 3
Oscillators
Sine Wave Generates a sine wave. Pitch is dictated by an argument or
inlet value
Saw Wave Generates a saw wave. Pitch is dictated by an argument or
inlet value
Noise Generates white noise.
Volume Control
Audio Audio signal version of a maths object. Used to
Amplifier increase the amplitude (volume) of a signal.
- Below are two examples showing how to control the volume of a sound using the [*~]
object.
- The example on the left is simpler while the example on the right is more complex but
sounds better (no popping noises).
Delay
- Creating a delay requires two objects. One to record the delay and one to play it.
- Each separate delay needs a different name.
- Below is an example of the signal from an oscillator being recorded and delayed.