Commits

Jim  committed c0f4d94

converted OSC messages to array

  • Participants
  • Parent commits 8d96da5

Comments (0)

Files changed (1)

File engulferator04.pde

 ParticleSystem physics;
 int sndNum = 16;
 int bNum = 4;
-OscBundle myBundle = new OscBundle();
-OscMessage myMessage = new OscMessage("/test");
+// OscBundle myBundle = new OscBundle();
+OscMessage[] sndPos = new OscMessage[sndNum];
 
 float[] bx = new float[bNum];
 float[] by = new float[bNum];
   snd = new Particle[sndNum];
   for (int i=0; i<sndNum; i++) {
     snd[i] = physics.makeParticle( 1.0, random( 0, width+10 ), random( 0, height+50 ), 0 );
+    sndPos[i] = new OscMessage["/"+i];
   }
   for(int i=0; i<sndNum; i++) {
     for (int j=0; j<sndNum; j++) {
 
   physics.tick(0.5);
   
-  //println( snd[1].position().x());
-  //println( snd[1].position().y());
+//  println( snd[1].position().x());
+//  println( snd[1].position().y());
 }
 
 
 }
 
 void sendOSC(int i) {
-    myMessage.add(snd[i].position().x());
-    myBundle.add(myMessage);
-    myMessage.clear();
-    myMessage.add(snd[i].position().y());
-    myBundle.add(myMessage);
-    oscP5.send(myBundle, processLocation);
-    myBundle.clear();
+    sndPos[i].add(snd[i].position().x());
+    //myBundle.add(myMessage);
+    //myMessage.clear();
+    sndPos[i].add(snd[i].position().y());
+    //myBundle.add(myMessage);
+    oscP5.send(sndPos[i], processLocation);
+    //myBundle.clear();
 
 }