Lab 6
Develop the function noisy, that takes an integer n and returns a random number between 0 and 20,000. Use the random function. To look up documentation on this, type ’random’, put the cursor on it, and hit the F1 key.
Change to the "intermediate" language level.
call (fun->mono-rsound 44100 44100 noisy) to turn this squarewave function into a sound. How does it sound?
Change the noisy function so that it returns a number between -10,000 and 10,000. How does it sound now?
Develop the function squarewave, that takes an integer n and returns 10,000 if the number is in the interval [0,100), zero if the number is in the interval [100,200), 10,000 if the number is in the interval [200,300), and so forth. You will need the ’modulo’ function for this; you can look it up using the F1 key again.
Use fun->mono-rsound to play this one. How does it sound? Does it sound different from the result of make-tone ?