Welcome back! Oh, wait, I am the one who returned. It's good to see you all again.
Today, we returned to playing with sounds, especially the additive behavior of sounds waves. Adding sound samples arbitrarily doesn't do much for us, but using variations on the theme leads to interesting effects, like blending, chording, and echoes.
Here are the slides (PDF) I used and a script of some of our Dr. Java interactions, and the Sound.java file that we produced.
I didn't tell you much about my week at OOPSLA, today, but we will have an opportunity to discuss some of my activities next week, when we step back from images and sounds to talk about our programs at a higher level.
As is now our pattern, please take a pair of headphones with you to the lab tomorrow, if you have them.
Finish reading Chapter 10 of the textbook for our next session. Your next homework assignment won't come out until then.
This assignment consists of two tasks. Put both methods in the same Sound class, along with any helper methods you create.
Task 1
In Program 74, Guzdial and Ericson splice the word "united" from later in the preamble to the Constitution into the earlier phrase "We the united people...". Let's emphasize that word by making it maximally loud for the sound file.
Modify the method to normalize the spliced-in "united" in "We the united people...".
Task 2
Compose a sentence that I never said using the sound clip of The Voice of CS I. That sound file has a lot of empty space and white noise in it, so there is plenty of room for you to rearrange words around, splice words in, and otherwise "doctor" the audio.
Write a method named doctorTheVoice() that loads that sound file using getMediaPath(), modifies it, and returns the modified sound as its result. Make at least three different changes to the sound. You may use words from the mediasources folder, the clipped but high-pitched version of my voice, or even words you record on your own. But the bulk of the result should be my words.
Be sure to include a pause between words so that we can hear them distinctly. (I suppose that running a couple of words together could for an interesting effect, so I'll give leeway where the sound is interesting!) 1/10 of a second is usually a reasonable pause. Recall that sample values of 0 generate silence.
For example, I applied....
How We Will Grade Your Assignment
This assignment is worth 20 points.
We will...
String silence = FileChooser.getMediaPath( "sec3silence.wav" ); Sound target = new Sound( silence ); target.splicePreamble(); target.play();Sound theDoctorsVoice = silence.doctorTheVoice(); theDoctorsVoice.play();
Deliverables
By the 8:00 AM on Tuesday, October 31, submit these files:
Today, we played a lot with sound, including generating some mathematical curves and listening to them as sounds and answering some open questions from past sessions. Here are the slides (PDF) I used and a script of some of our Dr. Java interactions, and the Sound.java file that we produced. You can also have the recordings of my own voice via this zip file.
Recall that we do not have class next week, as I will be on the road at OOPSLA, the best conference around on programming and programs. (Check out who's in charge of the tutorials track...)
You can use the open class time to study, program, or catch up on lab exercises. TA Mike Volz will hold lab hours during our regular class time, 12:30 PM-1:45 PM on Tuesday and Thursday, in 339 Wright. He can answer questions and generally help you catch up or move forward. His lab schedule for the week will be:
You will have lab as usual -- don't forget to take a pair of headphones with you if you have them.
Read Chapter 10 for our next session, October 31. And solve Homework 5 -- it is due on Halloween as well!
I'll be in e-mail contact next seek, so drop me a line. I'll try to enjoy rainy Portland, Oregon!
Today, we discussed a solution to Homework 4 and then moved on to more sound manipulation, including "posterizing" (with sound, known as "clipping"), making a sound clip, and increasing/decreasing a sound's volume in a linearly increasing/decreasing way.
Here are the slides (PDF) I used and a script of some of our Dr. Java interactions, and the Sound.java file that we produced. You can also have the recordings of my own voice via this zip file. Now, if you ever feel the need to hear my soothing voice, you can -- speaking through Dr. Java or your own mp3 player!
Read the rest of Chapter 9 for our next session. And don't forget to take a pair of headphones with you to the lab tomorrow.
Today, we discussed some basic operations on sounds, and learned that our -- well, at least my -- intuitions about how sound works are not so good. We reminded ourselves of something we learned last time, intellectually at least: that human perception of sound is about ratios, not absolute values. Experimentation will help all of us develop better instincts.
Here are the slides (PDF) I used and a script of some of our Dr. Java interactions, and the Sound.java file that we produced.
Read the first half of Chapter 9 or so for our next session. Again, notice how much of the Java we use for sound processing resembles the Java we wrote to process images.
And keep working on Homework 4, which is due next Tuesday, 8 AM.
Today, we finished off our main discussion of images with a quick look at "chromakey", or the use of background subtraction to replace the background of a picture. Then we moved onto our next unit -- sound -- and considered both same basics of representation and some Java. Oh, and we discussed the results of the first exam a bit.
Here are the slides (PDF) I used and a script of some of our Dr. Java interactions. We used three different Java files today, a Picture class with code snippets from the exam, a Picture.java file for chromakeying on blue, and a Sound.java for learning some basic sound manipulations -- and two bonus methods by yours truly.
Read deeply into Chapter 8 for next session. Notice how much of the Java we use resembles what we wrote for manipulating images! Be sure to play with the code as your way to understand the encoding of sound samples.
And keep working on Homework 4, which is due a week from today. It should be fun -- and even has opportunities for extra credit!
Quick Overview
Your task this week is to write a method that creates a comic strip using pictures of your choosing. The strip must have at least four frames in it. Here is a sample, a two-frame comic strip from the authors of our textbook.
After deciding on images and a theme, you will want to plan ahead a bit, to design the layout of your comic strip. Here is an example of the planning that the authors did while creating their sample strip.
Details, Details
How We Will Grade Your Assignment
This assignment is worth 30 points.
We will...
ComicStrip comic = new ComicStrip( width, height ); comic.createStrip(); comic.show();
Extra Credit Opportunities
If your comic strip makes sense -- that is, isn't just a bunch of pictures thrown together, but actually "tells a story" -- then you will eligible for two (2) extra-credit points.
If your comic strip uses a background picture from some image file in at least one of the frames, then you will be eligible for four (4) extra-credit points.
Deliverables
By the 8:00 AM on Tuesday, October 17, submit these files:
Today, we played a bit with loops and their control elements. Our coolest product was a method to draw blank Sudoku grids. At this point, the method uses hard-coded values. A great exercise for your home study is to parameterize the method so that it can create grids of any size!
Here are the slides (PDF) I used and a script of some of our Dr. Java interactions. We produced a version of Picture.java that creates this sort of blank grid. (I also showed you a quick-and-dirty program to turn numbers of seconds into strings. Use at your own risk!)
Begin reading Chapter 8 for next week. We may spend a few minutes looking at Chapter 6 chromakey technique, but we are ready to move on to processing sound!
Homework 4 is available now and will be due a week from Tuesday. It is worth a few more points -- and will take a bit longer than our previous assignments. So don't use the later deadline as an excuse to delay your start...
The main event today was our first exam, but we did spend a few minutes talking about Homework 3 and a lesson a few of you learned about just how long a seemingly simple method can take. As usual, I have these materials for you from class: the slides (PDF) I used and a script of some Dr. Java interactions, and a version of Picture.java that we used in our exercise.
In the lab tomorrow, you will work with some of the fun graphics material from Chapter 7. In class on Thursday, we will talk about one remaining idea from Chapter 6 -- greenscreening -- and wrap up a bit of graphics. Next week, we will move on to processing sound!
With Homework 3 due today and Exam 1 today as well, I'll give you a short break from programming. Homework 4 will probably come out on Thursday.