Kitchen Sensor Walk

I was curious about the sensors in my kitchen. There is a variety of appliances that all use temperature sensors — our electric water kettle, the refrigerator, and the electric stovetop that tells you when the surface is hot.

The rice cooker, the most central appliance, has a thermal sensor regulates the temperature and keeps it under 212 degrees to prevent the rice from burning. As soon as all of the water has evaporated or is absorbed by the rice, the temperature inside the container immediately rises over 212 — so the rice cooker shuts off.

 

GenoTypewriter

GenoTypewriter came out of the assignment entitled, “Antiques From The Future” for Video Sculpture. It is an object from a fictional future that we created, where biotechnology gets out of hand and the ability to mix and match genomes is available to anyone. The Genotypewriter is a kiosk, much like an ATM would be today. The user selects two objects, however random (a tree? python? polar bear? teacher?) and mixes them with each other to create a novel new item. When they finish, a voucher will be printed out for them which includes the name of their purchase (“Congratulations! It’s a antewick! Combination antelope and toothpick!”) as well as its qualities, what it likes to do for fun, and of course how much everything will cost you (a dinosaur is significantly more expensive than a condom, for instance).

One inspiration came from the fact that Will & I, along with our Future of the Infrastructure class, had been discussing what would happen if biotechnology went to far. To a greater degree, I was inspired by an Ursula K. Le Guin short story called “Porridge On Islac”. In the story, a traveller finds himself on a curious plane with curious inhabitants.  Islac is a plane where geneticists played around with mixing genomes without reserve or regulation, resulting in queer combinations of things that should have never been combined — for instance, the lead character finds himself befriending a girl that is half-human, half corn.

 

 

We wrote an article to solidify our fiction. It is a complete timeline that illustrates how things went wrong (in the future) and how our little Genotypewriter kiosk could have come to be. The full article can be found at Genotypewriter.com, Will’s creation.

 

This is the GenoTypewriter.

 

A closer look. The printer lives inside so that the paper slides out of the slot.

The antique itself was a children’s toy typewriter that we found at a flea market.

Will wired up the gear with a motor, so that the motor turned whenever the gears turned. The motor generates a small amount of electricity every time it is turned, so that we can use the dial with an Arduino.

Underneath the toy’s lever is a simple button switch.

We used this thermal printer from Sparkfun to generate vouchers that you can take home with you!

 

ITEMS LIST + GOOGLE DOCS

We wanted to have some fun with the items list, so we made it a Google Doc that we could collaboratively and easily edit. With the help of Jer Thorp’s tutorial (and classes!) I got Genotypewriter to read the Google Doc whenever we started up.

So every Item would have its own name (narwhal), description (magical), prefix and suffix for combining them later, a price ($45) and something it likes to do. Combining them later was easy.

Jer wrote a function called “getNumbers()” that makes it simple to load data from google docs to your own string:

  String[] names = getNumbers("name");
  String[] prefixes = getNumbers("prefix");
  String[] suffixes = getNumbers ("suffix");
  String[] descriptions = getNumbers ("description");
  String[] price = getNumbers ("price");
  String[]actions = getNumbers ("actions");

and then afterwards pass them on to the items object:

  for (int i = 0; i < items.length; i++) {
 
    //load the pictures
    tops[i] = loadImage ("top_" + i + ".jpg");
    bottoms[i] = loadImage ("bot_" + i + ".jpg");
 
    //put them in the object
    items[i] = new Item();
    items[i].name = names[i];
    items[i].prefix = prefixes[i];
    items[i].suffix = suffixes[i];
    items[i].description = descriptions[i];
    //items[i].price = float(price[i]);
    items[i].price = float(price[i]);
    items[i].picTop = tops[i];
    items[i].picBot = bottoms[i];
    items[i].action = actions[i];
    println (i+ " " + items[i].name);
  }

 

A DIAL AND A SWITCH:

The dial proved to be an unreliable rotary, partly because the gears on the antique were old, and partly because we were relying on little bursts of electricity to tell us what was happening. The values weren’t always consistent, so we found ourselves constantly tweaking the variables to get it right.

void theDial () {
 
  if (millis () -last > interval) {  // while the current timer is greater than interval
    if (inByte > (initVal + factorForward)) {     // if the rotation is this much over initial value
      println ("dial is: " + dial + items[dial].name);
      last = millis();                  //reset the timer
      if (dial < (items.length-1)) {    //if dial is at the max number
        dial ++;        //go up the dial
      }
      else {
        println ("dial from inside                  " + dial);
        dial = 0;                       // loopback to 0
      }
    }
    if (inByte < (initVal - factorBackward)) { // if the rotation is this much less than initial value
      last = millis();                  //reset the timer
      if (dial == 0) {                  // if dial is at 0
        dial --;                        // go down the dial
      }
      else {
        dial = (items.length-1);       //loopback to the max
      }
    }
  }
}

 

The switched worked well in isolation, but an unforseen problem we had was whenever we hit the switch (attached to the antique’s lever) it would send a shock of electricity back to the Arduino, which it interpreted as a dial change. This was another thing we had to compensate with in code.

