Lab 4
1 Project 2 warmup
6.3.0.7

Lab 4

In this lab, use make-pstream and pstream-queue and pstream-current-frame to trigger your sounds, so they don’t wind up on top of each other. To find out more about these three functions, use help desk.

No design recipe steps are required unless the item says "develop", as in "develop a program" or "develop a function".

Also, the rsound library provides several functions like sine-wave and sawtooth-wave that ... are probably not helpful to you. Using these functions will lead you into the world of signals, and we haven’t covered that in lecture at all, at this point. I would advise you instead just to use the same setup in the lab that we did in Monday’s lecture (the code for this lecture appears online, on Piazza).

The following five steps are awesome, but optional. Please note that the final big-bang program at the bottom is *not* optional, so you should probably do that one first.

1 Project 2 warmup

As a warmup for project 2, develop a program that shows a set of four empty circles. Hitting the "1" key toggles the first circle from empty to blue and back again. Hitting the "2" key toggles the second circle from empty to red and back again. Continue with the third and fourth circles mapping to the "3" and "4", keys, with the colors purple and green. Hitting any keys in any order should toggle the appropriate circles. So, for instance, if I start the program and hit keys 4, 2, and 4, then the second circle should be red, and the others should all be empty.

Think carefully about the world state for this program, and how you’re going to represent it.