1 Playing sounds

Lab 3: Arithmetic of sounds

As before, do all of your work in a single definitions window. When an exercise asks you to answer a question rather than develop a program (or in addition), use a comment to record your answer.

1 Playing sounds

Beside ding, there are a number of other drum sounds that are built into the sound library:

Try playing some of these, using play.
  • Do HtDP Section 2.1.2, Exercise 2.

  • Use define and rs-overlay to define claps to be the sound that has clap-1 and clap-2 on top of each other. Then, use rs-append and silence to play the claps noise twice, separated by one second of silence.

  • Do HtDP Section 2.1.3, Exercise 4.

  • Do HtDP Section 2.1.6, Exercise 10.

  • Use Quicktime Player (or another application) to record yourself saying the words "Chicken", "Monkey", and "Duck". Use the "Trim" function to trim each of these into a single audio sample, and then export them as WAV files.

  • Use rs-read and play to play your three sounds individually.

  • Building on Exercise 10, create an expression that says "Chicken" if the image is tall, "Monkey" if it is square, and "Duck" if it is wide.

  • Do HtDP Section 2.2.1, Exercise 16.

  • Define the function stutter, that extracts the first quarter of a sound and appends it to itself four times. You’ll need to use rs-clip, rs-frames, and rs-append to make this work.

  • Do HtDP Section 2.2.2, Exercise 24.

  • Do HtDP Section 2.3.2, Exercise 28. Note the differences between this exercise and exercise 16.

  • Do HtDP Section 2.3.6, Exercise 35.

  • Using big-bang, develop a program whose "state" is the time elapsed since the beginning of the program, which plays the kick noise every second, and the c-hi-hat-1 sound every time the user presses a key.