Amanda Bernsohn: @ITP | Images | Statement | CV | Projects

 



Midterm Project - The Versifier

It was initially my intention to create a project involving visualizing poetry parsed from XML on the web. The part I chose to implement was the actual motion that I wanted in the end. For the purposes of this first phase, the lines are being pulled from three text documents that live locally on my computer. The line motion is created by three potentiometers sending bytes to processing serially. Each text file contains one poem and they are not related. The values received from the Arduino are subtracted from the X position of each line respectively, creating a leftward motion across the screen. When the line leaves the screen, the poem is incremented by one line and a new one enters from the right. The user can use the potentiometers to alter the speed.

My project evolved into being a tool that a poet, or any artist really, can use to combat a block in creativity. Though not intended to provide lines to a writer, the program can juxtapose existing lines from poems in such a way that one's creativity may be triggered. In essence, the versifier is intended to be a writer's block buster. Once off the screen, the lines cannot be retrieved and brought back on screen (there is no movement toward the right on the X-axis). This is intentional as the versifier is meant to encourage experimentation and to discourage attachment to specific lines or groups of lines, especially since they have been written by someone else already.

The physical element is meant to invoke a blank sheet of paper, as is the screen, which is bare except for the three lines in play.

Code below:





The program running:

video

/*
Part one if ICM Midterm project for Dan Shiffman's class at ITP
For purposes of prototype, thanks to mark doty, max garland and
peter gizzi for words -- poem text used without permission
Text incrementing when text is less than negative xposition, from Shiffman's example
Arduino code adapted from Tom Igoe's serial lab using the punctuation method
*/

import processing.serial.*;

String[] headlines;
String[] tokens;
String[] headlines2;
String[] tokens2;
String[] headlines3;
String[] tokens3;
int index = 0;
int index2 = 0;
int index3 = 0;
PFont f;
float x = 300;
float t = 300;
float s = 300;
float moveLine1;
float moveLine2;
float moveLine3;

Serial myPort;
int[] sensorValues = new int[4];
int i = 0;
boolean firstContact = false;

void setup() {
size(600,600);
frameRate(30);
headlines = loadStrings("data.txt");
tokens = split(headlines[0], ";");
headlines2 = loadStrings("data2.txt");
tokens2 = split(headlines2[0], ";");
headlines3 = loadStrings("data3.txt");
tokens3 = split(headlines3[0], ";");
smooth();
f = loadFont("ArialMT-16.vlw");
println(Serial.list());
String portName = Serial.list()[2];
myPort = new Serial(this, portName, 9600);
myPort.write("A");
println("A");
}

void serialEvent(Serial myPort) {
int inByte = myPort.read();
if (inByte != 20) {
if (firstContact == true) {
sensorValues[i] = inByte;
}
i++;
}
else {
println (i);
i=0;
firstContact = true;
}
}
void draw() {
background(255);
fill(0);
textFont(f,16);
textAlign(CENTER);

text(tokens[index],x,270);
x = x - sensorValues[0];
text(tokens2[index2],t,height/2);
t = t - sensorValues[1];
text(tokens3[index3],s,330);
s = s - sensorValues[2];
float moveLine1 = textWidth(tokens[index]);
if (moveLine1<-x) {
x = width;
index = (index + 1) % tokens.length;
}
float moveLine2 = textWidth(tokens2[index2]);
if (moveLine2<-t) {
t = width;
index2 = (index2 + 1) % tokens2.length;
}
float moveLine3 = textWidth(tokens3[index3]);
if (moveLine3<-s) {
s = width;
index3= index3 + 1 % tokens3.length;
}
}

/*
int sensor[4];
void setup() {
Serial.begin(9600);
}
void loop() {
// for loop to count from 0 to 2:
for (int i = 0; i < 4; i++) {
// read one of the sensors, divide by 4, put into the array:
sensor[i] = analogRead(i)/50;
// if the value is 255, truncate it so we can use 255
// as a unique value to punctuate the sentence:
if (sensor[i] == 20) {
sensor[i] = 19;
}
// print the current sensor value:
Serial.print(sensor[i], BYTE);
}
// After the sensor values, print 20 (approximately 1023/50);
Serial.print(20, BYTE);
delay(10);
}
*/

posted by Amanda @ 10/22/2007 09:14:00 PM,  

0 Comments:

Post a Comment

<< Home