void theSwitch () {
 
  isItOn = bigSwitch; 
 
  if (isItOn != wasItOn) {
    wasItOn = isItOn;
    println ("SWITCH");
    if (isItOn == 1) {
      if (state < 4) {
        state ++;
      }
      else {
        state = 0;
        switchHit = true;
      }
    }
  }
 
  switch (state) {
 
  case 1:
    chosenOne = -1;
    chosenTwo = -1;   
 
    break; 
 
  case 2:
 
    if (chosenOne == -1) {
      println ("chosenOne " + chosenOne); 
 
      if (dial != 0) {
        if (!mouseOnly) {
          chosenOne = dial+1;
        }
        else {
          chosenOne = dial;
        }
      }
      else {
        chosenOne = 0;
      }
    } 
 
    break;
 
  case 3:
    println ("chosenTwo " + chosenTwo);
    if (chosenTwo == -1) {
 
      if (dial != 0 ) {
        if (!mouseOnly) {
          chosenTwo = dial+1;
        }
        else {
          chosenTwo = dial;
        }
      }
      else {
        chosenTwo = 0;
      }
    }
    printed = true;
    break;
  }
}

STATE SWITCHING

So we used the lever to switch states and the dial to shuttle through the items in the item list.

The application starts off with a startup screen/ advertisement, like today’s ATM machines:

When you hit the lever, you are asked to make a first selection:

A second selection:

 

Hitting the lever again names your creation:

 

A final punch to the lever generates your receipt page, and prints out your voucher.

 

THE THERMAL PRINTER

The thermal printer, purchased from Sparkfun, was a fun addition that we put in just for the show. We thought it would be nice if people could walk away with a souvenir of their “purchase”.

In Processing, we first had to prepare the text for printing:

    //prepare the text for the printer
    header = "******GENOTYPEWRITER*********";
    congrats = "Our deepest Congratulations!";
    combo = "It’s a " + items[chosenOne].prefix + items[chosenTwo].suffix + "!";
    product1 = items[chosenOne].name + " .........  $ " + items[chosenOne].price;
    product2 = items[chosenTwo].name + " .........  $ " + items[chosenTwo].price;
    total = " ....... Total $" + (items[chosenOne].price + items[chosenTwo].price);
    description = "     It is " + items[chosenOne].description + " and " + items[chosenTwo].description + "." ;
    verbage = "It will enjoy " + items[chosenOne].action + " and " + items[chosenTwo].action + " with you.";
    thanks = " Your pup will arrive in approx. 5 minutes in your local bio tube repository.";
 
    if (printed) {
      printed = false;
      thermalPrintString(header + (char)'\n' + (char)'\n' + congrats + (char)'\n' + combo + (char)'\n'+ (char)'\n'  + product1 + (char)'\n' + product2 + (char)'\n' + (char)'\n'+description + (char)'\n' + verbage + (char)'\n'+ (char)'\n' + thanks);
    }

 

“thermalPrintString” is a function that we owe to Greg Borenstein, who helped us with what I thought was the most difficult part — sending strings to Arduino (you need to send it byte by byte), and then having Arduino read it.

void thermalPrintString(String toPrint) {
  for (int i = 0; i < toPrint.length(); i++) {
    myPort.write((byte)toPrint.charAt(i));
  }
  //myPort.write((byte)'\n');
  myPort.write(9);
}

Arduino code in its entirety below. We also put a secret button behind the kiosk that would print out receipt “business cards” for us.

#include
#include 
 
int printer_RX_Pin = 2;
int printer_TX_Pin = 3;
 
Thermal printer(printer_RX_Pin, printer_TX_Pin);
 
String incoming = "";
char * out;
 
const int switchPin = 7;      // digital input
const int cardPin = 8;
 
int sensorValue;
String barcode; 
 
void setup(){
 
  printer.feed(); //advance one line
  Serial.begin(9600);
  Serial.println("setup");
 
  pinMode(6, OUTPUT);   // set the yellow LED pin to be an output
  //pinMode(7, INPUT);
  pinMode (cardPin, INPUT); 
 
  pinMode(switchPin, INPUT);
  establishContact();
}
 
void loop(){
 
  if (digitalRead(7) == HIGH) {
    // if the switch is closed:
    digitalWrite(6, HIGH);    // turn on the yellow LED
 
  }
  else {
    // if the switch is open:
    digitalWrite(6, LOW);     // turn off the yellow LED
  }
 
  if (digitalRead (cardPin) == HIGH) {
    digitalWrite(6, HIGH);
    printer.feed();
    printer.println("Cavendish Trebuchet");
    printer.println("GenoTypewriter");
    printer.feed();
    printer.println("will-jennings.com");
    printer.println("liamartinez.com");
    printer.feed();
    printer.printBarcode("24901090409", UPC_A);
    printer.feed();
    printer.feed();
    printer.feed();
    printer.feed();
    printer.feed();
    printer.feed();
  }
 
  if(Serial.available()){
    int raw = Serial.read();
    if(raw == 1){
      // read the sensor:
      sensorValue =analogRead(A0);
      // print the results:
      Serial.print(sensorValue, DEC);
      Serial.print(",");
      // read the sensor:
      sensorValue =digitalRead(switchPin);
      // print the last sensor value with a println() so that
      // each set of four readings prints on a line by itself:
      Serial.println(sensorValue, DEC);
    }
    else if(raw == 9){
      printer.println(out);
      printer.feed();
      //barcode
      printer.printBarcode("24901090409", UPC_A);
      printer.feed();
      printer.feed();
      printer.feed();
      printer.feed();
      printer.feed();
      printer.feed();
      incoming = "";
    }
    else {
      incoming += (char)raw;
      out = &incoming[0];
    }
  }
}
 
