Interactive Authoring – Logographic

Participants are encouraged to treat this as a ‘public diary’ in which every word that is typed receives an individual image result from Flickr.com. Sentences become pockets of vibrating, layered images, which are loosely representative of words chosen by the user. The most recent sentences are animated, while a record of every previous sentence can still be seen, although it is impossible to actually tell what was written.

If anyone were very curious about what those sentence packets actually mean, by pressing the mouse button, the code will give an incomplete version of the answer. By pressing this button, a random word selected from every sentence will be displayed, however this information is ultimately useless. In doing so, the entire record of previous searches is destroyed, and one user’s curiosity effectively restarts the program.

Made in Processing using the ImageLoader and ControlP5 libraries, as well as Flickr’s search API.

import at.mukprojects.imageloader.*;
import at.mukprojects.imageloader.flickr.*;
import muthesius.net.*;

import controlP5.*;
int count=0;
int maxTries=3;
int xPos=400;
int yPos=225;
int blue = 255;
int counterText=0;
String textBox = “1”;
import at.mukprojects.imageloader.*;
import at.mukprojects.imageloader.flickr.*;
import at.mukprojects.imageloader.image.*;
boolean go=false;
String apiKey = “key”;
String apiSecret = “secret”;
ControlP5 cp5;
String one=”sky”, two=”sky”, three=”sky”, four=”sky”, five=”sky”, six=”sky”, seven=”sky”, eight=”sky”, nine=”sky”, ten=”sky”, eleven=”sky”, twelve=”sky”, thirteen=”sky”, fourteen= “sky”;
int pass=0;
int passSent=0;
ImageLoader loader1, loader2, loader3, loader4, loader5, loader6, loader7, loader8, loader9, loader10, loader11, loader12, loader13, loader14;
ImageList list1, list2, list3, list4, list5, list6, list7, list8, list9, list10, list11, list12, list13, list14;
Image img1, img2, img3, img4, img5, img6, img7, img8, img9, img10, img11, img12, img13, img14;
Integer counter=0;
PImage imgMask;
int randWord=0;
int screenSave=0;
int keyCount = 0;
int slide=255;
int slideCount=0;
int cheatCount=0;
int fillCheat=0;
float swoosh=1.5;
boolean goSwoosh=false;
int swooshCount=0;
boolean pressSwitch=false;
int pressCount=0;
int pressFill=0;
String rWord1=” “, rWord2=” “, rWord3=” “, rWord4=” “, rWord5=” “, rWord6=” “, rWord7=” “, rWord8=” “, rWord9=” “, rWord10=” “, rWord11=” “, rWord12=” “, rWord13=” “, rWord14=” “;
int cheatDrop=0;
PGraphics text;
PGraphics show;
int xRand, yRand;
void setup() {
noCursor();
fill(50);
//size (720, 480, P3D);
fullScreen(P3D);
PFont font = createFont(“arial”, 20);
imgMask=loadImage(“mask copy.png”);

cp5 = new ControlP5(this);
cp5.addTextfield(“1”)
.setPosition(0, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(true)
.setColor(color(255))
;
cp5.addTextfield(“2”)
.setPosition(100, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“3”)
.setPosition(200, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“4”)
.setPosition(300, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“5”)
.setPosition(400, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“6”)
.setPosition(500, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“7”)
.setPosition(600, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“8”)
.setPosition(700, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“9”)
.setPosition(800, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“10”)
.setPosition(0, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“11”)
.setPosition(100, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“12”)
.setPosition(200, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“13”)
.setPosition(300, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
cp5.addTextfield(“14”)
.setPosition(400, -200)
.setSize(100, 40)
.setFont(font)
.setFocus(false)
.setColor(color(255))
;
textFont(font);
loader1 = new FlickrLoader(this, apiKey, apiSecret);
loader2 = new FlickrLoader(this, apiKey, apiSecret);
loader3 = new FlickrLoader(this, apiKey, apiSecret);
loader4 = new FlickrLoader(this, apiKey, apiSecret);
text=createGraphics(width, height);
background(0);
pixelDensity(2);
}

void draw() {
rectMode(CENTER);
fill(0, 100);
rect(20+width/2, height/2, 200, 50);
rectMode(CORNER);

fill (255, 255);
textSize(30);

text(cp5.get(Textfield.class, textBox).getText(), (width/2)-(keyCount*4.5), height/2);
fill(0, 0, 0, slide);
rect(0, 0, width, 45);
if (cheatCount>200&&fillCheat<100) { fillCheat=fillCheat+5; } fill(fillCheat); cheatCount=cheatCount+1; fill(0); if (keyPressed) { cheatCount=0; fillCheat=0; if (key==ENTER) { keyCount=0; textBox = “1”; counterText=counterText+1; xRand=int(random(1, 3)); yRand=int(random(1, 3)); if (counterText==1) { if (xRand==1) { xPos=int(random(80, (width/2)-150)); } if (xRand==2) { xPos=int(random((width/2)+150, width-80)); } if (yRand==1) { yPos=int(random(200, (height/2)-180)); } if (yRand==2) { yPos=int(random((height/2)+180, height-80)); } } pass=0; one=cp5.get(Textfield.class, “1”).getText(); two=cp5.get(Textfield.class, “2”).getText(); three=cp5.get(Textfield.class, “3”).getText(); four=cp5.get(Textfield.class, “4”).getText(); randWord=int(random(2, 4)); list1 = loader1.start(one, true, 1); list2 = loader2.start(two, false, 1); list3 = loader3.start(three, false, 1); list4 = loader4.start(four, false, 1); go = true; img1=null; img2=null; img3=null; img4=null; cp5.get(Textfield.class, “1”).setText(” “); cp5.get(Textfield.class, “2”).setText(” “); cp5.get(Textfield.class, “3”).setText(” “); cp5.get(Textfield.class, “4”).setText(” “); cp5.get(Textfield.class, “5”).setText(” “); cp5.get(Textfield.class, “6”).setText(” “); cp5.get(Textfield.class, “7”).setText(” “); cp5.get(Textfield.class, “8”).setText(” “); cp5.get(Textfield.class, “9”).setText(” “); cp5.get(Textfield.class, “10”).setText(” “); cp5.get(Textfield.class, “11”).setText(” “); cp5.get(Textfield.class, “12”).setText(” “); cp5.get(Textfield.class, “13”).setText(” “); cp5.get(Textfield.class, “14”).setText(” “); cp5.get(Textfield.class, “1”).setFocus(true); cp5.get(Textfield.class, “2”).setFocus(false); cp5.get(Textfield.class, “3”).setFocus(false); cp5.get(Textfield.class, “4”).setFocus(false); cp5.get(Textfield.class, “5”).setFocus(false); cp5.get(Textfield.class, “6”).setFocus(false); cp5.get(Textfield.class, “7”).setFocus(false); cp5.get(Textfield.class, “8”).setFocus(false); cp5.get(Textfield.class, “9”).setFocus(false); cp5.get(Textfield.class, “10”).setFocus(false); cp5.get(Textfield.class, “11”).setFocus(false); cp5.get(Textfield.class, “12”).setFocus(false); cp5.get(Textfield.class, “13”).setFocus(false); cp5.get(Textfield.class, “14”).setFocus(false); } else { counterText=0; } } if (go) { if (img1 == null) { img1 = list1.getImage(1); } else { tint(255, random(0, 100)-(cheatDrop/10)); imageMode(CENTER); image(img1.getImg(), xPos, yPos, 300-random(10, 150), 300); tint(255, random(0, 100)); image(img1.getImg(), xPos-50, yPos, 15-random(0, 15), (height*2)-random(0, height*2)); image(img1.getImg(), xPos+50, yPos, 15-random(0, 15), (height*2)-random(0, height*2)); tint(255, 255); } if (img2 == null) { img2 = list2.getImage(1); } else { tint(255, random(0, 100)-(cheatDrop/10)); imageMode(CENTER); image(img2.getImg(), xPos, yPos, 300-random(10, 150), 300); tint(255, random(0, 100)); image(img2.getImg(), xPos-50, yPos, 15-random(0, 15), (height*2)-random(0, height*2)); image(img2.getImg(), xPos+50, yPos, 15-random(0, 15), (height*2)-random(0, height*2)); tint(255, 255); } if (img3 == null) { img3 = list3.getImage(1); } else { tint(255, random(0, 100)-(cheatDrop/10)); imageMode(CENTER); image(img3.getImg(), xPos, yPos, 300-random(10, 150), 300); tint(255, random(0, 100)); image(img3.getImg(), xPos-50, yPos, 15-random(0, 15), (height*2)-random(0, height*2)); image(img3.getImg(), xPos+50, yPos, 15-random(0, 15), (height*2)-random(0, height*2)); tint(255, 255); } if (img4 == null) { img4 = list4.getImage(1); } else { tint(255, random(0, 100)-(cheatDrop/10)); imageMode(CENTER); image(img4.getImg(), xPos, yPos, 300-random(10, 150), 300); tint(255, random(0, 100)); image(img4.getImg(), xPos-50, yPos, 15-random(0, 15), (height*2)-random(0, height*2)); image(img4.getImg(), xPos+50, yPos, 15-random(0, 15), (height*2)-random(0, height*2)); tint(255, 255); image (imgMask, xPos-50, yPos, 15-random(0, 15), (height*2)-random(0, height*2)); image (imgMask, xPos+50, yPos, 15-random(0, 15), (height*2)-random(0, height*2)); tint(255, 255); } } if (counter > 100) {
counter=0;
}
if (slide==0) {
slideCount=slideCount+1;
}
if (slideCount>3) {
slide=255;
slideCount=0;
}
if (swooshCount>200) {
swoosh=1.5;
swooshCount=0;
goSwoosh=false;
cheatDrop=0;
}
if (goSwoosh) {

for (int i = 0; i<10; i++) {
noStroke();
rectMode(CENTER);
fill (0, random(10, 80));
rect(random(0, width), random(0, height), random(100, 400), random(100, 400));
rectMode(CORNER);
}
swooshCount=swooshCount+1;
if (swooshCount<100) { swoosh=swoosh+1; cheatDrop=cheatDrop+35; } if (swooshCount>100) {
swoosh=swoosh-1;
cheatDrop=cheatDrop-35;
}
}
if (pressSwitch) {
pressCount=pressCount+1;
if (pressCount<200) {
fill(255, pressFill);
textAlign(CENTER);
text (rWord1+rWord2+rWord3+rWord4+rWord5+rWord6+rWord7+rWord8+rWord9+rWord10+rWord11+rWord12+rWord13+rWord14, (width/2), (height/2)-100);
textAlign(LEFT);
if (pressCount<100) { pressFill=pressFill+3; } if (pressCount>100) {
pressFill=pressFill-3;
}
}
if (pressCount>200&&pressCount<202) { fill(255, pressFill); textAlign(CENTER); text (rWord1+rWord2+rWord3+rWord4+rWord5+rWord6+rWord7+rWord8+rWord9+rWord10+rWord11+rWord12+rWord13+rWord14, (width/2), (height/2)-100); textAlign(LEFT); background(0); pressFill=0; } if (pressCount>203) {
pressSwitch=false;
pressCount=0;
pressFill=0;
rWord1=” “;
rWord2=” “;
rWord3=” “;
rWord4=” “;
rWord5=” “;
rWord6=” “;
rWord7=” “;
rWord8=” “;
rWord9=” “;
rWord10=” “;
rWord11=” “;
rWord12=” “;
rWord13=” “;
rWord14=” “;
}
}
}

void mousePressed() {
goSwoosh=true;
pressSwitch=true;
}

void keyReleased() {

if (key==ENTER) {
passSent=passSent+1;
}
if (key==’a’ || key==’b’ ||key==’c’ ||key==’d’ ||key==’e’ ||key==’f’ ||key==’g’ ||key==’h’ ||key==’i’ ||key==’j’ ||key==’k’ ||key==’l’ ||key==’m’ ||key==’n’
||key==’o’ ||key==’p’ ||key==’q’ ||key==’r’ ||key==’s’ ||key==’t’ ||key==’u’ ||key==’v’ ||key==’w’ ||key==’x’ ||key==’y’ ||key==’z’ || key==’A’ || key==’B’
||key==’C’ ||key==’D’ ||key==’E’ ||key==’F’ ||key==’G’ ||key==’H’ ||key==’I’ ||key==’J’ ||key==’K’ ||key==’L’ ||key==’M’ ||key==’N’ ||key==’O’ ||key==’P’
||key==’Q’ ||key==’R’ ||key==’S’ ||key==’T’ ||key==’U’ ||key==’V’ ||key==’W’ ||key==’X’ ||key==’Y’ ||key==’Z’||key==’?’ ||key==’!’ ||key==’.’ ||key==’,’) {
keyCount=keyCount+1;
}
if (key==BACKSPACE) {
keyCount=keyCount-1;
}
if (key==’ ‘) {
keyCount=0;
pass=pass+1;
slide=0;
}
if (passSent==1) {
if (randWord==2) {
rWord1=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord1=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord1=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==2) {
if (randWord==2) {
rWord2=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord2=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord2=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==3) {
if (randWord==2) {
rWord3=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord3=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord3=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==4) {
if (randWord==2) {
rWord4=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord4=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord4=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==5) {
if (randWord==2) {
rWord5=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord5=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord5=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==6) {
if (randWord==2) {
rWord6=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord6=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord6=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==7) {
if (randWord==2) {
rWord7=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord7=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord7=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==8) {
if (randWord==2) {
rWord8=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord8=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord8=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==9) {
if (randWord==2) {
rWord9=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord9=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord9=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==10) {
if (randWord==2) {
rWord10=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord10=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord10=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==11) {
if (randWord==2) {
rWord11=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord11=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord11=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==12) {
if (randWord==2) {
rWord12=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord12=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord12=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==13) {
if (randWord==2) {
rWord13=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord13=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord13=cp5.get(Textfield.class, “4”).getText();
}
}
if (passSent==14) {
if (randWord==2) {
rWord14=cp5.get(Textfield.class, “2”).getText();
}
if (randWord==3) {
rWord14=cp5.get(Textfield.class, “3”).getText();
}
if (randWord==4) {
rWord14=cp5.get(Textfield.class, “4”).getText();
}
}
if (pass==0) {
cp5.get(Textfield.class, “1”).setFocus(true);
textBox=”1″;
}
if (pass==1) {
cp5.get(Textfield.class, “1”).setFocus(false);
cp5.get(Textfield.class, “2”).setFocus(true);
textBox = “2”;
}
if (key==’ ‘ && pass==2) {
cp5.get(Textfield.class, “2”).setFocus(false);
cp5.get(Textfield.class, “3”).setFocus(true);
textBox = “3”;
}
if (key==’ ‘ && pass==3) {
cp5.get(Textfield.class, “3”).setFocus(false);
cp5.get(Textfield.class, “4”).setFocus(true);
textBox = “4”;
}
if (key==’ ‘ && pass==4) {
cp5.get(Textfield.class, “4”).setFocus(false);
cp5.get(Textfield.class, “5”).setFocus(true);
textBox = “5”;
}
if (key==’ ‘ && pass==5) {
cp5.get(Textfield.class, “5”).setFocus(false);
cp5.get(Textfield.class, “6”).setFocus(true);
textBox = “6”;
}
if (key==’ ‘ && pass==6) {
cp5.get(Textfield.class, “6”).setFocus(false);
cp5.get(Textfield.class, “7”).setFocus(true);
textBox = “7”;
}
if (key==’ ‘ && pass==7) {
cp5.get(Textfield.class, “7”).setFocus(false);
cp5.get(Textfield.class, “8”).setFocus(true);
textBox = “8”;
}
if (key==’ ‘ && pass==8) {
cp5.get(Textfield.class, “8”).setFocus(false);
cp5.get(Textfield.class, “9”).setFocus(true);
textBox = “9”;
}
if (key==’ ‘ && pass==9) {
cp5.get(Textfield.class, “9”).setFocus(false);
cp5.get(Textfield.class, “10”).setFocus(true);
textBox = “10”;
}
if (key==’ ‘ && pass==10) {
cp5.get(Textfield.class, “10”).setFocus(false);
cp5.get(Textfield.class, “11”).setFocus(true);
textBox = “11”;
}
if (key==’ ‘ && pass==11) {
cp5.get(Textfield.class, “11”).setFocus(false);
cp5.get(Textfield.class, “12”).setFocus(true);
textBox = “12”;
}
if (key==’ ‘ && pass==12) {
cp5.get(Textfield.class, “12”).setFocus(false);
cp5.get(Textfield.class, “13”).setFocus(true);
textBox = “13”;
}
if (key==’ ‘ && pass==13) {
cp5.get(Textfield.class, “13”).setFocus(false);
cp5.get(Textfield.class, “14”).setFocus(true);
textBox = “14”;
}
}

Advertisements
This entry was posted in Best Work, Time-Based and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s