« Return to Thread: NetAddr

Re: NetAddr

by William Brent-2 :: Rate this Message:

Reply to Author | View in Thread

Hmm.  I've been doing a little more testing on this, using two separate machines.  Here's what seems to be true:

1) With both machines using SC, OSC messaging is fine through port 57120.  Each side simply specifies

n = NetAddr("address of other machine", 57120);
o = OSCresponder(n, '/chat', { |t, r, msg| msg.postln }).add;

n.sendMsg("/chat", "blah");

This means each machine is listening for messages *from* the address of the other machine, on port 57120, and sending messages *to* the other addresss on port 57120.

So within SC, of course, all is well.


2) OSC communication between Max and Max, Pd and Pd, or Pd and Max is all fine.

3) Using either the sendOSC object in Pd, or the udpsend object in Max/MSP, communication with SC fails unless SC's OSCresponder addr argument is set to nil.  This is in spite of the fact that sendOSC and udpsend require you to specify the address and port number you'd like to send *to*.  There is no way to specify what port you're sending *from* on the Pd or Max machines, but I've been told that if you're sending to a specific port on another machine, the local machine must necessarily be sending out the same port.  I have no idea if that's true or not...

So, in a way, there's no problem, as long as you explicitly specify no NetAddr to listen for.  A friend of mine did a piece by Paul Lansky that required SC/Max communication, and that code also has OSCresponders listening to a "nil" NetAddr, since it was the only way to make it happen.

I don't know enough about this to suggest what's going on.  Maybe I'm still missing something (and sorry if I am!), but it seems like there could be a problem on the SC side here...


William


On Mon, Mar 3, 2008 at 4:19 PM, nescivi <nescivi@...> wrote:
Hiho,

On Monday 03 March 2008 19:15:26 William Brent wrote:
> Thanks, all.  I'll post to the Pd list as well.  For the record though, the
> sendOSC object does require a port number, and I've got it set to 57120.

yes, that's probably the port it is sending *to*, which is correct, if you
want to receive the messages in sclang.

What you need to know is the port Pd is sending *from*.

sincerely,
Marije

> If I figure out what's up, I'll post back here for future reference...
>
>
> William
>
> On Mon, Mar 3, 2008 at 1:59 PM, Oswald Berthold <opt@...> wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> >
> > hi
> >
> > the problem is that pd is most likely not sending from 57120. the
> > sendOSC object would need a method for setting its outgoing
> > portnumber.
> >
> > to check, you can do a netstat on the sending machine, determine the
> > port used and put that into your NetAddr manually.
> >
> > bst, opt
> >
> > William Brent writes:
> >  > Hi,
> >  >
> >  > I'm using Pd/Gem to do some motion tracking - sending particular OSC
> >  > messages to SuperCollider when certain areas of the video have motion.
> >
> >  The
> >
> >  > only way I'm getting successful communication is to have the addr
> >
> > argument
> >
> >  > of OSCresponder set to nil.  When I specify a NetAddr for the video
> >
> > tracking
> >
> >  > computer in the standard way described in the helpfile, communication
> >
> > fails:
> >  > n = NetAddr("192.168.1.66", 57120);
> >  >
> >  > o = OSCresponder(n, '/movement/1', { |t, r, msg| msg[1].postln }).add;
> >  >
> >  > On the Pd side, things are the same either way: I make a connection to
> >
> > the
> >
> >  > SC machine's address, and start sending messages.  So the only
> >
> > difference
> >
> >  > between communication vs. failure is whether or not the OSCresponder
> >  > acknowledges messages from anywhere, or only from a specific address.
> >
> >  I
> >
> >  > guess this is just as much a question for people on the Pd list, since
> >
> > it
> >
> >  > might be the way messages are coming out of Pd.
> >  >
> >  > But maybe someone has already been down this path?  It would be nice
> >  > to limit the awareness of this OSCr to one address.
> >  >
> >  >
> >  > As usual, thanks...
> >  > William
> >  >
> >  >
> >  > --
> >  > William Brent
> >  >
> >  > "Great minds flock together"
> >  > Conflations: conversational idiom for the 21st century
> >  >
> >  > www.conflations.com
> >  > _______________________________________________
> >  > sc-users mailing list
> >  > sc-users@...
> >  > http://lists.create.ucsb.edu/mailman/listinfo/sc-users
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.7 (GNU/Linux)
> > Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>
> >
> > iD8DBQFHzHSu7u+hhWCy2kMRAncQAKCSqvH81ecbUu5P12uCzp8yfXxgKQCgqxV7
> > Pb7qM1K1gYwRecX1sQK9VtY=
> > =pNsD
> > -----END PGP SIGNATURE-----
> > _______________________________________________
> > sc-users mailing list
> > sc-users@...
> > http://lists.create.ucsb.edu/mailman/listinfo/sc-users


_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users



--
William Brent

"Great minds flock together"
Conflations: conversational idiom for the 21st century

www.conflations.com
_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

 « Return to Thread: NetAddr