Lab 7
Find a piece of music online, or from your collection. Ideally, it should be pretty loud and cacophonous. Using rs-read/clip or clip, define a sound that is exactly 250 samples.
Play the fragment. How long is the fragment?
Play 200 copies of the fragment, using the times function. What does it sound like?
Now, play 200 copies of a the first 240 samples of the earlier sample. How does it sound different?
Add (require rsound/draw) to your program
Draw the two 100x-repeated sounds, using rsound-draw. What is the predominant shape of these waveforms?
Develop the function nth-chunk ,that accepts an integer (racket n) and returns the nth "chunk" of the sound ,where the sound is divided into 1000-frame chunks.
Develop the function resplit, that accepts a number n and produces a list of length n; the first ten elements of the list should be the first chunk of the music, the second ten elements should be the second chunk of music, and so forth. Be sure to write test cases for this function.
Once it’s working, listen to the result, for n = 100.
Modify or build on your program, so that it alternates between at least two different chunk lengths. If you’re feeling ambitious, control the chunk length over time to play a short organ pedal line.