[PD-dev] Pd OSC implementation(s) incompatible with SC3? [Fwd: Re: [sc-users] NetAddr]

Claude Heiland-Allen claudiusmaximus at goto10.org
Wed Mar 5 15:47:44 CET 2008


Hi all,

Thought this might be of interest to developers of OSC externals.

In short: Pd OSC implementations should send OSC on the same port that 
they listen on, as that is the "standard" way OSC works.


Claude

-------- Original Message --------
Subject: Re: [sc-users] NetAddr
Date: Tue, 04 Mar 2008 21:48:37 -0500
From: nescivi
Reply-To: SuperCollider users mailing list <sc-users at create.ucsb.edu>
To: SuperCollider users mailing list <sc-users at create.ucsb.edu>

Hiho,

On Tuesday 04 March 2008 21:28:27 William Brent wrote:
> 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.

correct, since SC sends from the same port as that it listens to, which 
is as
it should be.
In OSC world it is custom to send reply messages, so from the received 
message
you are able to figure out from which ip and port is was sent, so you can
back a message.


> 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*.

Again, there is a difference between the address they are sending from and
sending to. Like putting your address on a letter you send by snail 
mail. It
gives the receiver a method to figure out where the letter came from, and
enables him to send a letter back.



> 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...

no.
The fact that there is no way to specify *from* which Pd or Max are 
sending is
a weakness on their side. They should either let you specify it, or 
document
which port they are using. But chances are that they just take any port, in
which case you have no other option than to use nil in the OSCresponder.

But maybe Max and Pd are consistent in their behaviour.

I am not entirely sure whether this will work, for lack of Pd on my system,
but possibly with this bit of code, you van figure out from which 
address Pd
is sending.

o = OSCresponder(nil, '/chat', { |t, r, msg, addr| addr.postln; }).add;

I think it should post the addr. that the message comes from; please 
test this
by banging your sendOSC object multiple times to see if it is consistent.

> 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...

nope, the problem is on the other side.
SC allows for a safe mechanism by only listening to one specific port. 
It is
up to the sending application to provide an equally safe mechanism to send
messages out.

sincerely,
Marije
_______________________________________________
sc-users mailing list
sc-users at create.ucsb.edu
http://lists.create.ucsb.edu/mailman/listinfo/sc-users




More information about the Pd-dev mailing list