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 library missing! (Read 1394 times)
OSC library missing!
Apr 24th, 2008, 7:19pm
 
Hi, I´m trying to connect Processing with SuperCollider using the tutorial posted in this page:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1133669730;start=0#1

The problem is, when I try to run the processing code a message like this apear at the console:
You need to modify your classpath,sourcepath, bootclasspath, and/or extdirs setup. Jikes could not find package"osc" in the code folder or in any libraries.

well I´ve already installed the oscP5 library in the sketchfolder as its creator website says, but I can´t find any library to download an place in the library section of Processing. (which i think is causing the error at running)

So, could anybody give me a clue, where to get this library or how to make the communication between SC and Processing working fine?

tnx

owomo
Re: OSC library missing!
Reply #1 - Apr 24th, 2008, 8:37pm
 
I might have just misread your post, but have you got the oscP5 library download in the libraries folder? It sounds like you've put it in the actual sketch folder.
Re: OSC library missing!
Reply #2 - Apr 24th, 2008, 10:02pm
 
Tnx for asnwering so fast, and no, you have read good. I´ve place the oscP5 lib  there cause that is what  the instruction says at the website i downloaded it.

http://www.sojamo.de/libraries/oscP5/

Actually the second thing i did, after thinking locical, was to place it at the library folder but i got the same result message from the console...that OSC library is missing.

Do you know what could be the possible failure?
Re: OSC library missing!
Reply #3 - Apr 25th, 2008, 5:55am
 
hi,
did you restart processing after putting the library into the sketches or libraries folder if not, does closing and reopening processing help processing will recognize a new library after it has been added to the libraries or sketches folder only after a restart of the processing application.

still getting erros, then:
your error message says, could not find package"osc". in reply #7 of the post you are referring to in the above it says,

set 'import osc.*' to 'import netP5.*'

does that fix the problem

besides that, there is a supercollider to sc library that can be found in the libraries section or directly at daniel jones' supercollider for processing website.
best,
andi

Re: OSC library missing!
Reply #4 - May 6th, 2008, 4:12am
 
hi,
thank you so much for the support, I´ve already applied the solutions you post for this problem problem, but still looks like the osc library is still missing. I´ve changed the sketch folder to the maind processing folder in Applications and back to my documents folder and restarted processing and nothing changes in the error message. Also tried to replace (with import netP5.*Wink and even deleted the import osc.*; instruction but then it sends me to this link over the internet file://localhost/Applications/Processing%200135/reference/changes.html
So, do you have any other suggestion?, I would really like to see how this to progams could work togheter...I´d appreciate very much you attendance.

ow
Re: OSC library missing!
Reply #5 - May 6th, 2008, 6:37am
 
hi,
i assume you were directed to the changes page because you are using code that has been changed since version 116 e.g. framerate() has been changed to frameRate(). all the syntax changes are described on this page, in case you are looking for more detailed explanations.

since you got directed to the changes page, the import of oscP5 and netP5 was successful, meaning the library was found by processing, hence the following code should work for you.


Code:

import oscP5.*;
import netP5.*;

OscP5 oscP5;

NetAddress myRemoteLocation;

void setup() {
size(400,400);
frameRate(25);
oscP5 = new OscP5(this,12000);
myRemoteLocation = new NetAddress("127.0.0.1",12000);
}

void draw() {
background(0);
}

void mousePressed() {
OscMessage myOscMessage = new OscMessage("/test");
myOscMessage.add(mouseX);
oscP5.send(myOscMessage, myRemoteLocation);
}


// incoming osc message are forwarded to the oscEvent method.
void oscEvent(OscMessage theOscMessage) {
theOscMessage.print();
}




by clicking onto the black background you should see
Quote:
-OscMessage----------
received from
/127.0.0.1:49279
addrpattern
/test
typetag
i
[0] 100
---------------------


if so, from here you can now start implementing your code to get processing to talk to supercollider and vice versa.

to communicate with supercollider i recommend daniel jones' sc_p5 library.

if you are looking for a more raw solution, here is a simple supercollider example that can be controlled from processing. take the above processing code and change the port number (12000) of  myRemoteLocation to 57120

myRemoteLocation = new NetAddress("127.0.0.1",57120);

Code:

// supercollider code.
// create an OSC listener
(
o = OSCresponder(nil,'/test', {arg time, responder, msg, addr;
[addr.addr, addr.port].postln;
msg.postln;
x.set(\freq,msg[1]);
}).add;
)

// start the local server
Server.local.boot;


// create a synthDef that plays a pure sine wave.
x = SynthDef(\sine, {arg freq=400; Out.ar(1,SinOsc.ar(freq))}).play;


Re: OSC library missing!
Reply #6 - May 6th, 2008, 8:22am
 
wow! Shocked IT WORKS!
Thank you so much! Now everything is clear. Cheesy

all the best dude! you rule!
Page Index Toggle Pages: 1