Commits

Anonymous committed 8d96da5

moved OSC initialization to top level

Comments (0)

Files changed (1)

engulferator04.pde

 ParticleSystem physics;
 int sndNum = 16;
 int bNum = 4;
+OscBundle myBundle = new OscBundle();
+OscMessage myMessage = new OscMessage("/test");
 
 float[] bx = new float[bNum];
 float[] by = new float[bNum];
 
   for (int i=0; i<sndNum; i++) {
     handleBoundaryCollisions( snd[i] );
-    sendOSC();
+    sendOSC(i);
   }
 
   fill( 200);
   }
 
   physics.tick(0.5);
+  
+  //println( snd[1].position().x());
+  //println( snd[1].position().y());
 }
 
 
     p.position().set(random(width), 0, 0);
 }
 
-void sendOSC() {
-  OscBundle myBundle = new OscBundle();
-  OscMessage myMessage = new OscMessage("/test");
-  for (int i=0; i<sndNum; i++){
+void sendOSC(int i) {
     myMessage.add(snd[i].position().x());
     myBundle.add(myMessage);
     myMessage.clear();
     myBundle.add(myMessage);
     oscP5.send(myBundle, processLocation);
     myBundle.clear();
-  }    
+
 }