“My glance meets first”

As a graduating Digital Arts and Sciences student I was responsible for a final “capstone” project that would demonstrate what I learned in my 4 years of undergraduate education. My project is titled “My Glance Meets First”, a commentary on internalized misogyny in college aged women. Controlled by a single program in Processing 4, the project combines photography and audio to entertain the message. Phrases and audio are played from the activity picked up by an ultrasonic motion sensor. Below you can see some of photographs taken by me and the program code.

import processing.serial.*;

import processing.sound.*;



//import sound files
SoundFile music;
SoundFile audio2;

// set the number of images you want to load;
int totalNumberOfImages = 10;

String imageFileName;

// array for storing images
PImage[] myImage = new PImage[totalNumberOfImages];

int currentImage = 0;
int nextImage = 1;
float myAlpha = 0;
float fadeChangeRate = .01;

Serial myPort;    // The serial port
String inString;  // Input string from serial port
int lf = 10;      // ASCII linefeed
float smoothVal = 0; // Stores the interploated (smoothed) value
float rawVal = 0; // Stores the current sensor value

PFont myFont;

void setup() {
  size(2560, 800);
  fullScreen(P2D, SPAN);
  frameRate(60);
  //fullScreen();
  myFont = createFont("AmericanTypewriter.ttc", 150);
  textFont(myFont);
  //music
  music = new SoundFile(this, "audio_1.mp3");
  audio2 = new SoundFile(this, "audio_2.mp3");
  music.loop();


  // List all the available serial ports:
  printArray(Serial.list());
  // Open the port you are using at the rate you want:
  // (Serial.list()[3] likely needs changing to the correct port from the list)
  myPort = new Serial(this, Serial.list()[2], 9600);
  //store incoming data in the buffer until there's a line break and then trigger serialEvent
  myPort.bufferUntil(lf);
  // using fullScreen() rather than size - press escape to exit fullscreen


  // load image files into array
  for (int i=0; i<totalNumberOfImages; i++) {
    imageFileName = "0"+ i+".jpg";
    myImage[i] = loadImage(imageFileName);
  }

  // This is not strictly necessary but might prove useful...
  // This line changes the usual range of RGBA values from 0-255, to 0-1
  // (This means black would be 0.0 and white would be 1.0)
  colorMode(RGB, 1);
}

void draw() {
  background(0);

  // background(0);
  // tint(1,1-myAlpha);

  text("received: " + inString, 10, 50);

  //the incoming arduino code is structured like this:
  //[triggerPin]:[value] –– e.g. 10:153
  //this means it will be relatively easy to differentiate values from multiple sensors if necessary

  //split the string apart, using the colon symbol as a separator
  String[] list = split(inString, ':');

  //assign newVal with the second part of the split string i.e. the sensor value
  rawVal = float(list[1]);
  //use smoothVal and lerp() to store the interpolated (smoothed) value
  //the higher the last value in lerp(), the quicker it moves towards the target value
  smoothVal =lerp(smoothVal, rawVal, 0.05);
  //display both rawVal and smoothVal values


  noTint();
  image(myImage[currentImage], 0, 0, 1280, 800);
  tint(1, myAlpha);
  image(myImage[nextImage], 0, 0, 1280, 800);
  myAlpha += fadeChangeRate;

  // once "nextImage" has faded in completely, update the images and reset myAlpha
  // (using %(modulo) as a simple way of keeping the
  // numbers cycling and not exceeding the image total)

  if (myAlpha >= 1) {
    myAlpha = 0;
    currentImage = (currentImage+1)%totalNumberOfImages;
    nextImage = (nextImage+1)%totalNumberOfImages;
  }
  fill(1);
  //stroke(1);
  noSmooth();
  textAlign(CENTER);
  textSize(150);

  //text(rawVal, 1920, 300);
  //text(smoothVal, 1920, 150);
  println(rawVal, smoothVal);


  if (smoothVal < 10 && !audio2.isPlaying()) {
    audio2.play();
  } else if (smoothVal < 50 && !music.isPlaying()) {
    // music.loop();
  }
  // if (audio2.isPlaying()) {
  if (smoothVal < 20) {
    text("Self Objectification is the product of my being", 1920, 300);
  } else if (smoothVal < 50) {
    text("I am Woman", 1920, 300);
  }
  else if (smoothVal < 100) {
    text("What are you?", 1920, 300);
  }
}

void serialEvent(Serial p) {
  inString = p.readString();
}
Previous
Previous

Photography

Next
Next

Art Machine