Skip to content

Instantly share code, notes, and snippets.

@ihearmoth
Created August 12, 2017 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihearmoth/f798aed7aeab802b3b27bcdea66d1ccc to your computer and use it in GitHub Desktop.
Save ihearmoth/f798aed7aeab802b3b27bcdea66d1ccc to your computer and use it in GitHub Desktop.
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