void establishContact() {
  while (Serial.available() <= 0) {
    Serial.println("hello");   // send a starting message
    delay(300);
  }
}

 

THE VOUCHERS

Here is a gallery of a bunch of vouchers we managed to scrounge together after the show.

 

VIDEO

And here’s a video that we put together.

WEBSITE

Our article/timeline can be found at GenoTypewriter.com and all its glory.

COMPLETE CODE

Is up on Github.

 

 


 

Blink Stories

Blink Stories is based on a theory that I had wanted to test for a very long time.

It is Walter Murch’s theory about why we blink, our stream of consciousness, and film editing.

I first mention it in this blog here. This is what I wrote:

The theory is that when you blink, there is a switch in your consciousness. What I like about this is that it speaks of empathy; when you watch a film and you blink at the same time as a character, you empathize with them. When you react in the same way as a theater full of people, you are all connected in this way.

For my Data Representation final with Jer Thorp, I decided to explore this theory on my own at last.

These are the questions that I wanted to answer:

  1. Do people blink at similar, precise times while watching a movie? Is this proof of a job well done on the filmmaker’s part, in that the audience empathizes wholly with the film?
  2. Does it coincide with any of Murch’s markers — while an actor himself blinks, or during an editor’s cut?
  3. Is there a particular genre where people empathize particularly strongly with the character? Comedy, drama, horror?

What I particularly find wonderful about Murch’s theory is that when we blink, we ourselves are making a “cut”. When we change consciousness, when we switch our train of thought, we are making a “cut”, just like a film editor does. So we can apply this theory to real life in a number of ways –

  1. Do two people blink in similar times during a conversation?
  2. What about when people listen to music? What about different types of music — jazz or classical?

Given the limited amount of time, I scaled down the idea and separated it into manageable components:

  1. Data Collection
    • Technology: Blink Detection Using Open CV and Processing
    • Write/ Read To XML
    • Amazon Turk to collect a large amount of data
    • A booth in the Tisch Building to collect more data
    • Film Selection: clips from which films?
  2. Data Representation
    • A movie poster with every frame in the video clip represented
    • A live representation of the blinks playing back through a video screen.

DATA COLLECTION

BLINK DETECTION USING OPEN CV AND PROCESSING

Open CV is well-loved in ITP because it comes built-in with some neat face-tracking functions. The trick was to find a way to just track the eyes. I finally found this site that carried Custom Haar Cascades, which comes in XML form and basically does the trick of finding the eyes for you. After you have downloaded XML, a few modifications to the file itself and the OpenCV Javadoc is all you need to do.

I was able to find eye Haar Cascades here, with instructions on how to use it with processing here.

Ideally, I would have wanted to use as accurate technology as possible with the blink detection, and looked for a while into DanO’s pupil detection code, as well as consulting with Dan Shiffman and Greg Borenstein. I also looked into the Eyewriter, which I will look into some more in the future. After a few days of experimenting with pupil detection and feeling overwhelmed, I decided that I would need more time to make it work properly and given the time constraints, would need to scale down for the meantime. So for now the code uses a combination of eye-tracking and motion detection — if any motion is detected within the eyes, then call that a blink.

This means that essentially, the viewer cannot move at all during the experiment (or at least, cannot move his/ her head). Even eyeball movement might be counted as a blink, so I decided to make the size of the screen small to minimize this.

void readBlinks() {
  opencv.read();                  
 
  Rectangle[] faces = opencv.detect( 1.2, 3, OpenCV.HAAR_DO_CANNY_PRUNING, 10, 10 );
 
  if (debugOn) image( opencv.image(), 0, 0 );  //  Display the difference image
 
  opencv.absDiff();                           //  Creates a difference image
  opencv.convert(OpenCV.GRAY);                //  Converts to greyscale
  opencv.blur(OpenCV.BLUR, 3);                //  Blur to remove camera noise
  opencv.threshold(thresh);                       //  Thresholds to convert to black and white
  movementImg = opencv.image();               //  Puts the OpenCV buffer into an image object
 
  // draw face area(s)
  noFill();  
  stroke(255, 0, 0);
 
  for ( int i=0; i<faces.length; i++ ) {
    if (debugOn) rect( faces[i].x, faces[i].y, faces[i].width, faces[i].height );    // draw the rectangle
 
    for (int x = faces[i].x; x < (faces[i].x+faces[i].width); x++) {      //loop through 
      for (int y = faces[i].y; y < (faces[i].y + faces[i].height); y++) {         
             if (isPlaying) {                     
                   if (blinkTime != oldTime && blinkTime - oldTime > interval) {
                        if (brightness(movementImg.pixels[x+(y*movementImg.width)]) > 230) {  //if brightness is higher
                        totalPixels++;
            }
 
            if (totalPixels >10) {
              addNewBlink(blinkTime);
              saveData();
              oldTime = blinkTime;  
              totalPixels = 0; 
 
              if (debugOn) fill (255, 0, 0); 
              if (debugOn) ellipse (100, height/2 - 100, 30, 30);
              println ("MARKER " + blinkTime);
            }
          }
        }
      }
    }
  }
  opencv.remember(OpenCV.SOURCE);
}

 

XML WRITE/ READ WITH PROXML

The XML Writing/ Reading was the part that I struggled with the most, probably because I chose this particular time to learn all about ArrayLists. The XML Tree was simple enough:

<User>
<Clip num = “1”>
<blink time = “15.01”>
<blink time = “22.00”>
<blink time = “42.45”>
</Clip>
</User>

