Piano Gloves Final Page
by Danielle Norman and Chelsea Hancock
Basically, our final project is essentially piano gloves. They are gloves with pennies and dimes attached to the tips of the fingers that way you can play a song with our version of an air piano. Our version, however, includes flats and two different octave changes.
Our program works with four different push buttons on each tip of the finger for each note on the musical scale from C on the base octave to C on the higher octave. Also, to finish the push button, we attached a penny to the tips of each thumb, so to play a note like B, you would hold together the right middle finger's penny to the right or the left thumb's penny. Once that is accomplished then the Arduino will recognize inputPin6 as being HIGH, or "pushed" and then the speaker connected to positive and pin 2 will essentially play a B note. As for the flats, it is generally the same thing that you would do for the normal notes except you would use the dimes instead of the pennies on the fingers. At the bottom of the pennies, the dimes are located on each of it's twin note, so at the bottom of the D note, there is a dime that is called D flat. However, there are only six dimes because there are only six notes that actually have a flat. Finally, as for the octave changes, there are two other sets of push buttons in that curve of the glove between the thumb and the index finger. When one "pushes" the right hand's octave change push button and holds down the push button, then the notes that you play simultaneously will be on a lower octave than the base octave. When one "pushes" the left hand's octave change push button and holds down the push button, then the notes that you play simultaneously will be on a higher octave than the base octave.
Here are a couple photos:
One of us with our gloves in its earlier version:
One of us soldering pennies and dimes to the glove:
Finally, here is a picture of our final project:
Our Circuit diagram:
Essentially, the pins 2-16 are the notes that are played, whereas the speaker is connected to pin 1 and ground.
Here's a video explaining how to use the piano gloves.
http://www.youtube.com/watch?v=f8yYn7FTH-U
Our Arduino coding:
/* Piano Gloves by Danielle Norman and Chelsea Hancock */int inputPin1 = 1; // sets the Input Pins for the push buttons// input pin for speakerint inputPin2 = 2; // Left hand input pinsint inputPin3 = 3; int inputPin4 = 4; int inputPin5 = 5; int inputPin6 = 6; // left hand octave change (lower)int inputPin7 = 7; // Left hand flats input pinsint inputPin8 = 8; int inputPin9 = 9; //Right hand input pinsint inputPin10 = 10; int inputPin11 = 11; int inputPin12 = 12; int inputPin13 = 13; // Right hand flats input pinsint inputPin14 = 14; int inputPin15 = 15; int inputPin16 = 16; //right hand octave change (higher)int x = 0; //octave change integersint y = 0; int b = 0; #include <Tone.h> // starts the tone library Tone noiseMaker; void setup() { // start the music: noiseMaker.begin(1); pinMode (inputPin1, OUTPUT); // sets all the input pins as INPUT or OUTPUT for the speaker pinMode (inputPin2, INPUT); pinMode (inputPin3, INPUT); pinMode (inputPin4, INPUT); pinMode (inputPin5, INPUT); pinMode (inputPin6, INPUT); pinMode (inputPin7, INPUT); pinMode (inputPin8, INPUT); pinMode (inputPin9, INPUT); pinMode (inputPin10, INPUT); pinMode (inputPin11, INPUT); pinMode (inputPin12, INPUT); pinMode (inputPin13, INPUT); pinMode (inputPin14, INPUT); pinMode (inputPin15, INPUT); pinMode (inputPin16, INPUT); } void loop() { x = digitalRead(inputPin6); //octave change y = digitalRead(inputPin16); b = -x + y + 2; while (digitalRead(inputPin2) == HIGH) // plays note C { noiseMaker.play(65.41 * b); } while (digitalRead(inputPin3) == HIGH) // plays note D { noiseMaker.play(73.42 * b); } while (digitalRead(inputPin4) == HIGH) // plays note E { noiseMaker.play(82.41 * b); } while (digitalRead(inputPin5) == HIGH) //plays note F { noiseMaker.play(87.31 * b); } while (digitalRead(inputPin7)==HIGH) //plays D flat { noiseMaker.play(69.30 * b); } while (digitalRead (inputPin8)==HIGH) //plays E flat { noiseMaker.play(77.78 * b); } while (digitalRead(inputPin9) == HIGH) //plays note G { noiseMaker.play(98.00 * b); } while (digitalRead(inputPin10) == HIGH) // plays note A { noiseMaker.play(110.00 * b); } while (digitalRead(inputPin11) == HIGH) //plays note B { noiseMaker.play(123.47 * b); } while (digitalRead(inputPin12) == HIGH) // plays note C { noiseMaker.play(130.81 * b); } while (digitalRead (inputPin13)==HIGH) //plays G flat { noiseMaker.play(92.50 * b); } while (digitalRead (inputPin14)==HIGH) //plays A flat { noiseMaker.play(103.83 * b); } while (digitalRead(inputPin15)==HIGH) //plays B flat { noiseMaker.play(116.54 * b); } noiseMaker.stop(); }
Like all projects, we encountered quite a few problems. The more recent problem that we encountered was the problem with the sharps and octave changes. Before, we added these, we just had the normal notes. This didn't work because most songs that we enjoy playing are played with sharps and octave changes. So, we decided to add them, but we didn't know how to to do so. When we were trying to figure out how to add sharps, we realized that our ingenious plan had a flaw: 20 BUTTONS?!?!?!?! There are only 19 pins on an arduino board IF you were to make the analog pins digital. But then we came up with an idea. If we make FLATS instead of SHARPS, then we achieve our 19 pin goal. Flats compared to sharps are lower and there are less of them, so it worked out! Another problem that we came across was the fact that we couldn't figure out how to make octave changes...we tried to make the thumbs the octave changes and use aluminum or some kind of metal to play on as our positive power, but then we lost the whole point to portable piano gloves. So, we then decided to place two more push buttons on the curve of the glove between the thumb and the index finger. There were also problems that we came across where the wires were too flexible and wouldn't stay in the bread board, but that was easily fixed by soldering the ends and of course when we soldered the whole bread board, the wires stayed in place! Also, not too long ago, we decided to take out ALL OF OUR WIRING and put them back in. When we finished this, we found out that our flats were not working...We then set up the coding so that the input pin will go simultaneously that way the arduino will read it correctly. Those were basically the problems we encountered!
If we had more time, we would have used the coding that would allow us to play more than one note at once. Unfortunately, we ran out of time and we thought the flats and octave changes were more important.