Lab 6
Note: you must follow the design recipe for any problem that asks you to develop a function, with the exception that functions that produce sounds may have comments indicating what they are to produce, rather than check-expects.
In order to make checking your lab easier, please put all of your work into one file. You can work with separate files if you like, as long as you combine them all when it comes time to show them to me.
Start with the code from class. Make sure it works. Play the notes. Then comment out the call to play-notes.
Find a piece of sheet music online. Perhaps Nyancat? Translate the first four measures into a list of (make-note ...)’s. If there’s no one on your team that can read music, ask for help!
Feel free to work all together as a team on this part; you do not have to do this individually.
use play-notes to listen. Does it sound right?
Develop the "half-time" function, that accepts a list of notes and produces another list where every note’s duration and time is doubled. This function should not play the notes.
Use play-notes to play the altered notes. Then comment this call out.
Develop the upside-downs function, that returns a new list of notes where every pitch p is replaced by 120-p.
Use play-notes to play the altered notes. Then comment this call out.
Develop the max-time function, that takes a list of notes and returns the largest time of any note in the list.
Develop the flip-times function, that takes a list of notes and a time ’f’ and returns a new list where every note’s time ’t’ is replaced by ’f-t’.
Use flip-times and max-time to play the notes backward.