Lab 6
Note: you must follow the design recipe in developing these functions.
HtDP 2e, exercise 129
Develop the data definition for list-of-sounds, that contains a list of sounds. Create at least two examples.
Define my-sounds to be a list of four sounds. Write an expression that extracts the third sound from this list. Don’t use the built-in third or list-ref functions on this problem, just the basic cons/first/rest.
HtDP 2e, exercise 135
Develop the function soundslen, that accepts a list of sounds and returns the total length (sum, in frames) of all the sounds in the list.
HtDP 2e, exercise 140
Using the prior function, develop revplay, that accepts a list of rsounds and a pstream and plays the sounds in reverse order by using pstream-queue. It should return a pstream. Rather than a check-expect, simply write an example of calling it, and use a comment to indicate what should be played.
Develop the function tones-list, that accepts a list of midi note numbers and a volume in the range 0.0 to 1.0, and produces a list of sounds created with piano-tone where each tone’s pitch comes from an element of the list, and all tones have the same volume, given by the original volume argument. Use rs-append* to listen to the result in the interactions window.