Tuesday, March 12, 2013

Music with Arduino: An Illumination-Dependent Drum Set.


Our project is a sensor-controlled drum set. It basically involves light sensors and the playing of a sound when a sensor is blocked by an object. We came up with this idea because we wanted to think of a cool and modern way to mix two things we love: Physics and Music. One of our members thought of using drums because he thought it would sound awesome, and we agreed.
                Our drum set is controlled through light sensors. After setting up the basic Gizduino and breadboard setup, we connected our LDRs(light dependent resistors)  to the board through long wires and attached our  sensors to round corkboards(to have the same feel as a drum set).  We have 5 sensors to simulate the following parts of the drum: hi-hat, cymbal, bass, tom-tom, and snare.  We also have 5 light sources to illuminate these sensors.
                We then used the Arduino program to allow our Gizduino board to process the Analog input serials from the 5 pins, and we linked this to Processing. Our Processing displays the values of the serials of the LDRs, and these are the values we used to determine if a sound will play or not. The basic process is as follows: First, from the circuit of the LDR, the Gizduino board gets the amount of light received by the respective sensor. Then, the board sends this to the Arduino Software. Higher values are sent for brighter inputs while lower values are sent for darker inputs. These values are then written into the Serial, to be sent to and read by Processing. There are 5 values that are written into Serial(corresponding to the 5 drum parts). These are 5 integers, separated by commas. In Processing, these are split into an array of integers so that we may able to put actions to be done when a serial reaches a certain number. There are also 5 AudioPlayers(1 for each drum part) and each of these players will only play the audio based on its corresponding serial value. In draw(), the values are checked. If the values detected by the sensor are lower than the calibrated value, this means that the sensor is blocked, and the corresponding sound of the sensor will play. For example, sensor 1 has a calibrated value of 50. If sensor 1 is blocked, the calibrated value will be less than 50 and will therefore play the corresponding sound. If the sensor isn’t blocked, it will not change in value(and if it does, only by a little bit), and thus no sound will play.
Because of this setup, we can now use our project by blocking the various light sources with an object(and in our case, a drum stick). Once we block the light, the corresponding sound is played. See our video of our project in action:


The only limitation of our project is that we are expecting delays in between sounds coming from the same sensor. We have delays to prevent instant repetitions, creating a terrible sound, when our sensor is blocked for a long time. The good thing is that it is possible to play 2 sounds from 2 sensors at the same time, as long as the lights are blocked properly.

Team Awesome Right There : (L-R) Me, Jeau amd EJ.

No comments:

Post a Comment