Monday, 16 May 2011

New idea for Project 3

Because my three storyboard ideas were not "interesting enough" i have scrapped all three and worked over the weekend on a new idea. Although not a completely new idea as it is based on my third design. The third design was a poster with a map of Wellington city. On top of the map was zones, green was the inside zone which repersented walking distance from the center point (the center point being this campus). the next larger zone was orange, repersenting biking distance. Red was used everywhere else to repersent driving.

My new idea was to make the design instead of a poster but rather a board, that the user could touch with the provided pen/pin at the location of intest. Eg; there house, location in town or another campus. The idea is that if they choose somewhere within walking distance then the map and board will light up green. To far to walk but within biking distance then the board will light up orange, and anywhere else will light up red, which means drive by car/bus.

Storyboard for Project 3

With having IF/ELSE as my chosen function i came up with these three ideas then layed them out on to a storyboard. After the presentation on friday i will hopefully have 1 of these as my final and can start working on the design a bit more.
 My Cost for the first and the last of these designs would be very minimum. Only needing a camera, time and maybe a helper. For the middle of the three ideas the cost would be a race track which could vary in cost, depending weither i am able to obtain one second hand or of trade me for cheap.

For my time management, i would like to have a finalised idea after tuesday 17th. After i have a final idea i can start to find any nessisary materials and work out my costs better. Hoping to have a mock up model/film/poster by friday the 20th. testing and working with the chosen idea and results to better my design. having the final completed by the 27th with that weekend to write up my 300 discribing words and finalise anything needed.

Monday, 2 May 2011

Project three Ideas

I have choosen to go for the IF/ELSE statments. My first idea was to make a video of the traffic lights for people, for example if the lights are green then walk, else stop. But it will need to be a loop with if/else statments within it. An example would be. IF the lights are green walk and break the loop, ELSE IF the lights are blank stop then push button, ELSE stop reload loop.


The processing discription of  IF/ELSE:

IF;                                                                      ELSE;


Allows the program to make a decision about which code to execute. If the test evaluates to true, the statements enclosed within the block are executed and if the test evaluates to false the statements are not executed. Extends the if() structure allowing the program to choose between two or more block of code. It specifies a block of code to execute when the expression in if() is false.      



Sunday, 1 May 2011

The final result

I have been unable to get any sound going on my project, which is not good at all. I am unable to look at other designs and understand how to add the sound. I have added the code underneth as i cant export it to openprocessing as it wont compile.

//////////////////////////////////
//// Project Two, DSDN 142    ////
//// George Bristow 300239542 ////
//////////////////////////////////

import ddf.minim.*;
import ddf.minim.signals.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;

Minim minim;
//AudioSample move;
//SineWave sine;
//AudioOutput out;
List<Spring> springs = new ArrayList<Spring>();
Spring held = null;

void setup(){
  size(500,500);
  smooth();
 
  
  minim = new Minim(this);
  //move = minim.loadSample("Turkey Gobble.mp3");
 
//  // get a line out from Minim, default bufferSize is 1024, default sample rate is 44100, bit depth is 16
//  out = minim.getLineOut(Minim.STEREO);
//  // create a sine wave Oscillator, set to 440 Hz, at 0.5 amplitude, sample rate from line out
//  sine = new SineWave(440, 0.5, out.sampleRate());
//  // set the portamento speed on the oscillator to 200 milliseconds
//  sine.portamento(200);
//  // add the oscillator to the line out
//  out.addSignal(sine);

  for (int i = 1; i <= 3; ++i) {
    for (int j = 1; j <= 3; ++j) {
      springs.add(new Spring(width / 4 * i, height / 4 * j), "Turkey Gobble.mp3");
    }
  }
}



void draw(){
  background(255);
 

  //sound.trigger();


//   float freq = map(Spring.x, 0, height, 1500, 60);
//  sine.setFreq(freq);

  for (Spring spring : springs) {
    if (spring == held) {
      spring.moveTo(mouseX, mouseY).draw();
    } else {
      spring.move().draw();
    }
    if (spring.isMoving ()) {
    //move.trigger();
    move.play();
  
   
  }
//  else {
//   
//    move.rewind();
//  }
  }
 
}

 
void mousePressed(){
  // mouse pressed on a ball will let u drag it in any direction
  for (Spring spring : springs) {
    if (spring.mouseOver()) {
      held = spring;
      break;
    }
  }
}

void mouseReleased(){
  // will release the ball in the opersite direction that u have dragged it
  if (held != null) {
    held.release();
    held = null;
  }
}
////////////////////////////Tab two starts here///////////////////////////////
class Spring {

  private float
    x, y
  , vx, vy
  , ax, ay
  , size = 80
  , ls = 5;
 
  private final float springX, springY;

  private boolean
    released = false
  , left, above
  , vleft, vup;
 
  private AudioPlayer audio;

  public Spring(float x, float y, String audioName) {
    this.springX = x;
    this.springY = y;
    this.x = x;
    this.y = y;
    audio = minim.loadFile("audioName");
  }
 
  public Spring draw() {
    stroke(ls);
    strokeWeight(ls);
    line(springX,springY,x,y);
    fill(100,100,100);
    noStroke();
    ellipse(x, y, size, size);
    return this;
  }
 
  public Spring moveTo(int x, int y) {
    this.x = x;
    this.y = y;
    return this;
  }
 
  public Spring move() {
    vx += ax;
    vy += ay;
    x += vx;
    y += vy;

    if (vleft && vx >= 0 || !vleft && vx <= 0 ||
        vup && vy >= 0 || !vup && vy <= 0) {
      vflip();
      vleft = !vleft;
      vup = !vup;
    }
   
    if (left && x > springX || !left && x < springX ||
        above && y > springY || !above && y < springY) {
      flip();
      left = !left;
      above = !above;
    }
   
   
   
    return this;
  }
 
  /**
   * Calculates whether the mouse is over the spring or not.
   */
  public boolean mouseOver() {
    if (dist(x, y, mouseX, mouseY) > size / 2) {
      return false;
    }
    return true;
  }
 
  public void release() {
    vx = vy = 0;
    ax = (springX - x) / 60;
    ay = (springY - y) / 60;
    left = x < springX;
    above = y < springY;
    vleft = ax < 0;
    vup = ay < 0;
    released = true;
  }
 
  public void flip() {
    ax *= -1.2;
    ay *= -1.2;
   
    if (released && abs(ax) < 0.1 && abs(ay) < 0.1) {
      ax = ay = vx = vy = 0;
      x = springX;
      y = springY;
      released = false;
    }
  }
 
  public void vflip() {
    ax *= 0.75;
    ay *= 0.75;
  }
 
  boolean isMoving () {
    return (ax != 0 && ay != 0) ;
  }
 
}

Saturday, 30 April 2011

Got some sound working

I have been able to get some sound working but nothing like i wanted. I can get a droning sound in the background that makes a higher, lower sound depending on where the mouse is positioned on the screen. The problem i have is to now put this sound into the balls instead of the mouse.

Trying to get sound working

Getting stuck with the sound part to the project. Im not to sure weither it should be in the original tab or in the second tab with the spring class. Will try both and see which one works or is more effective.

What i want for sound

This is for me a very hard process, i was away for the sound lecture or studio. I want to have when the user pulls on one of the balls it will spring like sound untill the ball has come to its resting place again. Each different ball will have a seperate sound depending on where they are positioned. Resulting in being able to make multipul sounds at the same time.