I then moved on to the audio portion of the project. I wasn't sure how sound worked in Arduino, so I looked at the toneMelody example in the IDE. This example played a simple melody. In this example, it used an external file called pitches.h that contained all the musical notes. I only needed a couple (C-G) so I just looked for the values of these constants to use in my project.
Now that I learned how to implement these sounds in the code, I needed to figure out how to physically play the sound. I didn't have a speaker, so I went to the shop to look for one. The person at the help desk (Aaron) helped me greatly by hacking together this makeshift speaker from a broken pair of headphones. I treated the speaker like an LED light since I figured that digital output, sound or visual, should be the same. I then assigned each switch with it's own pin. And by using digitalRead, I would play a specific tone out of the speaker whenever a respective switch is pressed.
I found that the switches didn't really give me the feel of a piano keyboard. So I got some cardboard, cut some flaps to represent keys, and created a very crude keyboard. I then took off the switches for each pin, and taped the negative wire to the bottom of each flap. I then used a long piece of foil and connected a single wire that connected it to the positive current. By pressing down on the flap, the ends of the wire would touch the foil and complete the circuit for the pin.