Professional Documents
Culture Documents
puredata2
puredata2
Session 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.
Switch to performance mode and manipulate each object to see what it can do.
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.
Signal Order (with example)
- Objects always process inlets and outlets from right to left so it is important to
make sure signals arrive at an object in the correct order (rightmost inlet first).
- To do this we use a trigger object.
Trigger Used to control the order in which a signal is sent to
different objects. It will send the signal to the rightmost
object first. Here is an example of the order…
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 x 24
- 0.4 / 0.56
- 65 – 8.5
- 34 + 5 + 9
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.
Practice Task
Create a basic counter that is automatically triggered by a metro object.
Experiment with different speeds and try changing [+ 1] to a different object or number.
Triggering events with select
- At the moment, our counter will keep increasing infinitely.
- We can use a select object to reset out counter.
- 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 that counts up from 0 to 7 before resetting to 0.
- A counter that counts down from 10 to 0 before resetting to 10.
- (Extra) A counter that continuously counts up from 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 a sequencer as shown above.
Create your own melody by adding message boxes to the different steps in the sequence.
Session 2
Randomness
- To automate a counter, we need a metronome to automatically trigger it.
- 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.