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.
IndexProgramming Questions & HelpSound,  Music Libraries › oscp5 library on linux
Page Index Toggle Pages: 1
oscp5 library on linux (Read 1723 times)
oscp5 library on linux
May 1st, 2010, 7:47pm
 
Hi there,

I have been experimenting with osc and my NDS. I used fudiKaosDs but also other http://dsmi.tobw.net/ to DSMI Nds application  try to connect with Processing trough OSC.

When observing the network trough a tcpdump I get the connection information - i see the IP of my NDS - the port 1234 - UDP the lenght 15 - so the computer and the NDS seems to be talking fine.

I tried to create a minimal sketch just to see if oscp5 would 'hear' UDP port 1234 with this code :

Quote:
import oscP5.*;
import netP5.*;

OscP5 oscP5;

void setup() {
  size(400,400);
  frameRate(25);
 //port 1234 udp is where FUDIKaosDs send the osc information
  oscP5 = new OscP5(this,1234);
}


void draw() {
  background(0);
}

void oscEvent(OscMessage theOscMessage) {
  println("### received an osc message with addrpattern "+theOscMessage.addrPattern()+" and typetag "+theOscMessage.typetag());
  theOscMessage.print();
}



The sketch loads ok ~ but nothing is received on the Processing side ~ I would be expecting something to happen in the message box underneath my sketch but nothing there.

I am running Processing 1.0.9 on pure:dyne (ubuntu 9.10). I don't use the DSMI server for linux as it seems to be only used to transfer the udp information into midi (which wouldn't be that useful since i would prefer to listen to osc and transfer it into processing calls)

I am not too sure how to create a minimal sketch to listen to osc ~ and to display what it hears.

any guidance would be useful ~ I have a hard time understanding the documentation of the oscp5 library (and I tried all of the example without being able to generate anything.

thanks

Re: oscp5 library on linux
Reply #1 - May 2nd, 2010, 2:10am
 
hi geoffroy,
the sketch you posted should print incoming message into processing's console indeed. when you start the sketch, do you see the following?
Code:


### [2010/5/2 16:59:30] PROCESS @ OscP5 stopped.
### [2010/5/2 16:59:30] PROCESS @ UdpClient.openSocket udp socket initialized.
### [2010/5/2 16:59:31] PROCESS @ UdpServer.start() new Unicast DatagramSocket created @ port 1234
### [2010/5/2 16:59:31] PROCESS @ UdpServer.run() UdpServer is running @ 1234
### [2010/5/2 16:59:31] INFO @ OscP5 is running. you (192.168.1.101) are listening @ port 1234


to check if oscP5 works for your setup, you can run example oscP5sendReceive which sends osc messages to itself when clicking into the display window. is your firewall off? is the port blocked? i only have a mac and a windows machine here, cant check for linux.
best,
andreas

Re: oscp5 library on linux
Reply #2 - May 2nd, 2010, 11:15am
 
Code:
### [2010/5/2 11:54:40] PROCESS @ OscP5 stopped.
### [2010/5/2 11:54:40] PROCESS @ UdpClient.openSocket udp socket initialized.
### [2010/5/2 11:54:41] PROCESS @ UdpServer.start() new Unicast DatagramSocket created @ port 1234
### [2010/5/2 11:54:41] PROCESS @ UdpServer.run() UdpServer is running @ 1234
### [2010/5/2 11:54:41] INFO @ OscP5 is running. you (127.0.1.1) are listening @ port 1234


yep that is looking good apart from the ip address. I tried other example and it was working fine ~ I was able to click in the window and the console would display the message. My firewall is not up - and my computer is receiving the udp packet from the device.

Does it make sense that what I receive from the NDS is not formated correctly from osc ? Or woudl oscp5 display the packet even if it's not completely the needed format?

Here is an example of the packet that are captured :

Code:
12:11:33.060516 IP (tos 0x0, ttl 128, id 10755, offset 0, flags [none], proto UDP (17), length 42)
192.168.1.222.4767 > 192.168.1.255.1234: UDP, length 14
E..**.....................K.moved 150 37;

;
.
12:11:33.077412 IP (tos 0x0, ttl 128, id 11011, offset 0, flags [none], proto UDP (17), length 42)
192.168.1.222.4767 > 192.168.1.255.1234: UDP, length 14
E..*+.....................E.moved 135 41;

B..
12:11:33.093846 IP (tos 0x0, ttl 128, id 11267, offset 0, flags [none], proto UDP (17), length 42)
192.168.1.222.4767 > 192.168.1.255.1234: UDP, length 14
E..*,.....................B.moved 118 41;

B..
12:11:33.110759 IP (tos 0x0, ttl 128, id 11523, offset 0, flags [none], proto UDP (17), length 42)
192.168.1.222.4767 > 192.168.1.255.1234: UDP, length 14
E..*-.....................I.moved 102 38;


I am not too familiar with osc as you can see - and wondering if I should simply try to get processing to listen to the UDP port and parse these message ?


Re: oscp5 library on linux
Reply #3 - May 2nd, 2010, 9:21pm
 
So researcching a little more - I read about osc and how the udp packet are formed and I realized that the software I was using on the NDS was sending something completely different.

DSMI is not made exclusively for osc - but midi and other stuff.

So I used the  osc example http://dsmi.tobw.net/index.php?cat_id=0 program on the nds and it's all good ! I can controle processing with my NDS - yaha !!!
Cheesy

Page Index Toggle Pages: 1