Students/Ian Holaday

From Robert-Depot
Revision as of 19:46, 19 March 2010 by Graive (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

First Assignment Redirected Link link title

Please see the link for the first assignment. I created an account with WIKI and not the class.



Midterm Proposal:


I thought it would be interesting to explore the way humans interact with eye movements and blinking, so I propose building moving eyeball that blinks based on user input through switches and buttons. A switch will turn the eye on, opening the lids and cause the eye to move around with a motor. The eye will be off center so it will look as if it’s looking around the room in a circle. An always open button will be attached to another motor or shutter that will close the eye lids shut. It will be interesting to see how people play with the two switches to get different effects, like blinking and possibly create actual expressions.

Proposal.jpg

Midterm Final

Instead of making the above, I had to simplify. I took 2 motors from different devices and set them up in a box. I then connected 2 push buttons to both and painted disks with different combinations of color. The idea was to create a machine that mixed color with speed rather than mixing the paint. The project worked and the colors blended together to make different variations of blue and green. Unfortunately the glue holding them on the motors wore out in class, and they decided to fly off.


The project was damaged in transit on the way home. Instead of taking a picture I've drawn a graphic representation:

Midterm.jpg



Final Proposal:

I wanted to explore the fundamental link between image and sound. How one can influence the other. Most of the time we notice sound influence image, more often by simply mood, shape and form. I wanted sound to be influenced there in by image.

Possibility 1:

LED's control sound notes via photo-resistors. Resistance of light would cause a different note to play. Planned on making a piece that allowed users to control the LED's light function to help change the notes.

Possibility 2:

Similar to above, instead of just reading light, I decided I wanted to make a piece that took in RGB data and projected it as sound. This way more interesting imagery could be created by the user. I decided to investigate using a webcam to read in data and transform it into notes.

Possibility 3:

After realizing that I couldn't get the code to work with a webcam, I decided to go back to the first possibility with a little more investment. I decided to construct a wall mounted LED display that played a beat based on the light within the room, and flashed different LEDs based on a random number generator. The LED's would in turn change resistances to photo-resistors which would cause a note to be played via the 2nd speaker. This project was not completed due to the complexity of the design and the lesser knowledge of it's programmer.

Project in Progress

IMG 2868.JPG

IMG 2863.JPG

IMG 2872.JPG


Failed Attempt 1 Code:

int potPin = 2; // select the input pin for the potentiometer char val = ' '; // variable to store the value of potPin as a note

int speakerPin = 9; int length = 15; // the number of notes char notes[] = "val"; // a space represents a rest int beats[] = { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4 }; int tempo = 300;

void loop() {

  if (analogRead(potPin) = 0-150) {
    (int val = "c";) 
  }
  if (analogRead(potPin) = 241-335) {
    (int val = "d";)
  }
  if (analogRead(potPin) = 336-454) {
    (int val = "e";)
  }
  if (analogRead(potPin) = 455-560) {
    (int val = "f";)
  }
  if (analogRead(potPin) = 561-699) {
    (int val = "g";)
  }
  if (analogRead(potPin) = 700-899) {
    (int val = "a";)
  }
  if (analogRead(potPin) = 900-1023) {
    (int val = "b";)
  } 
  if (analogRead(potPin) = 151-240) {
    (int val = "C";)
  }
  

void playTone(int tone, int duration) {

 for (long i = 0; i < duration * 1000L; i += tone * 2) {
   digitalWrite(speakerPin, HIGH);
   delayMicroseconds(tone);
   digitalWrite(speakerPin, LOW);
   delayMicroseconds(tone);
 }

}

void playNote(char note, int duration) {

 char names[] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };
 int tones[] = { 1915, 1700, 1519, 1432, 1275, 1136, 1014, 956 };
 
 // play the tone corresponding to the note name
 for (int i = 0; i < 8; i++) {
   if (names[i] == note) {
     playTone(tones[i], duration);
   }
 }

}

void setup() {

 pinMode(speakerPin, OUTPUT);

}

void loop() {

 for (int i = 0; i < length; i++) {
   if (notes[i] == ' ') {
     delay(beats[i] * tempo); // rest
   } else {
     playNote(notes[i], beats[i] * tempo);
   }
   
   // pause between notes
   delay(tempo / 2); 
 }

}


void loop() {

 val = analogRead(potPin);    // read the value from the sensor
 digitalWrite(ledPin, HIGH);  // turn the ledPin on
 delay(val);                  // stop the program for some time
 digitalWrite(ledPin, LOW);   // turn the ledPin off
 delay(val);                  // stop the program for some time

}