So basically every user would have a clip, and every clip would have a blink with their corresponding times.

The recorder application I wrote has the ability to create a new User, and within that user, new Clips, and within those Clips, blinks.

First I create a new user every time the program starts up, in setup:

  newUser = new proxml.XMLElement ("user");
  userNum++;
  newUser.addAttribute ("num", userNum); 
  XMLusers.addChild(newUser);

New clips are created whenever a new movie is loaded, with keypress:

  else if (key == '1') {
    if (loaded) movie.pause(); 
    movie = new Movie (this, "lilmermaid.mp4"); 
    blinkTime = 0; 
    oldTime = 0; 
    movie.play();
    movie.goToBeginning();
    movie.pause();
    loaded = true; 
    println ("loaded Little Mermaid"); 
    newClip = new proxml.XMLElement ("clip");
    newClip.addAttribute ("num", "1");
    newUser.addChild(newClip);
    state = 2;
  }

New blinks are created with a function “addNewBlink” that is called when OpenCV finds a new blink:

void addNewBlink (float time) {
  blinks.add (new Blink(time));
 
  proxml.XMLElement blink = new proxml.XMLElement ("blink"); 
  blink.addAttribute ("time", time);
  newClip.addChild(blink); 
  //newUser.addChild(blink);
}

This is called whenever an XML is loaded. Number of users already in the XML is counted, so that when a new user is created it increments by 1.

void xmlEvent(proxml.XMLElement element) {
  XMLusers = element;
 
  proxml.XMLElement[] users = XMLusers.getChildren();
  userNum = users.length;
  println ("User Size: " + users.length);
}

The generator applications then read the final XML:

void xmlEvent(proxml.XMLElement element) {
  XMLusers = element;
 
  //create array of proxml elements called "users", get the children
  proxml.XMLElement[] users = XMLusers.getChildren();
  for (int i = 0; i < users.length;i++) 
  {
    User u = new User();
    u.num = users[i].getIntAttribute("num");
    println ("------new user------");
 
    //create another array of the children of the users
    proxml.XMLElement[] clips = users[i].getChildren(); 
    for (int j = 0; j < clips.length; j++) {  
      Clip c = new Clip();    
      c.whichUser = u.num; 
      c.num = clips[j].getIntAttribute ("num"); 
      println ("--new clip -- " + c.num); 
 
      //get the blinks within the clip array
      proxml.XMLElement[] blinks = clips[j].getChildren(); 
      for (int q = 0; q < blinks.length; q++) {  
 
        float blink = blinks[q].getFloatAttribute ("time");
        //add the blink to the arraylist within the arraylist!
        c.blinks.add(blink);
      }
 
      u.clips.add(c);
    }
    // add it to the arraylist
    userList.add(u);
  }
}

 

WHAT FILMS?

I settled with having people watch 3 or 4 two-minute scenes. The Criteria:

  1. Must be something that the viewer will enjoy watching, and be riveted to for the entire two minutes.
  2. Must be familiar and non-threatening (especially if it was going on Mechanical Turk)

So after a selection of around 20 movies, I narrowed them down to these four:

Pulp Fiction – Ezekiel 25:17 speech: Samuel L. Jackson carries this scene, and I wanted to see if the audience synced up when watching him.

Jurassic Park – The first brachiosaurus reveal – a scene with a clear high emotional point.

Apocalypse Now – The Helicopter Attack (Ride of the Valkyries) – Walter Murch edited this iconic scene.

The Little Mermaid – Kiss The Girl – a catchy, familiar tune that is hard not to like.

Movies that didn’t make the cut were: Carrie, the Prom Scene (too much?); Taxi Driver, “You Talkin’ To Me?”; Gene Kelly Singin’ In the Rain.

MECHANICAL TURK DOES NOT WANT YOU TO MAKE THE WORKERS DOWNLOAD ANYTHING

Was something that I found out after I had almost completed making a downloadable program, wasting a week.

Now that I think about it though, it may have been difficult to get workers to turn on their camera for a job that would pay them around $0.15 — I would have been paranoid about my privacy too, had I been them.

THE FILM DEPARTMENT WILL NOT REPLY TO YOUR REQUESTS TO PUT A BOOTH ON THEIR FLOOR WHEN IT IS FINALS TIME

No matter, I will try again in the Spring.

SO, IN THE END, I DID ALL THE WATCHING

I watched all 4 clips 4 times to see what I got. Given all the flaws of my software — motion detection instead of true blink detection — there was a pattern! There were certain areas, little clumps, where I would blink more often, and areas where I would not blink at all.

 

MOVIE POSTER

This is a picture of Walter Murch’s editing room. While editing, he lays out pictures of all the scenes on his wall so that he can, at a moment’s glance, glimpse the flow and content of the story.

I wanted to do the same thing to represent the blink data. When the viewer blinks, the corresponding frame is darkened. The more blinks happen within the area of the frame, the darker the frame is.

From the movie poster, you can see the areas where I have a tendency to blink by the darker areas (a frame where I blinked in the same spot every time are black!), and the areas where I keep my eyes open.

The results of the poster make me optimistic.

 

REAL TIME DATA

I wanted to show real-time blink data, so that you could see the precise moments that the blinks happened, as well as be able to compare your own blinks to the recorded ones while you were watching. There was no other way to represent this. I chose a row of ellipses that appear whenever I blinked (the X-coordinate is dictated by the session). I thought this was a simple and direct way to represent it for the meantime.

