MUSICTOUCH
  • Blog
  • About
  • Contact

The Gods Have Smiled Upon Me 

12/6/2013

0 Comments

 
I am happy to announce that musicTouch is working. 

I have recorded my recordings and it works! 

The recordings are still very quiet and I will continue to try and make them louder, but I really think it is just because of the size and power of the speaker. 

Here is a video of it working. 

Words can't express how happy I am.  This long journey is now over.  While I am happy it is over, I can't help but feel there is a part of me missing.  

Thank you for my professor, Audrey, and all of her help.  I wouldn't have been able to make it this far without her. 
Thank you to my parents for all of their support.  Thank you to my friends and extended family - you didn't know I was doing this...but you still helped me.  And thank you to my fans - I love ALL of you. 
0 Comments

AHHHH

12/3/2013

0 Comments

 
I am SO close to finishing!  I worked for 3 hours today during class to finish musicTouch and it's almost there! 

I have the whole board working with test recordings - I just need to implement the actual recordings. 

One problem I ran into along the way was with the analog pins. I am using two analog pins (14 and 15) and when I had the Arduino hooked into the computer they worked fine.  However, when I plugged in the battery - they would no longer work.  I fooled around with it for a while but then I tried decreasing my analog touch cut off sensor and it worked perfectly.  So I think there is something with the amount of voltage that the battery gives off decreases the sensitivity of the analog pins.  but once I changed the touch cut off to 30 it worked perfectly!! 

Also - the recordings are really quiet but when I do my own recordings I'll just record them very loudly.  I think this is because the speaker is very small. 

Here are some pictures of the set up and it working with test recordings :  
Picture
Here is the front of  the finished board.  As you can see the rhythm for Twinkle is now complete - there are 8th notes and quarter notes. 

The notes staffs are outlined in sharpie and the note heads are in Bare Paint Conductive paint.  However, it's slightly frustrating because it smudges even when dry and so now there are little paint smudges all over the board...but oh well.  It's just a prototype.  :) 

Picture
This is the back of my board.  It is a little messy because of the amount of electrical tape everywhere....and I would try to change that but I am not quite sure what else I would use since when trying to solder to conductive thread it lights on fire.........

The Arduino, bread board, speaker and battery are all attached using Velcro which I attached to the canvas with Krazy Glue that advised me to keep away from my fingers because it "binds skin instantly" 

yikes. 

Fear not my friends.  I still have all of the skin on my fingers. 

Picture
This is a closer up view of the back of my board.  I cut and stripped wires to connect from the bread board to the electrical thread which I sewed into each note head.  Then covered it all in tape so it wouldn't touch anywhere and blow things up....

0 Comments

Gettin' There! (say with southern accent.)

12/2/2013

0 Comments

 
I worked for another 2 or 3 hours today on my project and......drum roll please...

I GOT ANALOG TO WORK! THIS MEANS I CAN NOW TEACH ALL OF THE LITTLE CHILDREN OF THE WORLD HOW TO READ TWINKLE! IT'S A CHRISTMAS MIRACLE. 

any who.  Enough excitement. 

Using the code that my professor sent to me figuring out how to make analog work I have successfully made analog and digital pins work, in harmony! It's peace in my little Arduino world. 
I combined both of the code and ended up making new variables for the Analog pins because they read different touch sensors.  It turns out they actually read a much higher reading meaning that the touchCutoff would have to be higher - I ended up setting it to around 60.  I then created another for loop doing the same process however this time checking to see if it was of analog type not digital - and then if it was analog proceeding to compare it to the analog variables. 
AND IT WORKS! 

I then stayed later to continue working on the physical product.  
See the pictures below: 


Picture
This is my finished Arduino.  As you can see : I also soldered a speaker to the sound shield so I wouldn't have to keep using the external giant speaker. 
For this - I attached two wires that I cut and striped and soldered them to the wires on the speaker itself.  Then I connected them to the two holes by the headphone jack on the sound shield.  I don't think it matters which wire you put in the hole - however...if you're smart you will solder the inside wire first.  I was not so smart and did the outside one then when attempting to solder the inside one got frustrated...then unsoldered the outside one (burnt myself a little.) then re-did the two of them. 

Picture
Look it's coming along! 

I couldn't write any notes on the board until I knew whether or not I would be able to have 6 different recordings (aka if the analog pins would work or not) 
But I have working analog pins meaning I could begin to draw my note heads on the staff! 

