Lab 14
For this lab, you are to take a sound object and recreate
the effect of "scratching" used by Hip-Hop DJ's. This is
when the DJ uses a turn-table and quickly moves the record
backwards and fowards a few times.
Here are some
good files for the base sound:
For this lab, about 3-5 seconds into the playing of the sound,
you are to add a scratch effect, after the scratch effect is
over play another 3-5 seconds of the original sound.
The scratch effect should be done as follows:
- About 3/10ths of the sound played quickly forward
- The same amount of the sound played quickly backward
- Steps 1 and 2 repeated two more times.
The scratch effect should have sound played at more than double
speed (triple speed should be good). To "play" a sound at a faster
speed, we copy over only some of the sound samples. If we copy
every other sound sample we get a sound at double speed (which
is what was done on
Lect416a.java when we
doubled the pitch of a sound). If we copy every third sample,
we triple the speed of the original sound.
To "play" a sound backward, we must reverse the sound as was
done in Lect416c.java.
Of course there we reversed the entire sound instead of just
a small part of the sound.
Lab Assignment 14
Due: Thursday 4/30/2009 by 11:59 pm
Create a Java program that will:
- Contain a comment indicating
- your Name,
- Net-ID,
- Course Name,
- Assignment Name and
- a short description of
the assignment
- Contain the main() method that will
- Prompt the user for a sound file and make a sound object
from this file.
- Create a sound file of the "proper" length.
- Copy over about 3-5 seconds of the original sound.
- Call the method addScratch( ) to insert the Scratch Effect
using the original sound as the base for the scratch effect.
- Copy over the next 3-5 seconds of the original sound.
- play (or explore) the resulting sound and prompt the user to save it in a file
- The method addScratch ( ) is to:
- Have about 3/10ths of the sound played quickly forward (at about triple speed)
- The same amount of the sound played quickly backward (at about triple speed)
- Repeat steps 1 and 2 two more times
Here are some example sound files you can use with this assignment.
Submittal of the Lab Assignment
- When saving your program, use a meaningful name like lab14.java.
- You are also to submit the Java file
electronically by
using the UNIX turnin command.
To use the UNIX turnin command to electronically hand-in your
html file using the project name of lab14. To submit the file
lab14.java for lab14, the turnin command is entered as:
turnin -c cs101 -p lab14 lab14.java
To verify what you submitted using the turnin command type:
turnin -c cs101 -p lab14 -v