Lab 8
In this lab, I’d like you to create one test case for each function *before* you develop the function itself. Use check-expect for this.
1 Setup
There are a number of setup steps required:
- Set the language level to a minimum of Intermediate Student. 
- Evaluate this program to load the latest version of the rsound package:(require (planet "main.rkt" ("clements" "rsound.plt" 1 3)))
- Quit and restart DrRacket. 
- Make sure it works, by playing the ding. 
- Open the documentation for rsound, by visiting the web page http://planet.racket-lang.org/package-source/clements/rsound.plt/1/3/planet-docs/rsound/index.html. 
- To get both the drawing and the playing functions, begin your program with this block:(require (planet "main.rkt" ("clements" "rsound.plt" 1 3))) (require (planet "draw.rkt" ("clements" "rsound.plt" 1 3))) 
2 Functions that generate samples
- Develop the function t, that accepts an integer n and returns the cosine of 2π*400*n/44100. Please include at least one test case. 
- Use the function fun->mono-rsound to generate a sound using this function. Read the documentation for fun->mono-rsound to see how. Play the sound. 
- Use the function rsound-draw to draw the sound that you generated. Zoom in by clicking on the waveform. 
- Develop a new function sum-t that is like t but instead produces the sum of three waves of different frequencies, scaled so that the values are no larger than 1.0. 
- Again, use fun->mono-rsound to generate a sound, rsound-play to play it, and rsound-draw to draw it. 
- Find a piece of music online. Using rsound-read/clip or rsound-clip, define a sound that is no more than 400 samples. 
- Play the fragment. How long is the fragment? 
- Play 100 copies of the fragment, using the times function. 
- Draw the fragment, using rsound-draw. 
- Based on the drawing, develop a function my-t that produces a new waveform that is similar to the one you downloaded. Can you make them look and sound the same?