Recitation 9: Media Controller by Haiyan Zhang

In this recitation, work individually to create a Processing sketch that controls media (images or video) by manipulating that media’s attributes using a physical controller made with Arduino. Reflect on this week’s classes to guide you in your coding process, and think about how you can incorporate interactivity and computation into this week’s exercise.

I chose one screenshot image from one of my favorite documentaries called Life is Fruity. (image attached below)

import processing.serial.*;
Serial myPort;
int valueFromArduino;

PImage pimage;

void setup() {
  size(1440, 824);
  background(0);
  pimage = loadImage("pimage.png");
  printArray(Serial.list());
  // this prints out the list of all available serial ports on your computer.

  myPort = new Serial(this, Serial.list()[ 5 ], 9600);
}


void draw() {
  // to read the value from the Arduino
 image(pimage,0,0,width,height);
  while ( myPort.available() > 0) {
    valueFromArduino = myPort.read();
  }
  if (valueFromArduino == 1){
  filter(BLUR,10);
 }
  println(valueFromArduino);//This prints out the values from Arduino
}

[code] int button = 6;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
int buttonstate = digitalRead(button) ;
Serial.write(buttonstate);

// too fast communication might cause some latency in Processing
// this delay resolves the issue.
delay(10);
}
[/code]

Above are respectively processing sketch and arduino sketch for this exercise. Basically, I used a button for the physical interaction to trigger the BLUR filter over the original image in processing. The video below shows the effect.

Document your work on your blog. Use this week’s reading, Computer Vision for Artist and Designers, to inspire you to write a reflection about the ways technology was used in your project.

The documentary itself is about two elderly people sharing their life stories in the countryside to the audience who are interested in and eager for encouraging power and wisdom from their life experiences. At the end of the documentary, as an audience, I witnessed death as well as life. Therefore I chose this image in which two of them are holding each other – showing trust and love towards each other. I want to trigger the blurry effect over the image to mimic the sight when someone is in tears, to earn a blurry sense of this life fruit. 

Leave a Reply