I was pleased with how the ellipses moved along the screen, visualizing the way my body reacted to the film as the film played.

The results themselves are revealing. For one, I noticed that I was blinking quite a lot in the data. The two possible reasons I can think of are that one, although I kept myself from moving, and even kept the movie screen size small to avoid this, perhaps the application logged small things like eye movements across the screen.

The more obvious reason for the noise is that because I wrote the program, and because I knew that I was logging blinks, I was constantly thinking about blinking the whole time I was watching the clips. And thinking about blinking is like thinking about yawning — the moment you think of it, you do it. You yawn, and I blinked.

As I continue to work on this, controlling this kind of noise and getting more accurate data is one of the more important but difficult challenges that I have to work on.

 

THE COMPONENTS AND THE CODE

Github repository here. Clicking the name of the application will take you to its main class.

Blink Recorder – The application I wrote to detect blinks. OpenCV with custom Haar Cascades, ProXML Libraries required.

Graph Generator – Simple graph plotter. The blinks are so dense that it does not really help, but it was a place to start.

Frame Saver – Takes a clip and exports frames for the poster generator.

Poster Generator – Generates the poster material (movie titles added in Photoshop).

Clip Generator – Live playback of the clips.

 

FINAL THOUGHTS

Even if I did not finish this project to the extent that I had planned, I am very pleased with the results. First of all, I learned a lot of programming, no matter how slowly I moved.

Secondly, tentatively speaking, it looks like Walter Murch’s theory is worth exploring further. It makes me excited to think about what the data will look like when there are hundreds of people watching the same clip. The idea of an entire audience syncing up when a film or piece of art is involving seems very beautiful to me.

This is a project that I have been thinking of for a while and would like to explore further, so I think I am going to pursue this for my thesis. There is a lot to work on:

  1. Perfecting blink detection
  2. What different situations? Not just movies?
  3. How to represent this is other ways – perhaps sculpturally.

There was a suggestion during my finals presentation about creating a film that was edited by a collective of blinks — crowdsourcing the edit, in other words. This was one of the first ideas I had when I first got interested in this topic a few years ago. The more I thought about it, the less it sat well with me. I think the project should be about glimpsing moments when we as human beings synchronize in our train of thought, and the exploration and representation of that. Furthermore, editing is much more than knowing when to switch from one scene to another, or when to cut: it is about fitting together the correct pieces in order to tell a story. Saying that a good edit is when things are timed right based on the changing train of thought of a crowd would be oversimplifying it. A crowdsourced edit (I think) would not be either a good representation of when people synchronized, nor a good edit.

I have a little time to think about this further before the final semester starts. Updates will be forthcoming.

Happy New Year!

 

Planet Maker at TV of Tomorrow

Wee PlanetMaker, from my first year ICM and Pcomp final, got included in this year’s TV of Tomorrow roster, curated by Gabriel Barcia-Colombo.

PlanetMaker and I were extremely honored to have been asked, considering the curator and the company.

With the help of all-around guy Will Jennings, we streamlined PlanetMaker’s assembly and disassembly using door hinges, rubber, and heavy-duty velcro. To quote Gabe: “that was the fastest set-up of any art piece I have ever seen.”

Viola!


Cavendish Trebuchet

Cavendish Trebuchet was created in collaboration with Will Jennings.

 

 

I particularly like this project for its brevity and sense of humor. As a project, it was fun to work on. It was also perfect for an event like the ITP Winter Show, where people usually want immediate results.

The technical part wasn’t too difficult. Will wired up the catapult with a reed sensor and an Arduino (we had a back-up tilt switch in case the glass of the reed sensor shattered, but we never had that problem). Brett Murphy helped us situate the speakers for optimum directional sound (and a little reverb).

The Processing code is simple as well, where there are two states and two behaviors depending on the state: catapult up will play this, and catapult down will play this. We used wav files for the audio and a CSV to mark entry points for the video.

Below is the code for the mouse-only version.

 

/*
Cavendish Trebuchet (Mouse Only) 
Lia Martinez &amp; William Jennings
*/
 
import ddf.minim.*;
import fullscreen.*; 
 
FullScreen fs; 
 
import processing.video.*;
 
Minim minim;
AudioPlayer[] baba; 
AudioPlayer[] nana;
int numAudio = 0; 
 
Movie movie;
int numFrame = 0;
PFont font;
boolean isPlaying; 
int numMovie; 
int oldAudio;
 
int state; 
int timer; 
 
int paperAirplaneVid, paperAirplaneAud; 
 
int [] video;  
String [] splits; 
 
//-----------------------------------------------------------------
void setup () {
  size (640, 480); 
  background (0); 
  smooth(); 
  noStroke(); 
 
  fs = new FullScreen(this); 
 
  String []input = loadStrings ("bananas_day1.csv"); 
  movie = new Movie(this, "bananas2.mov");
  state = 0; 
  timer = 0; 
  oldAudio = 0; 
 
  movie.play();
  movie.goToBeginning();
  movie.pause();
  isPlaying = false;  
 
  font = loadFont("DejaVuSans-24.vlw");
  textFont(font, 24);
 
  //println ("banana is:" + " " + banana.length + " input is " +  input.length); 
 
  minim = new Minim (this); 
  baba = new AudioPlayer [16]; 
  nana = new AudioPlayer [16]; 
 
  for (int i = 0; i &lt; baba.length; i++) {
    baba[i] = minim.loadFile ("bananas/baba_" + i + ".aif", 2048);
    baba[i].pause();
  }
 
  for (int i = 0; i &lt; nana.length; i++) {
    nana[i] = minim.loadFile ("bananas/nana_" + i + ".aif", 2048);
    nana[i].pause();
  }
 
  video = new int [input.length]; 
  splits = new String [input.length]; 
 
  for (int i = 1; i &lt; input.length; i++) {
    println ("number of markers: " + input.length); 
    splits = input[i].split(","); 
    video[i] =  int(splits[0]);
    println (video[i]); 
 
  }
 
  paperAirplaneVid = 7; 
  paperAirplaneAud = 9; 
 
}
 
