Yun Jeong Bae processing and Pd code for Conductor.

Here is a peek at the processing and Pd code of Yun's "Conductor" piece.


import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress myRemoteLocation;
 
import processing.serial.*;
Serial port;
String thedata;
 
import processing.video.*;
Movie myMovie;
 
OscMessage oscMess1, oscMess2, oscMess3, oscMess4,oscMess5, oscMess6, oscMess7, oscMess8,
           oscMess9, oscMess10, oscMess11, oscMess12, oscMess13, oscMess14, oscMess15,
           oscMess16, oscMess17, oscMess18, oscMess19, oscMess20, oscMess21, oscMess22,
           oscMess23, oscMess24;
 
 
PImage Kid1;
PImage Kid2;
PImage Kid3;
PImage Kid4;
PImage Kid5;
PImage Kid6;
PImage Kid7;
PImage Kid8;
PImage Kid9;
PImage Kid10;
PImage Kid11;
PImage Kid12;
PImage Kid13;
PImage Kid14;
PImage Kid15;
PImage Kid16;
PImage Kid17;
PImage Kid18;
PImage Kid19;
PImage Kid20;
PImage Kid21;
PImage Kid22;
PImage Kid23;
PImage Kid24;
 
int i;
int t;
int y;
 
int byte_a;
int byte_b;
int byte_c;
int foo;
 
