Processing
Autor: Lívia Morais | Publicado: 2009-06-30T19:54:00-07:00

Conforme consta no caderno técnico individual da intervenção, aqui está o código fonte do processing:import fullscreen.*;import processing.net.*; import ddf.minim.*;import ddf.minim.signals.*;Client cl; int inString;String data;int y;FullScreen fs;Minim minim;AudioSnippet sn;AudioSnippet sn2;AudioSnippet sn3;AudioSnippet sn4;AudioSnippet sn5;AudioSnippet sn6;AudioSnippet sn7;AudioSnippet sn8;AudioSnippet sn9;AudioSnippet sn10;AudioSnippet sn11;AudioSnippet sn12;AudioSnippet sn13;AudioSnippet sn14;AudioSnippet sn15;AudioSnippet sn16;AudioSnippet sn17;AudioSnippet sn18;AudioSnippet sn19;AudioSnippet sn20;int x=0;PImage b;PImage f;PImage g;PImage h;PImage i;PImage j;PImage k;PImage l;PImage m;PImage n;PImage el;float c;float al;int d;float e;float v;void setup(){  size(1024,768);background(255);cl = new Client(this, "150.164.107.40", 5204);fs = new FullScreen(this); fs.enter(); minim = new Minim(this);sn = minim.loadSnippet("1.1.mp3");sn.loop();sn2 = minim.loadSnippet("1.2.mp3");sn2.loop();sn3 = minim.loadSnippet("2.1.mp3");sn4 = minim.loadSnippet("2.2.mp3");sn5 = minim.loadSnippet("3.1.mp3");sn6 = minim.loadSnippet("3.2.mp3");sn7 = minim.loadSnippet("4.1.mp3");sn8 = minim.loadSnippet("4.2.mp3");sn9 = minim.loadSnippet("5.1.mp3");sn10 = minim.loadSnippet("5.2.mp3");sn11 = minim.loadSnippet("6.1.mp3");sn12 = minim.loadSnippet("6.2.mp3");sn13 = minim.loadSnippet("7.1.mp3");sn14 = minim.loadSnippet("7.2.mp3");sn15 = minim.loadSnippet("8.1.mp3");sn16 = minim.loadSnippet("8.2.mp3");sn17 = minim.loadSnippet("9.1.mp3");sn18 = minim.loadSnippet("9.2.mp3");sn19 = minim.loadSnippet("10.1.mp3");sn20 = minim.loadSnippet("10.2.mp3");b = loadImage("1.JPG");f = loadImage("2.JPG");g = loadImage("3.jpg");h = loadImage("4.jpg");i = loadImage("5.jpg");j = loadImage("6.jpg");k = loadImage("7.jpg");l= loadImage("8.jpg");m = loadImage("9.jpg");n = loadImage("10.jpg");el = loadImage("elevador.png");   }void mouseClicked(){if(x<=8){x++;  }else {    x=0;  }}void draw(){if (keyPressed) {if (key == 'e'  key == 'E') {c=1.9;e=6;d=255;    }else if (key == 'd'  key == 'D') {c=1.6;e=2;d=200;    }else if (key == 'c'  key == 'C') {c=1.3;e=0;d=175;    }else if (key == 'r'  key == 'R') {c=1;e=-5;d=90;      }else if (key == 'f'  key == 'F') {d=0;e=-10;    }else if (key == 'v'  key == 'V') {d=75;e=-15;    }else if (key == '5'  key == '%') {c=1;d=75;e=-20;    }else if (key == 'u'  key == 'U') {al=1;d=170;v=-20;    }else if (key == 'j'  key == 'J') {al=1.3;v=-15;    }else if (key == 'm'  key == 'M') {al=1.6;d=255;v=-10;    }else if (key == '6'  key == '¨') {al=1.9;d=175;v=-3;     }else if (key == 'i'  key == 'I') {d=75;v=2;      }else if (key == 'k'  key == 'K') {d=0;v=6; }}sn.setGain(v);sn3.setGain(v);sn5.setGain(v);sn7.setGain(v);sn9.setGain(v);sn11.setGain(v);sn13.setGain(v);sn15.setGain(v);sn17.setGain(v);sn19.setGain(v);sn2.setGain(e);sn4.setGain(e);sn6.setGain(e);sn8.setGain(e);sn10.setGain(e);sn12.setGain(e);sn14.setGain(e);sn16.setGain(e);sn18.setGain(e);sn20.setGain(e);sn.setBalance(1);sn3.setBalance(1);sn5.setBalance(1);sn7.setBalance(1);sn9.setBalance(1);sn11.setBalance(1);sn13.setBalance(1);sn15.setBalance(1);sn17.setBalance(1);sn19.setBalance(1);sn2.setBalance(-1);sn4.setBalance(-1);sn6.setBalance(-1);sn8.setBalance(-1);sn10.setBalance(-1);sn12.setBalance(-1);sn14.setBalance(-1);sn16.setBalance(-1);sn18.setBalance(-1);sn20.setBalance(-1);fill(255,d,0);rect(0,0,width,height);imageMode(CENTER);tint(255, d,0); if (x==0) {sn19.pause();sn20.pause();sn3.loop();sn4.loop();image(b, width/2, height/2,b.width*c,b.height*al);}else if(x==1){sn.pause();sn2.pause();sn5.loop();sn6.loop();image(f, width/2, height/2,f.width*c,f.height*al);}else if(x==2){sn3.pause();sn4.pause();sn7.loop();sn8.loop();image(g, width/2, height/2,g.width*c,g.height*al);}else if(x==3){sn5.pause();sn6.pause();sn9.loop();sn10.loop();image(h, width/2, height/2,h.width*c,h.height*al);}else if(x==4){sn7.pause();sn8.pause();sn11.loop();sn12.loop();image(i, width/2, height/2,i.width*c,i.height*al);}else if(x==5){sn9.pause();sn10.pause();sn13.loop();sn14.loop();image(j, width/2, height/2,j.width*c,j.height*al);}else if(x==6){sn11.pause();sn12.pause();sn15.loop();sn16.loop();image(k, width/2, height/2,k.width*c,k.height*al);}else if(x==7){sn13.pause();sn14.pause();sn17.loop();sn18.loop();image(l, width/2, height/2,l.width*c,l.height*al);}else if(x==8){sn15.pause();sn16.pause();sn19.loop();sn20.loop();image(m, width/2, height/2,m.width*c,m.height*al);}else if(x==9){sn17.pause();sn18.pause();sn.loop();sn2.loop();image(n, width/2, height/2,n.width*c,n.height*al);}if (y==1){image(el,width/2,height/2);}else {if (x==0) {image(b, width/2, height/2,b.width*c,b.height*al);}else if(x==1){image(f, width/2, height/2,f.width*c,f.height*al);}else if(x==2){image(g, width/2, height/2,g.width*c,g.height*al);}else if(x==3){image(h, width/2, height/2,h.width*c,h.height*al);}else if(x==4){image(i, width/2, height/2,i.width*c,i.height*al);}else if(x==5){image(j, width/2, height/2,j.width*c,j.height*al);}else if(x==6){image(k, width/2, height/2,k.width*c,k.height*al);}else if(x==7){image(l, width/2, height/2,l.width*c,l.height*al);}else if(x==8){image(m, width/2, height/2,m.width*c,m.height*al);}else if(x==9){image(n, width/2, height/2,n.width*c,n.height*al);}}if (cl.available() > 0) { inString = cl.read();println(inString);if(inString==50){y=1;v=6;e=6;       }else if (inString==100){y=2;e=-13;v=-13;    }}}