//-----------------------------------------------------------------
void draw () {
 
  image(movie, 0, 0, width, height);
  fill(240, 20, 30);
 
  timer = getFrame(); 
 
  switch (state) {
 
  case 0: //restingstate
    movie.pause(); 
    textSize (30); 
 
    break; 
 
  case 1: //launching
    if (numFrame &lt; video.length-1) {   //if the current frame is less than the total 
      //play video
      if (timer &lt; video[numFrame+1] ) {   //play the video while its not yet the next one
        movie.play();
      } 
      else {
        movie.pause();
      }
    } 
    else {
      movie.play();
    } 
    break;
  }
}
 
//-----------------------------------------------------------------
void movieEvent(Movie movie) {
  movie.read();
}
 
//-----------------------------------------------------------------
void mousePressed() {
 
  //for the video
  state = 0; 
 
  upNumAudio(); 
 
  if (nana[oldAudio].isPlaying()) nana[oldAudio].pause();
  baba[numAudio].rewind(); 
    println ("baba position is: " + baba[numAudio].position()); 
  baba[numAudio].play(); 
 
}
 
//-----------------------------------------------------------------
 
void mouseReleased () {
 
  state = 1; 
 
  upNumVideo(); 
 
  setFrame (video[numFrame]);
 
  if (baba[numAudio].isPlaying()) baba[numAudio].pause();  
  nana[numAudio].rewind(); 
  println ("nana position is: " + nana[numAudio].position()); 
  nana[numAudio].play(); 
  oldAudio = numAudio; 
 
}
 
//-----------------------------------------------------------------
 
void keyPressed() {
 
  if (key == 'f') {
    fs.enter();
  } 
  else if (key == 'F') {
    fs.leave();
  }
} 
 
//------------------------------------------------------------------
 
int getFrame() {    
  return ceil(movie.time() * movie.getSourceFrameRate()) - 1;
}
 
//-------------------------------------------------------------------
void setFrame(int n) {
  movie.play();
 
  float srcFramerate = movie.getSourceFrameRate();
 
  // The duration of a single frame:
  float frameDuration = 1.0 / srcFramerate;
 
  // We move to the middle of the frame by adding 0.5:
  float where = (n + 0.5) * frameDuration; 
 
  // Taking into account border effects:
  float diff = movie.duration() - where;
  if (diff &lt; 0) {
    where += diff - 0.25 * frameDuration;
  }
 
  movie.jump(where);
 
  movie.pause();
}  
//---------------------------------------------------------------------
 
int getLength() {
  return int(movie.duration() * movie.getSourceFrameRate());
}  
 
//---------------------------------------------------------------------
void upNumAudio() {
 
  numAudio = int(random(0, baba.length));
 
  println ("numFrame: " + numFrame + " numAudio: " + numAudio);
}
 
//---------------------------------------------------------------------
 
void upNumVideo() {
 
  if (numAudio == paperAirplaneAud) {
  numFrame = paperAirplaneVid;
  } else  {
  numFrame = int(random(0, video.length));
  }  
 
  if (numAudio != paperAirplaneAud &amp;&amp; numFrame == paperAirplaneVid) {
  numFrame = int(random(0, video.length));
  }  
 
  println ("numFrame: " + numFrame + " numAudio: " + numAudio);
}
 
//---------------------------------------------------------------------
 
void stop()
{
  // always close Minim audio classes when you are done with them
 
  minim.stop();
  super.stop();
}

 

 

Javascript, web-only version coming soon!

 

LifeCycle

LifeCycle was created in collaboration with Alvin Chang, Craig Protzel, Jamie Lin, Emily Webster.

Lifecycle is a bike kit designed for Northern Uganda.

It quickly connects two normal bikes and turns it into an emergency vehicle.

Clicking on the logo (by Jamie Lin) will take you to LifeCycleBike.Org, which is a work of Alvin Chang.

Below are videos edited by Craig Protzel:

 

 

And a terrific round-up of our adventures by Jamie that never fails to make me giggle:

 

Designing for UNICEF was a difficult class for one major reason: the design constraints were real and absolutely not negotiable. If someone from Uganda tells you that there simply aren’t enough bikes in the country for a project like this to work, for instance, then there isn’t a lot that you can do about it.

The ideation process was (for me) the most difficult: finding a problem that needed to be solve, where a prototype could be produced in the limited about of time that we had (less than 7 weeks) was definitely a challenge.

I was fortunate to be in a group that worked hard at the problem and worked well together. The experience was at times frustrating, but more due to the constraints and limitations, and not because of the people that I was surrounded by.

Learning how to work in different groups, rapidly generating new ideas as well as presenting them weekly were skills that I definitely walked away with, as well as the fulfillment that you are, for better or for worse, working towards solutions for real-world problems.

 

 


StagNation

Art Kleiner sent out this invite for our Future of the Infrastructure final presentation (our group is in bold).

