CSI Lab 10
Tuesday, March 4th
Introductions
To complete this lab, you will need a couple of sound files on your computer.
Download the files below (or copy them off of the p: drive) and place them in the mediasources directory where you
have been placing your image files.
- A simple one second sound clip of the "A above middle C" -
orig440.wav
- Mark (the author of your textbook) reading the preamble to the
constitution - preamble.wav
- The simple trumpet fanfare we used in week one (should still be in your
mediasources folder)
You will also need a pair of headphones.
Activity A : Opening and Manipulating Sounds
- Load the A note file by typing one of the following
fileName = pickAFile()
s1 = makeSound(fileName)
or
setMediaPath()
s1 = makeSound("orig440.wav")
- Play the sound sample by
typing play(s1)
- [Q1] Find the value of the third sound sample by using the sound
explorer tool (Make sure you use the zoom feature so that you are actually looking at the
third sample)
- [Q2] What command(s) could you use to find the value of the third sound sample from the
interactions pane
- [Q3] Using the explorer find the amplitude of the second peak
- [Q4] Find the sample number of the second peak
- [Q5] Find the amplitude and sample number of the third peak
- [Q6] How far apart are the two peaks?
- [Q7] If there are 44,100 samples per second, then how many peaks can be obtained in
one second?
- The sound in this first file is a "pure" sound. That is, it
consists of one perfect wave. Most sound is not this way. Open and
play the preamble sound file
- [Q8] Describe the appearance of this sound wave.
Activity B : Increasing the volume of the sound
- Type in Program 51.
- Call the method with a sound of your choice
- Listen, does it sound louder?
- Use the explorer to confirm that it is louder
- Run the method two more times. Each time, confirm that this is
getting louder.
- [SIG1] Show this program to a TA.
Activity C : Decreasing the volume of the sound
- Type in Program 52.
- Call the method with a sound of your choice
- Listen, does it sound softer?
- Use the explorer to confirm that it is softer
- Run the method two more times. Each time, confirm that this is
getting softer.
- [SIG2] Show this program to a TA.
Activity D : Changing the volume of the sound
- Type in Program 53.
- Call the method with a sound of your choice and a factor parameter of 2.0
- Listen, does it sound louder?
- Use the explorer to confirm that it is louder
- Call the method with a parameter of 0.5.
- Listen, does it sound softer?
- [SIG3] Show this program to a TA
Activity E : Changing the volume of the sound???
- Write a method called shift()
- shift() should take an integer as a parameter and modify the amplitude of
each sound sample by simply adding the value of the parameter to every
sound sample.
- [Q9] Listen and explore. Is it any different? Why or why
not
Activity F : Normalizing the sound
- Type in Program 54 (p 162)
- Call the method with a sound of your choice
- Listen, does it sound louder?
- Use the explorer to confirm that it is louder
- [Q10] Run the method again. Listen and explore. Is it any different? Why or why not?
- [SIG4] Show this program to a TA.