Lab 7
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.
Develop the function note-num->octave, that accepts a MIDI note number and returns the octave that it belongs to. Look up midi note numbers online to see which ones correspond to which note.
Develop the function note-num->name, that accepts a MIDI note number and returns a name of the note. Here are the names: "c", "cshp", "d", "dshp", "e", "f", "fshp", "g", "gshp", "a", "ashp", and "b". Note we’re arbitrarily choosing the "sharp" names as the ones that this function will return.
Develop the name->note-num function, that accepts a note name and an octave number and returns the MIDI note number that it represents. For this function, along with the names given above, you must also accept the names "dflt", "eflt", "gflt", "aflt", and "bflt". These are synonyms for the corresponding sharp. That is, "dflt" should produce the same result as "cshp".
WHEN YOU GET TO THIS POINT, SHOW ME WHAT YOU’VE GOT.
Develop the name->rsound function, that accepts a note name and an octave number and returns an rsound representing a tone of length 1/2 second at the corresponding frequency.