————————————————————-
FINAL PRESENTATIONS
Future of the Infrastructure Final Presentations
Friday, Dec 9
7pm- 10pm
at ITP – room 50

Eleven years ago — Apple was a struggling company about to launch iTunes; China was known for Mao, not for manufacturing; the biggest environmental disaster of the year was a steam leak at Indian Point power plant; and an obscure act of terrorism on the U.S.S. Cole seemed like a remote, inconsequential event.

What will the world be like 11 years from now?

Each year, a group of graduate-level students at New York University’s famous Interactive Telecommunications Program presents scenarios on the future of media. These are fascinating glimpses of the interrelated future of new media and the global economy; of the evolution of society and our own ambitions and aspirations; and then a thought-provoking, freeform discussion follows.

We’ll be talking about these four ways that the world might evolve by 2022:

HOMO EVOLUTIS – a future in which biotech research, enabled by information technology, leapfrogs as far as plausibly possible.

FLASH JOBS – a future shaped by a more fully decentralized, web-enabled and cloud-enabled way of life.

SHAREFLATION – a future in which the economic crisis turns into a painful period of deflation — and then into a world with less waste and less consumption of resources.

FREEMIUM (STAGNATION) – a future in which large institutions persist the only way they can — by establishing a stable but stagnant economy.

The presenters include:. Alex Dodge, Lia Martinez, Dave Boyhan, Doug Thistlethwaite, Fernanda Bak, Ginny Hung, Hernan Carranza, Johnny Lu, Kevin Bleich, Fred Truman, Matt Rader, Ramsey Stevens, Sajan Ravindran, Ali Sajjadi, Survarchala Narayanan, and Will Jennings. Taught by Art Kleiner.

—————————————————————————

I was fortunate enough to work with Dave Boyhan, Alex Dodge, and Johnny Lu, three of the smartest (and nicest) people that I know. It was a great pleasure to spend each Friday morning before class (usually over lunch) talking about possible scenarios for our target year (2022).

The presentation itself capped out the semester really well. We decided to go for a more satirical but casual format, where we pretended to be presidential advisors preparing to present to an incoming president. The presentation contained supplementary charts, graphs, and animations to prove our point.

 

Here’s the presentation:

Incomplete Class Photo and StagNation (formerly Freemium, formerly OK But Not Great)

Fly Home

Thoughts For A Final Project

Im interested in using video to show data as a narrative. For a previous project, I had parsed text information and converted it as an XML for Final Cut Pro to import as video effects values. For this round I would like to affect the timing, cuts, and content, and not just video filters.

One simple example might be to show the progress or growth of something by using the progression of time. For instance, a shot of a child running or a woman singing could be playing forwards, and then backwards, and then forwards again depending on the growth of say, research on breast cancer over time.

In another scenario, and as a tribute to Lee Kuleshov’s experiment and film editing, I’d like to reorder the cuts within a sequence based on data. Ideally, when the process is repeated with the same material but different aspects of the same data set, one can demonstrate 1. a different perspective on the given data; 2. how film editing affects a story; 3. how the data changed the story.

Hopefully by next week I will have a better idea of what content I will need and what I would like to map to it.

 

Multicultural America: A Survey Of Ideas

By 2022, the majority of all Americans under 18 will be non-white; this will extend to the rest of the total population by 2050. This is due partly to an aging white population, and the increase in the birth rates of ethnic minorities. More than half of the growth in US population between 2000 and 2010 was because of the increase in the Hispanic population. Today, half of all births are minorities. By 2042, Americans who identify themselves as Hispanic, black, Asian, American Indian, Native Hawaiian and Pacific Islander will together outnumber non-Hispanic whites.

Indeed, as President Bill Clinton said in a speech in Portland State University in 1998, “No other nation in history has gone through demographic change of this magnitude in so short a time.” As the foreign-born population moves to different destinations, the nation will continue to face policy challenges on how to incorporate the new arrivals. Many suburban areas that had little experience with either immigration or poverty will now face new and distinctive issues, and will need to modify and extend their methods to reach immigrants living in poverty.

If indeed the end of white America is a cultural and demographic inevitability, we ask: what will the new mainstream look like? What ideals or values will it rally around? Will a post-white America be less racially divided, or more so? If the current generation is growing up without real awareness of a majority race, will it matter?

What it means to be American has been changing. Hua Hsu, in his article, “The End of White America?” he quotes Bill Amada, head of the IW Group: “I think in the 1920s, 1930s, and 1940s, for anyone who immigrated, the aspiration was to blend in in and be as American as possible. They wanted to imitate white America as much as possible: learn English, go to church, go to the same schools.” Hsu concludes, “Instead of the long-standing model of assimilation toward a common center, the culture is being remade in the image of white America’s multiethnic, multicultural heirs.”

The increase of mixed-race citizens should also be mentioned. Around 10% of marriages in the US are interracial, more than double what it was in 1980. Although he says that he lists himself as “black”, US President Barrack Obama is of mixed race, and Tiger Woods calls himself a CauBlAsian – for Caucasian, Black, and Asian.

