Assignment 9.2

posted Jul 16, 2010, 7:29 PM by Unknown user

This circuit uses four push buttons connected to pins 4-7 on the Arduino to control sound in Processing. For each button pressed, a different drum sound is played in Processing. For example: when the button connected to pin 4 is pressed, a cowbell sound is played. The sounds can also be played by pressing keys k, j, h, and g.

This one took me a while to figure out. It took me a couple tries to figure out where exactly to save the sound clips so that they could be read in the program, and then when i got that worked out the sound would repeat until another button was pressed, and then that sound would repeat. I solved that by resetting val every time the void draw function was run. I still have no idea where the values change from 1-4 to 49-52, but I got the program working and I didn't want to mess it up. A Fritzing picture of my circuit is attached.