We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
OSC in processing (Read 8717 times)
OSC in processing
Oct 30th, 2005, 2:11pm
 
Hi,

I have not seen anything in the forum about this, (but I only flicked through, so please excuse me if there is already something about this) and I would like to know, whether it is possible to send OSC to processing and how, or, alternatively, if there are plans to implement it. I would see this definitely as a must, so one can make music/live coding with processing.

Karsten
Re: OSC in processing
Reply #1 - Oct 30th, 2005, 2:35pm
 
Andreas Schlegel has written the oscP5 library for OSC from Processing. It's definitely in the forum, try "search"...
Re: OSC in processing
Reply #2 - Oct 30th, 2005, 6:43pm
 
Check out the Libraries for extensions to Processing:
http://processing.org/reference/libraries/
Re: OSC in processing
Reply #3 - Nov 5th, 2005, 1:57pm
 
Did someone test the osc library under 0.93/0.95 ? Here on Mac OsX (10.3.9) osc is just working under version 0.91.
g stefan
Re: OSC in processing
Reply #4 - Nov 6th, 2005, 1:47am
 
Same happens with BlobDetection :\ only works in 0091
Re: OSC in processing
Reply #5 - Nov 7th, 2005, 6:04pm
 
hi acady,
i just did a test on osx 10.3.9 with oscP5 running processing 0095 beta and sending/receiving worked for me. i tested with processing and supercollider. is it giving you errors or does it just not work?
Re: OSC in processing
Reply #6 - Nov 7th, 2005, 7:25pm
 
just not working, no errors. The intresting thing is, that no java window is opening.
Re: OSC in processing
Reply #7 - Nov 7th, 2005, 8:42pm
 
hm,
do you have the draw() method in your sketch?
can you post code?
Re: OSC in processing
Reply #8 - Nov 8th, 2005, 3:41am
 
if it's broken in 91 but working in 90 it may be this issue:
http://dev.processing.org/bugs/show_bug.cgi?id=46

but if it broke in 95 (or 92+) that might be something else...
Re: OSC in processing
Reply #9 - Nov 8th, 2005, 9:35am
 
Finally, i got it, now this code works in all versions. I think by going not that deep inside right now, the problem is somewhere between simpleOSCMessage and the version with the object.

//the code
import osc.*;
import oscP5.*;
// oscP5 instance for the osc communication
OscP5 oscP5;
int receiveAtPort;
int sendToPort;
String host;
String oscP5event;

void initOsc() {
       receiveAtPort = 12500;
       //sendToPort = 57120;
       sendToPort = 12000;
       host = "127.0.0.1";
       oscP5event = "oscEvent";
       oscP5 = new OscP5(
               this,
               host,
               sendToPort,
               receiveAtPort,
               oscP5event
               );
     mouseMoved();

}


void oscEvent(OscIn oscIn) {
       println("received ...");
}



void setup(){
       background(0);
       size(400, 400);  
       initOsc();

}

void draw()
{
 background(204);
 line(mouseX, 20, mouseX, 80);
}

void mouseMoved() {
OscMessage oscMsg = oscP5.newMsg("/test");
Object[] mObj;
       mObj = new Object[] {new Integer(12), new Float(34.55), "meins"};
String mousePos = str(mouseX);
oscP5.sendMsg(mousePos,mObj);
}
Re: OSC in processing
Reply #10 - Dec 5th, 2005, 11:18pm
 
man thank god for this discourse. I was in a crunch but thanks to your code I think I managed to figure things out.

With P91 you will get an io exception from SendMsg() when you try to send a message without the second parameter, so the example needs to be updated to reflect this..

thanks again
Page Index Toggle Pages: 1