Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
An interactive installation piece that has generates poetry about water every time you dip a spoon in it.  Made with Processing and Makey Makey
String[] s= {
" constituent of",
" transparent",
" fluid",
" which form",
" the world's",
" stream",
" lake",
" ocean",
" rain",
" is",
" molecule contains",
" oxygen and two",
" hydrogen atoms in ",
" connected by",
" covalent bonds",
" is a liquid",
" gaseous state",
" steam",
" vapor",
" snow",
" fog",
" has no calories",
" essential to",
" as a solvent",
" evaluate potability",
" evaporation",
" transpiration",
" precipitation",
" refract",
" drought",
" irrigation",
" flood",
" fundamental to",
" greywater",
" sanitation",
" sinks",
" showers",
" dehydration",
" is a huge waterfall",
};
String ad = " ";
int fade = 255;
int ran1,ran2;
void setup(){
size ( displayWidth, displayHeight);
sketchFullScreen();
PFont font;
// The font must be located in the sketch's
// "data" directory to load successfully
font = createFont("Georgia", 32);
textFont(font);
frameRate(32);
}
void draw(){
background(0);
fill(255,255,255,fade);
pushMatrix();
translate(width/2, height/2);
//rotate(PI);
ran1 = int(random(0,37));
ran2 = int(random(0,39));
//tad = s[ran1]+s[ran2];
text(ad,0,0);
popMatrix();
fade=fade-2;
}
void keyPressed() {
switch(keyCode) {
case UP:
ran1 = int(random(0,37));
ran2 = int(random(0,39));
ad = s[ran1]+s[ran2];
fade = 255;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment