Music 250 - Winter 2005
Human Computer Interaction Theory and Practice: Designing New Devices
A Short Guide to Pd & OSC (1/19/05)
Introduction
In this "quick" tutorial, we will learn
how to run Pd and create patches. We will also make patches of noise
generator, sinusoidal oscillator, and a simple additive synthesis. Communication with the AVR boards through Open Sound Control will also be covered.
Instruction
Run & new patch
- Run Pd (Main Menu - Sound & Video - Pd, or just type pd in a
terminal)
- Make a new patch (File - New, or ctrl-n)
- In the patch window, we can create a new object (Put - Object, or
ctrl-1). You can specify the type of object by typing its name (to see
the list of "object" classes, right-click on the "canvas" and choose
"Help").
Noise generator
- To make a noise generator, we need a noise object. Type "noise~"
and click outside the object box to 'activate' it.
The "~" at the end of the name means it's working at audio frequency
rate.
- And to hear the sound, a digital-to-analog converter is needed.
Put another object named "dac~" the same way.
- By dragging the mouse, connect the bottom-left corner of "noise~"
(which is the output of the object) to top-left of "dac~" (the input to
the left channel of the DAC). Notice that the cursor turns into a small
circle when placed on the "nodes".
- Turn on the audio (Audio - On, or ctrl-/), and check the noise
coming from left channel.
(If you want the same noise coming from both channels, make another
connection from the "noise~" object to the top-right of "dac~".
Sinusoidal oscillator
- Now we need an oscillator, not a noise generator.
Convert the noise object into a sinusoidal oscillator; rename it as
"osc~".
It has two inputs and one output.
To get more information about them, see the "Help" in its patch by
right-clicking on the object and choosing "Help".
Now you know that the left one is for frequency, the right one for
phase (which we won't care within this tutorial).
- Turn the audio on. Since you didn't put any frequency value to
the oscillator, you won't hear any sound by now.
- Let's specify the frequency; put a "Number" (Put - Number, or
ctrl-3), and connect its output to the frequency input (left) of the
"osc~".
- Now get out of the edit mode (Edit - Edit Mode, or ctrl-e), and
change the value of the number object (that is, oscillator frequency)
by drag-n-dropping the mouse over it. You should be able to hear the
sound (BTW, this is a very good patch to test your hearing ability in
terms of pitch ;> ).
(Probably the simplest) additive synthesis patch
- Now we need one more oscillator(s), add their outputs, and send
it to DAC.
First, make sure you're back in the Edit mode.
- Disconnect the oscillator from the DAC; select the connection by
mouse and press "Delete".
- Copy the number and the oscillator set; select them by mouse and
Edit - Copy (or ctrl-c).
- Paste them, and move it away from the original one.
- Now add the outputs of those oscillators
Put a new object, name it as "+~". Make connections from each
oscillator to the inputs of the adder. Also, connect its output to DAC.
- Get out of the edit mode, and change the frequencies the same way.
- Question: what will happen if we use "*~" instead of "+~"?
Examples
OSC: OpenSound Control
Using OSC in Pd
- OSC object: load OSC library.
- sendOSC object: to send out OSC data
- dumpOSC object: to receive OSC data
- dumpOSCSerial object: to receive OSC data through serial port
- OSCRoute object: to route incoming OSC data based on their address
space
References
Helpful links about Pd, OSC (and sound synthesis in general):