[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] Re: OSC on Super Collider 3.8 Windows



fgrond wrote
> Dear List,
> 
> I'm trying to set up an OSC communication on a Windows 10 enterprise
> computer
> The client program is written in C# using the Ventuz.OSC  and/or  Bespoke
> library.
> 
> We use SC 3.8 the firewall is off.
> 
> We would expect to see messages come in, if we send from the C# program to
> port 57120 on the 127.0.0.1
> 
> var writer = new UDPWriter("127.0.0.1", 57120);
> writer.Send(new OSCElement("/data", 500);
> 
> and setup in SuperCollider:
> 
> n = NetAddr("127.0.0.1", NetAddr.langPort); // local machine
> OSCFunc.newMatching({|msg, time, addr, recvPort| msg.postln; }, '/data',
> n); // path matching.

The problem is here:

n = NetAddr("127.0.0.1", NetAddr.langPort); // local machine

(Side note: in this case, there is no need to use newMatching -- newMatching
is for the case of wildcards in the incoming command paths. If the command
path is a fixed constant, OSCFunc(...) is sufficient.)

OK... the real problem. The NetAddr given to OSCFunc should hold the address
and port FROM which the *other* application is sending. You've created a
NetAddr instance with the sclang port. This is not the FROM port. It's the
TO port. So, you're inadvertently filtering out messages coming from any
application except SC.

Your C# example specifies the TO port (SC's port), but it doesn't name a
specific FROM port. This seems to be pretty common: some libraries don't
give you any control over the FROM port. If you don't have control over it,
then you have no idea which port to put into the receiving NetAddr. SC
handles this by allowing the port to be nil:

// receive from any apps on the local machine
n = NetAddr("127.0.0.1", nil);

Admittedly, OSCFunc.new documentation could be improved: the srcID argument
is explained only in terms of the sender's IP address, and it clarifies
nothing about the expected port.

hjh



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/OSC-on-Super-Collider-3-8-Windows-tp7629654p7629669.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/