Oscillating
This post is part of a series of notes and exercises for a summer camp on making musical instruments with Arduino and Pure Data.
The very first thing we must do this week is make noise. We’ll create this patch in Pure Data to generate a single frequency:
Follow these steps to produce your patch:
- Open Pure Data. To find it, hit
Command-Space
to open Spotlight and typePd
. - Click File / New to create a new Pd patch.
- Click Put / Number to place a number widget in the patch.
- Click Put / Object to place an object widget in the patch. In the object’s box, type
osc~
. Thisosc~
widget generates a cosine wave at a given frequency. By itself,osc~
only generates numbers—the amplitudes of the wave over time—but not any audible sound. - Drag from the outlet on the bottom of the number box to the inlet of
osc~
. With this connection in place, the number shown in the box is the frequency of the generated cosine wave. - Create a second object and enter
dac~
—which stands for digital-to-analog converter. The job of a DAC is to turn the cosine wave into a signal that pushes the computer’s speaker in and out. - Connect the outlet of
osc~
to the left inlet ofdac~
. You still won’t hear any sound. - In the console window, check the DSP checkbox. A sound wave is now being generated, but it has frequency 0, which is arguably not sound.
- Change the frequency by dragging on the number box to change the number. You can’t do this in Edit Mode. Click Edit / Edit Mode and then drag. As the frequency increases, do you hear sound?
Challenges
After you get your patch working, answer the following questions on a piece of scratch paper.
- From time to time in these exercises, you’ll see questions whose answers are hidden until you click on them. The text is hidden to give you time to think and grow more wrinkles in your brain. After you answer, click on the text. What is the capital of Vermont?Montpelier
- What’s the lowest frequency you can hear? The highest?
- We call the lines that run from outlets to inlets edges. In Edit Mode, figure out how to delete edges. Delete the edge from
osc~
anddac~
. Add a new edge fromosc~
to the right inlet ofdac~
. What effect does this have? - In Edit Mode, box-select the three nodes by dragging from one corner of the patch to the diagonally opposite corner. Copy and paste (either via the Edit menu or the standard keyboard shortcuts) to produce an identical set of nodes. Investigate the dialtone heard on American landline phones. What is the standard? Produce the dialtone using your two wave generators.