It is safe to assume that the rapidly changing demographic in America will cause tension, as it already has. But as the shifts continue to reduce the power of racial hierarchies, we may within the next 40 years arrive at a place where the citizens of the country are treated as individuals more than their belonging in a racial group. For instance, in marketing and advertising, there are campaigns that are targeted for different races — Asian, Hispanic, with the “white” race being considered the mainstream. Hsu quotes Karl Carter, of Atlanta’s youth-oriented GTM Inc., who suggests that marketers and advertisers would be better off focusing on matrices like “lifestyle” or “culture” rather than race or ethnicity. “You’ll have crazy in-depth studies of the white consumer or the Latino consumer,” he complains. “But how do skaters feel? How do hip-hoppers feel?”

As we inevitably approach a true multicultural nation, it is interesting to consider how America will handle the change over the long term. In Michael Barone’s book, “The New Americans”, he postulates that this has all happened before and that all of it will happen again. He creates parallels by comparing immigrant waves then and now: I. Irish and Blacks, II. Italians and Latinos, III. Jews and Asians. Barone says that eventually the unassimilable groups were assimilated. Any frictions can be overcome if we follow the national motto – “out of many, one”, and reject divisive policies like racial and ethnic preferences and bilingual education. Roger Clegg reviewed Barone’s book and writes: “Barone is unafraid of immigration, as long as immigrants and other Americans accept Americanization as part of the bargain of coming to America.”

In a similar vein, but coming from different circumstances, French president Nicolas Sarkozy recently declared multiculturalism a failure. He said: “We have been too concerned about the identity of the person who was arriving and not enough about the identity of the country that was receiving him. Of course we must all respect differences, but we do not want… a society where communities coexist side by side.If you come to France, you accept to melt into a single community, which is the national community, and if you do not want to accept that, you cannot be welcome in France.”

Prime Minister David Cameron of Britain and Chancellor Angela Merkel of Germany have also recently made deeply critical speeches, and the Dutch government decided in early 2011 to dump a decades-old policy of multiculturalism. Kenan Malik, in an article for the NY Times entitled, “Assimilation’s Failure, Terrorism’s Rise” with regards to Europe, writes that: “In place of citizenship and a genuine status in society, the (German) state “allowed” immigrants to keep their own culture, language and lifestyles. One consequence was the creation of parallel communities.” And of Britain: “Many second-generation British Muslims now find themselves detached from both the religious traditions of their parents, which they often reject, and the wider secular society that insists on viewing them simply as Muslims. A few are drawn inevitably to extremist Islamist groups where they discover a sense of identity and of belonging. It is this that has made them open to radicalization.” Please note that although worthwhile to look into further, what is said to be the failure of multiculturalism and assimilation in Europe exists in a different context that is beyond the scope of this paper.

In the realm of education, how a country handles multiculturalism is an important issue. In the US, multicultural education advocates faced considerable hostility from conservatives, particularly in the 1980s and 90s. Global education appeared to challenge the primacy of the nation-state and promote anti- Americanism (Schukar 1993; Gaudelli 2003*) while multicultural education was accused of promoting separatism and disunity (Schlesinger 1991; Ravitch 1990). For advocates of assimilation, the main concern is the unity of the country, where multiculturalism promotes diversity and as a result, conflicting loyalties and reduces national identity and patriotism.

Proponents for a global education argue that education should promote “both the singular citizen identity and the plurality of cultural identities” (Parker, 1997), and that students need to clarify and reflect on their cultural identities before developing a similarly reflective national identity. Additionally, others have contended that “multicultural education actually strengthens patriotism and national identity because it allows all citizens to see themselves in the ‘American Story’ and in the structures and institutions of society (Adler 2003)”.

Singapore is one country that incorporates multiculturalism within education; English is required for all students but so is learning one’s “mother tongue” – in the case of Singapore, either Malay, Mandarin, or Tamil. Lee Kuan Yew, the founder and master planner of Singapore, said in 2000: “English was assumed to be crucial to Singapore’s economic survival; the “mother tongues” were adopted to maintain ethnic identity and traditional values… Malay children should know their proverbs and their folklore…. For the Indians, the Ramayana and the Mahabaratha provide marvelous and inexhaustible sources of stories…. That they also carry a moral message is the genius of the culture. No child should leave school after 9 years without having the “soft-ware” of his culture programmed into his subconscious.”

 

 

Resources:

U.S. Census Bureau

Visualizing Our Future Selves

America Reaches Its Demographic Tipping Point – William H. Frey

The Changing Face of America’s Racial Diversity – William H. Frey

Immigration and Poverty in America’s Suburbs – Wilson, Singer, Suro

In Census, Young Americans Increasingly Diverse – NYTimes, Sabrina Tavernise, Februaru 2011

In a Generation, Minorities May Be the U.S. Majority – NY Times, Sam Roberts, August 2008

Black? White? Asian? More Young Americans Choose All Of the Above – NYTimes, Susan Saulny, January 2011

The End of White America? – The Atlantic, Hua Hsu,Jan 2009

What Will the Role of Whites be in A Multicultural America? – David Burgos, August 2011

The New Americans: How The Melting Pot Can Work Again – Michael Barone, 2001

Reheating the Melting Pot: A Review of Michael Barone’s The New Americans – Roger Clegg

Nicolas Sarkozy Declares Multiculturalism Had Failed – Telegraph UK

Assimilation’s Failure, Terrorism’s Rise – NYTimes, OpEd, Kenan Malik, July 2011

*Global Multicultural Citizenship Education – A Singapore Experience – Li-Ching Ho, 2009

The Bilingual Education Policy in Singapore:Implications for Second Language Acquisition – Dixon, Harvard Graduate School of Education

Technological Modernization, the Internet, and Religion in Singapore – Kulver, Cheong (2007)