Lab 5
Note: you must follow the design recipe in developing these functions.
HtDP 2e, exercise 130
Develop the data definition for list-of-sounds, that contains a list of sounds. Create at least two examples.
Develop the function third-sound-only, that accepts a list of sounds of length three or more and returns the third sound in the list. Don’t worry about what happens if the list contains two or fewer elements. Don’t use the built-in third or list-ref functions on this problem. Does this problem require the template for list functions?
HtDP 2e, exercise 136
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.
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.