Init new objec from Class via OSCp5

Hello.

Some time ago I am trying to create and destroy objects of classes and modify some of its parameters via OSC messages. I tried it with ArrayLists with controlEvents GUI and it works, but there is no way with OSC.

I made this supermegasimple code if someone wants to implement a solution inside:

import oscP5.*;
import netP5.*;

OscP5 oscP5;
NetAddress myRemoteLocation;

circle obj1;

void setup()
{
  size(800,600);
  oscP5 = new OscP5(this,12000);
}

void draw()
{
  background(0);
}

void oscEvent(final OscMessage theOscMessage) {
    if(theOscMessage.checkAddrPattern("/circle")==true) {
     if(theOscMessage.checkTypetag("i")) { 
       // /circle name create a circle with this name
       // /circle name erase destroy this circle
     }
    }
}

class circle {
  circle(){}
  void display(){
    ellipse(10,10,50,50);
  }
}

Thanks!

Sign In or Register to comment.