boolean block1 = false;
boolean block2 = false;
boolean block3 = false;
boolean block4 = false;
boolean block5 = false;
boolean block6 = false;
boolean block7 = false;
boolean block8 = false;
boolean block9 = false;
boolean block10 = false;
boolean block11 = false;
boolean block12 = false;
boolean block13 = false;
boolean block14 = false;
boolean block15 = false;
boolean block16 = false;
boolean block17 = false;
boolean block18 = false;
boolean block19 = false;
boolean block20 = false;
boolean block21 = false;
boolean block22 = false;
boolean block23 = false;
boolean block24 = false;
 
 
void setup() {
  size(1024,768, P3D);
  background(0);
  frameRate(30);
  println(Serial.list());
  port = new Serial(this, Serial.list()[0], 115200);
 
  oscP5 = new OscP5(this, 12000);
  myRemoteLocation = new NetAddress("127.0.0.1", 12000);
  //oscP5.plug(this,"test","/test");
 
  myMovie = new Movie(this, "landscape.mov");
  myMovie.loop();
  myMovie.read();
 
  oscMess1 = new OscMessage("/d1");
  oscMess2 = new OscMessage("/d2");
  oscMess3 = new OscMessage("/d3");
  oscMess4 = new OscMessage("/d4");
  oscMess5 = new OscMessage("/d5");
  oscMess6 = new OscMessage("/d6");
  oscMess7 = new OscMessage("/d7");
  oscMess8 = new OscMessage("/d8");
  oscMess9 = new OscMessage("/d9");
  oscMess10 = new OscMessage("/d10");
  oscMess11 = new OscMessage("/d11");
  oscMess12 = new OscMessage("/d12");
  oscMess13 = new OscMessage("/d13");
  oscMess14 = new OscMessage("/d14");
  oscMess15 = new OscMessage("/d15");
  oscMess16 = new OscMessage("/d16");
  oscMess17 = new OscMessage("/d17");
  oscMess18 = new OscMessage("/d18");
  oscMess19 = new OscMessage("/d19");
  oscMess20 = new OscMessage("/d20");
  oscMess21 = new OscMessage("/d21");
  oscMess22 = new OscMessage("/d22");
  oscMess23 = new OscMessage("/d23");
  oscMess24 = new OscMessage("/d24");
 
 
  Kid1 = loadImage("kid1.png");
  Kid2 = loadImage("fuck2.png");
  Kid3 = loadImage("kid3.png");
  Kid4 = loadImage("fuck4.png");
  Kid5 = loadImage("kid5.png");
  Kid6 = loadImage("fuck6.png");
  Kid7 = loadImage("kid7.png");
  Kid8 = loadImage("fuck8.png");
  Kid9 = loadImage("kid9.png");
  Kid10 = loadImage("kid10.png");
  Kid11 = loadImage("kid11.png");
  Kid12 = loadImage("fuck12.png");
  Kid13 = loadImage("kid13.png");
  Kid14 = loadImage("fuck14.png");
  Kid15 = loadImage("kid15.png");
  Kid21 = loadImage("fuck21.png");
  Kid16 = loadImage("fuck16.png");
  Kid17 = loadImage("fuck17.png");
  Kid18 = loadImage("fuck18.png");
  Kid19 = loadImage("fuck19.png");
  Kid20 = loadImage("fuck20.png");
  Kid21 = loadImage("fuck21.png");
  Kid22 = loadImage("fuck22.png");
  Kid23 = loadImage("fuck23.png");
  Kid24 = loadImage("fuck24.png");
 
 
  println("foo.");
 
}
 
 
int getnumeric(int delimiter){
  int timeout_endval = 100; // timeout thresh in millisec
  int timeout_count = 0;
  int result = 0;
  char asciival;
  while(port.available() < 1);
  double t;
  t=millis();
  boolean done=false;
  while (!done)
  {
    if (port.available() > 0)
    {
      asciival = (char) port.read();
      //println("asciival "+asciival);
      if ((asciival >='0') && (asciival <='9')){ //discard bogus
        thedata += asciival;
      }
      else{
 
        if (asciival == delimiter){
          result = parseInt(thedata);
          thedata="";
          done=true;
        }
        else{        
          print("\nP5 err="+asciival+"\n");
        }
      }        
 
    }
    if (millis()>t+100)
    {
     done=true;
     return 0;
    }
  }
 
  return result;
}
 
 
void draw() {
    image(myMovie,0,0);
 
    port.write("!Ab;");
    byte_a = getnumeric('\n');
    //println("byte_a "+ byte_a);
 
 
    foo = byte_a & 0x01;
    if (foo != 0){
      if(block1 == false){
      //println ("d1 \n");  
      oscMess1.add(0);
      block1 = true; 
      oscP5.send(oscMess1, myRemoteLocation);     
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      }
      image(Kid1,690,209);
    }
    else{
      block1 = false;
    }
 
 
    foo = byte_a & 0x02;
    if (foo != 0){
      if(block2 == false){
      //println ("d2 \n");
      block2 = true; 
      oscMess2.add(0);
      oscP5.send(oscMess2, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      }      
      image(Kid2,432,139);
    }
    else{
      block2 = false;
    }
 
 
    foo = byte_a & 0x04;
    if (foo != 0){
      if(block3 == false){
      //println ("d3 \n");
      block3 = true; 
      oscMess3.add(0);
      oscP5.send(oscMess3, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
         }
      image(Kid3,0,110);
    }
    else{
      block3 = false;
    }
 
 
    foo = byte_a & 0x08;
    if (foo != 0){
      if(block4 == false){
      //println ("d4 \n");
      block4 = true; 
      oscMess4.add(0);
      oscP5.send(oscMess4, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid4,460,57);
    }
    else{
      block4 = false;
    }
 
 
    foo = byte_a & 0x10;
    if (foo != 0){
      if(block5 == false){
      //println ("d5 \n");
      block5 = true; 
      oscMess5.add(0);
      oscP5.send(oscMess5, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid5,204,410);
    }
    else{
      block5 = false;
    }
 
 
   foo = byte_a & 0x20;
   if (foo != 0){
      if(block6 == false){
      //println ("d6 \n");
      block6 = true; 
      oscMess6.add(0);
      oscP5.send(oscMess6, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid6,485,150);
    }
    else{
      block6 = false;
    }
 
 
   foo = byte_a & 0x40;
   if (foo != 0){
      if(block7 == false){
      //println ("d7 \n");
      block7 = true; 
      oscMess7.add(0);
      oscP5.send(oscMess7, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid7,105,315);
    }
    else{
      block7 = false;
    }
 
 
   foo = byte_a & 0x80;
   if (foo != 0){
      if(block8 == false){
      //println ("d8 \n");
      block8 = true; 
      oscMess8.add(0);
      oscP5.send(oscMess8, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid8,755,57);
    }
    else{
      block8 = false;
    }
 
 
 
 
  port.write("!Bb;");
  byte_b = getnumeric('\n');
  //println("byte_b "+ byte_b);
 
   foo = byte_b & 0x01;
   if (foo != 0){
      if(block9 == false){
      //println ("d9 \n");
      block9 = true; 
      oscMess9.add(0);
      oscP5.send(oscMess9, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid9,810,530);
    }
    else{
      block9 = false;
    }
 
 
   foo = byte_b & 0x02;    
   if (foo != 0){
      if(block10 == false){
      //println ("d10 \n");
      block10 = true; 
      oscMess10.add(0);
      oscP5.send(oscMess10, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid10,403,268);
    }
    else{
      block10 = false;
    }   
 
 
   foo = byte_b & 0x04;
   if (foo != 0){
      if(block11 == false){
      //println ("d11 \n");
      block11 = true; 
      oscMess11.add(0);
      oscP5.send(oscMess11, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid11,222,163);
    }
    else{
      block11 = false;
    }     
 
 
   foo = byte_b & 0x08;  
   if (foo != 0){
      if(block12 == false){
      //println ("d12 \n");
      block12 = true; 
      oscMess12.add(0);
      oscP5.send(oscMess12, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid12,80,0);
    }
    else{
      block12 = false;
    }     
 
 
   foo = byte_b & 0x10;    
   if (foo != 0){
      if(block13 == false){
      //println ("d13 \n");
      block13 = true; 
      oscMess13.add(0);
      oscP5.send(oscMess13, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid13,747,410);
    }
    else{
      block13 = false;
    }     
 
 
   foo = byte_b & 0x20;    
   if (foo != 0){
      if(block14 == false){
      //println ("d14 \n");
      block14 = true; 
      oscMess14.add(0);
      oscP5.send(oscMess14, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid14,800,200);
    }
    else{
      block14 = false;
    }     
 
 
   foo = byte_b & 0x40;   
   if (foo != 0){
      if(block15 == false){
      //println ("d15 \n");
      block15 = true; 
      oscMess15.add(0);
      oscP5.send(oscMess15, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid15,576,315);
    }
    else{
      block15 = false;
    }       
 
 
   foo = byte_b & 0x80; 
   if (foo != 0){
      if(block16 == false){
      //println ("d16 \n");
      block16 = true; 
      oscMess16.add(0);
      oscP5.send(oscMess16, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid16,40,485);
    }
    else{
      block16 = false;
    }         
 
 
 
  port.write("!Cb;");
  byte_c = getnumeric('\n');
  //println("byte_c "+ byte_c); 
 
 
   foo = byte_c & 0x01;
   if (foo != 0){
      if(block17 == false){
      //println ("d17 \n");
      block17 = true; 
      oscMess17.add(0);
      oscP5.send(oscMess17, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid17,930,19);
    }
    else{
      block17 = false;
    }         
 
 
   foo = byte_c & 0x02;
   if (foo != 0){
      if(block18 == false){
      //println ("d18 \n");
      block18 = true; 
      oscMess18.add(0);
      oscP5.send(oscMess18, myRemoteLocation);      
       }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
       image(Kid18,366,455);
     }
    else{
      block18 = false;
    }         
 
   foo = byte_c & 0x04;   
   if (foo != 0){
      if(block19 == false){
      //println ("d19 \n");
      block19 = true; 
      oscMess19.add(0);
      oscP5.send(oscMess19, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid19,155,590);
    }
    else{
      block19 = false;
    }         
 
 
    foo = byte_c & 0x08;
    if (foo != 0){
      if(block20 == false){
      //println ("d20 \n");
      block20 = true; 
      oscMess20.add(0);
      oscP5.send(oscMess20, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid20,500,533);
    }
    else{
      block20 = false;
    }         
 
 
   foo = byte_c & 0x10;
   if (foo != 0){
      if(block21 == false){
      //println ("d21 \n");
      block21 = true; 
      oscMess21.add(0);
      oscP5.send(oscMess21, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid21,620,510);
    }
    else{
      block21 = false;
    }            
 
 
   foo = byte_c & 0x20;
   if (foo != 0){
      if(block22 == false){
      //println ("d22 \n");
      block22 = true; 
      oscMess22.add(0);
      oscP5.send(oscMess22, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid22,673,16);
    }
    else{
      block22 = false;
    }          
 
 
   foo = byte_c & 0x40;
   if (foo != 0){
      if(block23 == false){
      //println ("d23 \n");
      block23 = true; 
      oscMess23.add(0);
      oscP5.send(oscMess23, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid23,875,327);
    }
    else{
      block23 = false;
    }          
 
 
   foo = byte_c & 0x80;    
   if (foo != 0){
      if(block24 == false){
      //println ("d24 \n");
      block24 = true; 
      oscMess24.add(0);
      oscP5.send(oscMess24, myRemoteLocation);      
      }
      tint(255,t);
      t = t + 30;
      if(t>200){
         t=200;
      } 
      image(Kid24,318,282);
    }
    else{
      block24 = false;
    }          
 
 
}
 
 
 
void movieEvent(Movie myMovie) {
  myMovie.read();
}
 

  

Video documentation of "Conductor", second rendition link.

Detail of the animated faces link.

AttachmentSize
CodeYun.png29.26 KB
PdYun.png161.56 KB