User Tools

Site Tools


cs276:cs276.dhl.tutprog8

Part I:

Type in and experiment with any two of the five examples from the text (we'll have covered one or two in class). Delve into the Ess documentation for each of the classes and methods that are new to you. Write a short page describing how either of these sketches works, including drawings of the flow of data if appropriate. Your writeup should be good, solid technical writing which could be read and understood by someone else with some background in audio, but not Processing/Ess.

Example 4: Effects Processor

Example 5: Audio Analysis

Writeup:

    Extension 5: Sound, Example 4: Effects Processor shows off the reverb filter that the Ess library provides for the Processing programming language. It works by extracting audio samples taken from a sound file (e.g. "thisisatest.wav") on the computer's hard disk, and loading them into a container stored in temporary computer memory. This container of samples is referred to as an AudioChannel. The program (or "sketch" as it's called in Processing) recursively applies a series of audio filters to the AudioChannel so that, after being modified several times, the original sound is almost unrecognizable.

    The filters in particular are reverberation ("reverb" for short) and normalization. Reverb is responsible for the majority of changes heard in the modified recursions. It works by creating a feedback loop; in other words, reverb is created when a sound plays and is echoed back after a delay, followed by another echo after a shorter delay. The second filter used in this example is normalization, an audio technique that shrinks or grows the amplitude of a sound's samples until it reaches an arbitrarily standardized level across the board


Part II:

Write a sketch to map a sound to an image and back again. To do this, map each sample in any (short) sound file to a pixel. You'll need to try and figure out how many pixels you'll end up with, and create a PImage object with more than enough real estate to display the result. Here's the mapping: if the sample is greater than 0.03, the pixel is red. If the sample is less than -0.03, the pixel is blue; everything else is green. If in your resulting image one color seems too dominant, experiment with a different mapping. Just be sure to document your mapping, including a println statement showing the ranges you use. Try to figure out how long your sound file should be to fit inside a 640 by 480 image. When you have this conversion working, add functions that convert from the image back to a sound when the use clicks on the image. Use the inverse mapping: if the pixel is red, output a sample with value = 0.03, and so on (for green, you could try 0 - you may need to experiment). Play the resulting sound. Is it recognizable?

cs276/cs276.dhl.tutprog8.txt · Last modified: 2009/11/12 00:18 by wikiwikwik