CSI Lab 8
Tuesday, March 3rd
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)
- Open s1 in the Sound tool (under the MediaTools menu). Right now you
will see the entire sound file compressed to fit in the window. In
reality, it is much larger than that
- Press the "Zoom In" Button so that each sound sample in the sound takes 1
pixel on the screen.
- [Q1] Find the value of the third sound sample (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 22,050 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 on the same sound file. Each time, confirm that this is
getting louder.
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 on the same sound file. Each time, confirm that this is
getting softer.
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?
Activity E : Changing the volume of the sound???
- Write a method called shift()
- shift() should take in a sound sample and an integer as parameters 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