beginner tut Max -> OSC -> Processing

ash's icon

Hi all,

I've documented my first attempt at using OSC communication between Max and Processing here: http://www.conceptualinertia.net/aoakenfo/sketch-1

I hope it helps other beginners out there.

Regards.

Liang's icon

even though it was posted 4 years ago, it really does work.

vista's icon

Hello,

I seem to be having some trouble.

Been working with the example ASH posted http://www.conceptualinertia.net/aoakenfo/sketch-1

When I copy-paste the finished example, everything works smoothly. But there is a little bit too much going on with the processing side of the code for me to know exactly where I should pull from to create the building blocks of my own Max~Processing OSC communication project.

So naturally, I am trying to start from square one, with the first portion of the example, where the goal is to simply send the message '42' via the /foo prepend. For some reason it's not working for me.

The console reads:

### [2015/5/29 2:5:41] PROCESS @ OscP5 stopped.
### [2015/5/29 2:5:41] PROCESS @ UdpClient.openSocket udp socket initialized.
### [2015/5/29 2:5:42] PROCESS @ UdpServer.start() new Unicast DatagramSocket created @ port 8080
### [2015/5/29 2:5:42] PROCESS @ UdpServer.run() UdpServer is running @ 8080
### [2015/5/29 2:5:42] INFO @ OscP5 is running. you (192.168.0.7) are listening @ port 8080
### [2015/5/29 2:5:42] PROCESS @ OscPlug plugging class sketch_150529b | addrPattern:/foo typetag:i method:foo
OscP5 0.9.9 infos, comments, questions at http://www.sojamo.de/oscP5

### [2015/5/29 2:5:42] PROCESS @ OscP5 stopped.
### [2015/5/29 2:5:42] PROCESS @ UdpClient.openSocket udp socket initialized.
### [2015/5/29 2:5:43] ERROR @ UdpServer.start() IOException, couldnt create new DatagramSocket @ port 8080 java.net.BindException: Address already in use
### [2015/5/29 2:5:43] INFO @ OscP5 is running. you (192.168.0.7) are listening @ port 8080
### [2015/5/29 2:5:43] PROCESS @ OscP5 stopped.
### [2015/5/29 2:5:43] PROCESS @ OscP5 stopped.
### [2015/5/29 2:5:43] PROCESS @ UdpServer.run() socket closed.

________________________________________________________________________________________
This is my source code

import oscP5.*;
import netP5.*;

OscP5 oscP5;
NetAddress myRemoteLocation;

void setup() {
size(400,400);
frameRate(25);

initOsc();

oscP5 = new OscP5(this,8080);
myRemoteLocation = new NetAddress("127.0.0.1",8080);
}

void initOsc(){
oscP5 = new OscP5(this, 8080);
myRemoteLocation = new NetAddress("127.0.0.1", 8080);
oscP5.plug(this, "foo", "/foo");
}

public void foo(int value){
println("int received! =" + value);
}

___________________________________________________________________________________

along with the v simple max patch

I have tried restarting, changing the ip, changing the port, all to which returns the same results. I have also looked at the send receive example in the oscP5 but to no avail. Comparing my source code with the finished example source code and nothing jumps out. I know that OSC communication works with my setup because both the finished example from ASH and the oscP5sendreceive example work.

What the dingus is happening?

Thanks for any and all help!!!

mzed's icon

I answered this question on a different thread. It's probably cleaner to ask your question in one, new thread -- with links -- rather than in multiple places.