12/17/09

posted Dec 17, 2009, 8:28 AM by Unknown user
Woops! We haven't made any posts lately.


Okay so here's what you missed..

We finished soldering the wires to the pennies and hot glued them to the tips of the fingers so when you pressed the thumb and a finger to each other, it played a note.

Then we tried switching it up so that when you connect a piece of aluminum foil to positive power, you can press the fingers to the foil to play a note. Those notes would be in the second octave. But to change things up a little bit, we made it so when you put ONE thumb down, it goes the the third octave. Then when you put BOTH thumbs down, it goes to the fourth octave. very exciting.

Here's the coding for this version:

   /*
  Piano Gloves
  by Danielle Norman(coding) and Chelsea Hancock(wiring)
    */
   
  int inputPin4 = 4;               // sets the Input Pins for the push buttons 
  int inputPin5 = 5;               // for the first hand
  int inputPin6 = 6;
  int inputPin7 = 7;
  
  int b = 0;
  int x = 0;
  int y = 0;
  
  int inputPin8 = 8;                // second hand input pins
  int inputPin9 = 9;
  int inputPin10 = 10;
  int inputPin11 = 11;
  
  int inputPin12 = 12;
  int inputPin13 = 13;             // Thumbs
  
  #include <Tone.h>                // starts the tone library
  Tone noiseMaker;
   
   
   
   
   void setup() {
                                       // start the music:
     noiseMaker.begin(2);
    

    
     pinMode (inputPin4, INPUT);      // sets all the input pins as INPUT
     pinMode (inputPin5, INPUT);
     pinMode (inputPin6, INPUT);
     pinMode (inputPin7, INPUT);
     pinMode (inputPin8, INPUT);
     pinMode (inputPin9, INPUT); 
     pinMode (inputPin10, INPUT);
     pinMode (inputPin11, INPUT);
          
   }
  
     

  
  
  
  void loop() {
   
    
    
    x = digitalRead(inputPin12);
    y = digitalRead(inputPin13);
    b = x + y + 1;
       
    
   
    
    
    
  
   while (digitalRead(inputPin4) == HIGH)
     {
       noiseMaker.play(65.41 * b);
     }
     
     while (digitalRead(inputPin5) == HIGH)
       {
       noiseMaker.play(73.42 * b);
       }
       
       while (digitalRead(inputPin6) == HIGH)
         {
         noiseMaker.play(82.41 * b);
         }
         
         while (digitalRead(inputPin7) == HIGH)
           {
           noiseMaker.play(87.31 * b);
           } 
           
           while (digitalRead(inputPin8) == HIGH)
             {
             noiseMaker.play(98.00 * b);
             }
             
             while (digitalRead(inputPin9) == HIGH)
               {
               noiseMaker.play(110.00 * b);
               }
               
               while (digitalRead(inputPin10) == HIGH)
                 {
                 noiseMaker.play(123.47 * b);
                 }
                 
                 while (digitalRead(inputPin11) == HIGH)
                   {
                   noiseMaker.play(130.81 * b);
                   }
                
               noiseMaker.stop();
          
         
  }
   

However, the whole point of the piano gloves in the first place was to have a PORTABLE Piano that you could play in your hands. We don't want to have to make you carry around a piece of aluminum foil around with you all the time. So now it's back to square one. We're thinking a push button attached to each glove. When they're both NOT triggered, its the third (middle) octave. When the left is triggered, it plays the lower octave. The right, the higher octave. We might also make it so when BOTh are pushed, it plays sharps. But that would be kind of awkward to push both every single time you want to play a sharp (Fur Elise would SUCK.) So we need to rethink it.

Here's the basic thumb-to-finger code:

   /*
  Piano Gloves
  by Danielle Norman(coding) and Chelsea Hancock(wiring)
    */
   
  int inputPin4 = 4;               // sets the Input Pins for the push buttons 
  int inputPin5 = 5;               // for the first hand
  int inputPin6 = 6;
  int inputPin7 = 7;
  
  int inputPin8 = 8;                // second hand input pins
  int inputPin9 = 9;
  int inputPin10 = 10;
  int inputPin11 = 11;
  
  int inputPin12 = 12;
  int inputPin13 = 13;             // Thumbs
  
  #include <Tone.h>                // starts the tone library
  Tone noiseMaker;
   
   
   
   
   void setup() {
                                       // start the music:
     noiseMaker.begin(2);
    

    
     pinMode (inputPin4, INPUT);      // sets all the input pins as INPUT
     pinMode (inputPin5, INPUT);
     pinMode (inputPin6, INPUT);
     pinMode (inputPin7, INPUT);
     pinMode (inputPin8, INPUT);
     pinMode (inputPin9, INPUT); 
     pinMode (inputPin10, INPUT);
     pinMode (inputPin11, INPUT);
          
   }
  
     

  
  
  
  void loop() {
  
   while (digitalRead(inputPin4) == HIGH)
     {
       noiseMaker.play(65.41);
     }
     
     while (digitalRead(inputPin5) == HIGH)
       {
       noiseMaker.play(73.42);
       }
       
       while (digitalRead(inputPin6) == HIGH)
         {
         noiseMaker.play(82.41);
         }
         
         while (digitalRead(inputPin7) == HIGH)
           {
           noiseMaker.play(87.31);
           } 
           
           while (digitalRead(inputPin8) == HIGH)
             {
             noiseMaker.play(98.00);
             }
             
             while (digitalRead(inputPin9) == HIGH)
               {
               noiseMaker.play(110.00);
               }
               
               while (digitalRead(inputPin10) == HIGH)
                 {
                 noiseMaker.play(123.47);
                 }
                 
                 while (digitalRead(inputPin11) == HIGH)
                   {
                   noiseMaker.play(130.81);
                   }
                
               noiseMaker.stop();
          
         
  }
   

Comments