Lab Goals and Policies
Labs are an opportunity to work together with a partner on exercises to reinforce concepts from lecture and to prepare for problems on the problem sets. A successful lab experience requires each member to contribute equally. In pair programming, one student is the "driver", who controls the keyboard and mouse. The other is the "navigator", who observes, asks questions, suggest solutions, and thinks about slightly longer-term strategies. The two programmers switch roles about every 20 minutes. If you believe your partner is not participating appropriately in pair programming please first address your concerns to your partner, and try to agree on what should be done to make the pair programming more successful. If that approach is not successful, explain the issues to one of your instructors, who will work with you and your partner to improve the situation.
W Written Exercises
-
Write out the first five partials from the harmonic series of the following fundamentals:
- 100Hz
- 550Hz
-
Any two frequencies specify a musical distance. There are several different ways we can analyze this distance. One is to simply to take the difference. But we as listeners perceive the distance between frequencies as ratios. In musical terms, we call this distance an interval. For example, an octave is a musical interval whose ratio between the two frequencies is 2:1. Below, determine whether the musical intervals between the two pairs are the same. Also specify what the specific interval is called in music. You can use the chart expressed here to identify them.
- The distance between 300Hz and 600Hz vs. the distance between 600Hz and 900Hz
- The distance between 100Hz and 200Hz vs. the distance between 200Hz and 400Hz
- The distance between 300Hz and 400Hz vs. the distance between 1200Hz and 1600Hz
-
Consider a fundamental of 300Hz, write out the first four harmonics (including the fundamental) of the following waves. State the frequency, phase and amplitude. Assume the fundamental has an amplitude of 1.
- A sawtooth wave
- A triangle wave
- A square wave
-
Using summation notation, express the waveform that consists of every partial from the harmonic series where each harmonic $n$’s amplitude is $1/\sqrt{n}$ of the fundamental’s amplitude. The phase of each partial alternates between 0 and $\pi$ with the fundamental at phase 0.
C Coding Exercises
To get started, open up a new blank file in the SuperCollider IDE.
-
The duplication method/operator (i.e.,
.dup
or!
) is a very handy operator in SuperCollider to quickly generate arrays of duplicated objects. Let’s get some practice.- Use the duplication operator to produce an array
[4, 4]
. - Use the duplication operator to produce
[true, true, true]
. - Use the duplication operator to produce the array
[1, 2, 3, 4]
. Hint: think about using the duplication operator with a function. - Use the duplication operator to produce the array
[1, 4, 9, 16, 25]
.
- Use the duplication operator to produce an array
-
For this question, use the UGens
Saw.ar
for a sawtooth wave,Pulse.ar
for a square/pulse wave, andLFTri.ar
for a triangle wave. In this question, you will be writing functions to playback sound using the method.play
. For each part, write a function that produces the desired sound using these UGens. Curious what the waveforms produced are? Open up the scope and use the horizontal and vertical sliders to zoom in on the waveform to see the shape produced. You can open up the scope using the lines.scope
.-
A sawtooth wave of frequency 440Hz and amplitude of 0.1 added to a triangle wave of frequency 880Hz and an amplitude of 0.1. The sound should be one channel sent to the left speaker.
-
A square wave of frequency 100Hz and amplitude of 0.1. The sound should be stereo (i.e., we should hear the same audio signal out of both speakers).
-
A pulse wave of duty cycle 0.75, frequency 200Hz and amplitude 0.1 added to a triangle wave of 400Hz and amplitude 0.1. The sound should be stereo. Try using the duplication operator to produce the stereo sound.
-
-
Create an audio signal with the characteristics from Exercise 4 from the Written Exercises. You should build your waveform by summing sine waves using the UGen
SinOsc.ar
. Use the examples from the “Waves” lecture as your guide. To test whether your waveform is accurate, here is snapshot from the scope to compare against your waveform.Some other details:
- Include the first 30 harmonics
- Assume the frequency of the fundamental is 440Hz and the fundamental’s amplitude is 0.1.
Solutions
Solutions to the lab will be posted after the lab is over.
lab_waves_solns.pdflab_waves_solns.scd