Picture
In this picture I took a sharpie and I traced over the lines of the staff (this was very stressful.) 
Then I filled the note heads with conductive paint (Bare Paint).  I think I am going to make them 8th notes meaning I will connect the stems over every two notes that way the note values are correct (I couldn't make the E and the A a half note because there would be no conductive paint inside thus destroying the purpose of this product.) So, I will make the notes that are doubled into 8th notes and the two single notes (the E and the final A) will be quarter notes - keeping the original melody of twinkle. 

I began to sew conductive thread through the first A furthest to the left - it works and it hardly visible! I will need to sew conductive thread into each of the note heads and then trace the stems of the notes as well.  

Then for final pretty details I will add decorative things onto the board to make it look more appealing. The Arduino and the Speaker will be Velcro-ed into the back of the board. 

0 Comments

Design Day Duty 

11/30/2013

0 Comments

 
I have spent all morning working on the design aspect to my project.  I have been so engulfed in the programming aspect of it that I haven't had much time to sit down and work on the visual aspect to it.  

Below you will see some of the things I have done today. 
0 Comments

ANALOG WORKS! 

11/27/2013

0 Comments

 
My professor got the analog pins to work! I was having trouble because I wanted 6 pins to be able to use "Twinkle Twinkle" as the song to teach - however....the sound shield uses up 5 or 6 pins and then the SD card uses up another 3 and I was left with only 4.  I was struggling trying to do testing and to get the Analog pins to work but they just weren't working.  

However, my professor just emailed me saying that she's gotten them to work! 

It turns out that they are labeled Analog 14-19 and not 0 - 5.  So A0 is actually A14! 

Here is the code that my professor created to test them : 


// Pin for the LED
int LEDPin = 13;
// Pin to connect to your drawing
int capSensePin = 14;
// This is how high the sensor needs to read in order
//  to trigger a touch.  You'll find this number
//  by trial and error, or you could take readings at 
//  the start of the program to dynamically calculate this.
int touchedCutoff = 128;

void setup(){
  Serial.begin(9600);
  // Set up the LED
  pinMode(LEDPin, OUTPUT);
  digitalWrite(LEDPin, LOW);
}

void loop(){
  // If the capacitive sensor reads above a certain threshold,
  //  turn on the LED
  if (readCapacitivePin(capSensePin) > touchedCutoff) {
    digitalWrite(LEDPin, HIGH);
  }
  else {
    digitalWrite(LEDPin, LOW);
  }
  
  // Every 500 ms, print the value of the capacitive sensor
//  if ( (millis() % 500) == 0){
    Serial.print("Capacitive Sensor on Pin 2 reads: ");
    Serial.println(readCapacitivePin(capSensePin));
//  }
}

// readCapacitivePin
//  Input: Arduino pin number
//  Output: A number, from 0 to 17 expressing
//          how much capacitance is on the pin
//  When you touch the pin, or whatever you have
//  attached to it, the number will get higher
//  In order for this to work now,
// The pin should have a 1+Megaohm resistor pulling
//  it up to +5v.
uint8_t readCapacitivePin(int pinToMeasure){
  // This is how you declare a variable which
  //  will hold the PORT, PIN, and DDR registers
  //  on an AVR
  volatile uint8_t* port;
  volatile uint8_t* ddr;
  volatile uint8_t* pin;
  // Here we translate the input pin number from
  //  Arduino pin number to the AVR PORT, PIN, DDR,
  //  and which bit of those registers we care about.
  byte bitmask;
  if ((pinToMeasure >= 0) && (pinToMeasure <= 7)){
    port = &PORTD;
    ddr = &DDRD;
    bitmask = 1 << pinToMeasure;
    pin = &PIND;
  }
  if ((pinToMeasure > 7) && (pinToMeasure <= 13)){
    port = &PORTB;
    ddr = &DDRB;
    bitmask = 1 << (pinToMeasure - 8);
    pin = &PINB;
  }
  if ((pinToMeasure > 13) && (pinToMeasure <= 19)){
    port = &PORTC;
    ddr = &DDRC;
    bitmask = 1 << (pinToMeasure - 14);
    pin = &PINC;
  }
  // Discharge the pin first by setting it low and output
  *port &= ~(bitmask);
  *ddr  |= bitmask;
  delay(1);
  // Make the pin an input WITHOUT the internal pull-up on
  *ddr &= ~(bitmask);
  // Now see how long the pin to get pulled up
  int cycles = 16000;
  for(int i = 0; i < cycles; i++){
    if (*pin & bitmask){
      cycles = i;
      break;
    }
  }
  // Discharge the pin again by setting it low and output
  //  It's important to leave the pins low if you want to 
  //  be able to touch more than 1 sensor at a time - if
  //  the sensor is left pulled high, when you touch
  //  two sensors, your body will transfer the charge between
  //  sensors.
  *port &= ~(bitmask);
  *ddr  |= bitmask;
  
  return cycles;
}
0 Comments

Almost there! (kinda...)

11/26/2013

0 Comments

 
I spent the day before break in the lab for 3 hours working on this project.  I have found some bugs and fixed some dredded errors! 

The error that my Arduino was returning complaining that it can't open the WAV file has been solved! It turns out that inside my program when we were trying to get the analog pins to work extra code was copied in that wasn't supposed to be there.  
You see, the SD card uses digital pins 11,12 and 13.  In my code I had declared pin 11 and 12 to be of input type when I was just testing on the Arduino - not using the sound shield.  I forgot to delete the code when I went back to using the sound shield and because those pins were set to be input type - the SD card couldn't function properly.  

The sound is now working correctly! Hooray! 
Picture
Here are some pictures of the set up I used to do some final testing. 

These are the hook ups to the breadboard coming from the Arduino and leaving to the piece of paper. 

Picture
This is a shot of the Arduino with the WAV sound shield attached connected to the breadboard with wires that I've soldered.   

Picture
This is an up-close shot of the piece of paper I have set up.  As you can see - there are two different touch sensors and depending on which one is touched a different sound responds.  

0 Comments

Ugh. 

11/24/2013

0 Comments

 

It is now Sunday and I am no where near finishing my project.  I am not sure what else to do.  I have just emailed my professor asking for another meeting.  Hopefully tomorrow in class will help sort out all of these bugs.  


That is all I have to say.

0 Comments

Meetings Meetings Meetings Result In No Winnings 

11/21/2013

0 Comments

 

I had a meeting with Audrey today and things are still not working.  


However...


We did a lot of testing and came closer to the solution! 
We found out that pin 11 just isn't working (probably something wrong with the sound shield) and pin 13 is special because there is already a resistor built into the pin so it reads different values and thus won't be able to run on the same code as every other pin.  


I soldered to pin 9 which I couldn't do before because it was blocked.  However, we found that I could still use it if I connected it to a pin in a different spot.  So I connected it to a different spot and it works.  


I now have 5 working touch sensors. 


However. 


When I try to test it, it keeps saying that the WAV file can't be opened.  I do not know why this is happening.  I am very, very confused.  I didn't do anything to the WAV files and they should be able to be opened and work.  Audrey also does not know why this is happening. 


I plan on working on my project over the weekend and further developing the actual visual aspect to it - and hope that Orchestra gets back in time on Sunday for TA hours.  

0 Comments

Wednesday's Lab Session Did Not Help...

11/20/2013

0 Comments

 

I am currently very frustrated.  musicTouch was working for a while and then everything stopped working and it went right back to repeating the WAV file over and over again. 


I spent a lot of time trying to figure out the code and waiting for help with figuring out the code - and in the end the code was still not figured out why. 


I began to draw on the canvas and get things starting to look nice.  


I am also going to schedule a meeting with my professor, Audrey, to hopefully get closer to figuring things out. 

0 Comments

one one one one one one one x1000

11/18/2013

0 Comments

 

I am in trouble. 


I have combined my code - and nothing is working.  I have worked one day with my professor Audrey and still it isn't' working.  I am very upset - and have decided to put my project down until Wednesday. 


When the code was combined the response was the keep repeating the same WAV file over and over again.  Thus resulting in mild insanity within the lab in both the other students and professors. 


At first we thought it was the connection of the jumper wires to the breadboard causing a bad connection somewhere along the line.  So I took bits of wire and I cut them and stripped them and soldered them to the Arduino.  I twirled the edges so they could easily go into the breadboard and then when tested again - the same problem resulted. 


After a couple minutes of staring at the code - the class ended.  I stayed late to try and fix it for a little bit and I still couldn't come across the reason.  I am getting worried because I am not sure if I will be able to make TA hours this weekend due to other obligations (cough cough Orchestra cough cough) taking up my whole weekend - and this project is due very soon.  


Hopefully Wednesdays lab session will help clear things up.

0 Comments
<<Previous

    Author

    Write something about yourself. No need to be fancy, just an overview.

    Archives

    December 2013
    November 2013

    Categories

    All

    RSS Feed

Powered by Create your own unique website with customizable templates.