Read Section 2.2.3 (Time Operations) of
Kreidler's on-line text, and Implement the Applications in section 2.2.3.2 (Automatic Random Melody, Glissando, and
the Combination). The Combination can be done with two copy and pastes and a little editing.
Keep all three applications intact and save the patch.
Notice that the Glissando Application uses the line object to change the
frequency of the oscillator.
The line object works at the control rate.
Ctrl-Click or Right-click to look at the help information on the line object.
The line~ object, with the tilda, works at the signal or audio rate, and
can be used to control the amplitude of an oscillator.
A related object is the vline~, which allows more than one ramp.
If you put a line~ object on a pd patch and
Ctrl-Click or Right-click on it you can read the help file and
how to use it.
Open pd and open a new file, save it is lab2.pd
Make your lab2.pd screen larger by dragging
on the bottom right of its window.
Make a 2-inch by 2-inch empty space in the
middle.
PUT an object called writesf~ in your
lab2.pd, and then right click on it to
get help.
Read the information on the writesf~help.pd
screen. Then copy the whole set of objects in
the top left of the help screen,
including the bang and del 1000.
Paste this subpatch in your lab2.pd.
You can delete the first writesf~ object you PUT
there since the new subpatch already has one.
Also, delete the osc~ 440 object that
came with the new subpatch.
Delete the second 2 "open" message boxes,
starting with open -bytes.
Change the file name
remaining open message
box to lab2.wav.
Change del 1000 to del 30000 so we
record 30 second of sound instead of just 1
(i.e. we now delay 30000 milliseconds).
Add a print object under the del 30000
with the label wait.
i.e. PUT an object and type
print wait
in it.
Then make a connection from the
outlet of del 30000 to the left inlet of
the print wait object.
PUT another del object under the print wait
for 60000 milliseconds, and connect the
outlet of the first del 30000 to the
left (hot) inlet of the second del 60000.
We are engineering a way to make ourselves be patient while writesf~
flushes its buffer out to the wav file.
Now PUT another object under the second del 60000 object
and this one will be print done.
Connect the outlet of the second del 60000 to the inlet of the print done.
Add a connection from your
osc~ object so it also goes into the left
inlet of the writesf~ object
as well as to the dac~.
Now we get to run our program
Leave edit mode (Ctrl-e) and click ON.
Click on the message box "open lab2.wav"
Click ON
Click bang, and then change the
frequency and amplitude by mousing the number
boxes. You have 30 seconds of fun.
Wait until you see print done in the main pd window
listen to lab2.wav
Place the
wav file on your web page along with
hw1.pd.
hw2 - Make 45 second composition.
Read Section 3.1.2 Volume of
Kreidler's on-line text. All about controlling amplitude/volume.
open a file in pd and save it as hw2.pd
Use the Automatic Random Melody, Glissando, and
the Combination examples, along with volume control elements, and elements from y our first
pd patch if you like them. Generate a 45 second composition. Write it to a file called
hw2.wav.