Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 102 Computers In Context (Multimedia)‏ 04 / 01 / 2009 Instructor: Michael Eckmann.

Similar presentations


Presentation on theme: "CS 102 Computers In Context (Multimedia)‏ 04 / 01 / 2009 Instructor: Michael Eckmann."— Presentation transcript:

1 CS 102 Computers In Context (Multimedia)‏ 04 / 01 / 2009 Instructor: Michael Eckmann

2 Michael Eckmann - Skidmore College - CS 102 - Spring 2009 Today’s Topics Questions/comments? Chapters 6 & 7 –Sound How to read/manipulate sound w/ JES –Normalizing –Clipping –Processing only some range of the samples –Splicing sounds

3 Michael Eckmann - Skidmore College - CS 102 - Spring 2009 Normalizing sound To normalize sound, we want to alter the samples by the same factor while making the largest sample be the maximum value (32767.)‏ To do this, we need to find the value of the largest sample in the sound. Then figure out what factor could we use to multiply that sample's value by to get 32767. Then use that same factor to multiply by all the other samples.

4 Michael Eckmann - Skidmore College - CS 102 - Spring 2009 Clipping sound We experienced clipping last class when some of the louder sounds got doubled and the result would have been over 32767 so we clipped them at 32767. If we made every sample either 32767 or -32768 then that would be extreme clipping --- every sample would be clipped. Any suggestions on how we could do this? Any guesses on how it will sound?

5 Michael Eckmann - Skidmore College - CS 102 - Spring 2009 Processing a range of samples Similar to how we processed image pixels we were able to go through the entire image with a loop like this: for pixel in getPixels(pic): or go through say just the left half of the image like this: for col in range(1, getWidth(pic)+1): for row in range(1, (getHeight(pic)+1)/2): pixel = getPixelAt(pic, col, row)‏

6 Michael Eckmann - Skidmore College - CS 102 - Spring 2009 Processing a range of samples We can also process all the samples in a sound using: for sample in getSamples(sound): value = getSample(sample)‏ or go through say just the left half of the sound like this: for i in range(1, (getLength(sound)+1)/2): value = getSampleValueAt(sample, i)‏

7 Michael Eckmann - Skidmore College - CS 102 - Spring 2009 Processing a range of samples Let's use this kind of processing to make the first half of the sound be louder and the second half be quieter. Any ideas? for i in range(1, (getLength(sound)+1)/2): value = getSampleValueAt(sample, i)‏

8 Michael Eckmann - Skidmore College - CS 102 - Spring 2009 Splicing sounds We can copy certain samples from different sounds and place them next to each other in a new sound. Let's look at page 172.


Download ppt "CS 102 Computers In Context (Multimedia)‏ 04 / 01 / 2009 Instructor: Michael Eckmann."

Similar presentations


Ads by Google