[PD] OSC Communication between PD and SC

Clifford Dunn beatleboy07 at gmail.com
Mon Jun 22 04:42:49 CEST 2015


Totally. For the SC side, you actually shouldn't be too specific with
the ports. So all that seems to be needed is this:

OSCFunc({arg msg, time, add, recvPort; msg.postln;}, '/test');

Then on PD

message: connect 127.0.0.1 57120
*connect*
object: udpsend

57120 is the default port that SC listens to. It doesn't hurt to
double check that by running NetAddr.langPort

Then also on PD:

message: send /test $1
*connect*
object: packOSC
*connect*
object: udpsend

And that seems to work just fine!
Clifford Dunn
Flutist/Composer
http://www.ckdmusic.weebly.com



On Sun, Jun 21, 2015 at 12:21 PM, Alexandre Torres Porres
<porres at gmail.com> wrote:
> can you share de code from supercollider and the pd patch for us please?
>
> 2015-06-21 2:46 GMT-03:00 Clifford Dunn <beatleboy07 at gmail.com>:
>>
>> Okay, I figured it out.
>>
>> It's a supercollider thing. Turns out that I was being too specific
>> when defining the NetAddr. By not specifying in the OSCdef, everything
>> is working fine now. Thanks for all the help!
>> Clifford Dunn
>> Flutist/Composer
>> http://www.ckdmusic.weebly.com
>>
>>
>>
>> On Sat, Jun 20, 2015 at 5:54 PM, Martin Peach <chakekatzil at gmail.com>
>> wrote:
>> > Are you sure NetAddr.langPort is 57120?
>> >
>> > Martin
>> >
>> > On Sat, Jun 20, 2015 at 5:27 PM, Clifford Dunn <beatleboy07 at gmail.com>
>> > wrote:
>> >>
>> >> Hi PD list,
>> >>
>> >> I want to be sending this to the SC list as well, but for some reason
>> >> I can't get through there.
>> >>
>> >> I'm getting pretty frustrated as I try to figure out why these two
>> >> programs are currently refusing to talk to each other. I'm not really
>> >> sure about how to type out PD code, so please bear with me.
>> >>
>> >> First, I have SC set up to receive OSC:
>> >>
>> >> n = NetAddr("127.0.0.1", NetAddr.langPort);
>> >>
>> >> OSCFunc({arg msg, time, addr, recvPort; "Hello World".postln;},
>> >> '/test',
>> >> n);
>> >>
>> >> Testing this internally with SC works fine:
>> >>
>> >> m = NetAddr("127.0.0.1", NetAddr.langPort);
>> >>
>> >> m.sendMsg("/test", "Hi")
>> >>
>> >>
>> >> PD on the other hand:
>> >>
>> >> object: import mrpeach
>> >> message: connect 127.0.0.1 57120
>> >> *connected to*
>> >> object: udpsend
>> >>
>> >> The listener tells me: udpsend connecting to port 57120
>> >>
>> >> message: send /test 5
>> >> *connected to*
>> >> object: packOSC
>> >> *connected to*
>> >> object udpsend
>> >>
>> >> Nothing happens on the supercollider end. However, within PD, if I set
>> >> up a udpreceiver, I get a response
>> >>
>> >> object: udpreceive 57120
>> >> *connected to*
>> >> object: unpackOSC
>> >> *connected to*
>> >> object: spigot (toggle on right inlet)
>> >> *connected to*
>> >> object: print received
>> >>
>> >> And then I can send messages within PD and it prints fine.
>> >>
>> >> Also, if I send from SC:
>> >>
>> >> n.sendMsg("/test", 45);
>> >>
>> >> It prints fine in PD.
>> >>
>> >> So what am I missing that is preventing PD from sending to SC? If it
>> >> helps, I'm running ArchLinux, SC 3.6.6, and Pd 0.43.4-extended.
>> >>
>> >> Thanks a lot for any help you can provide!
>> >>
>> >> connect 1
>> >> Clifford Dunn
>> >> Flutist/Composer
>> >> http://www.ckdmusic.weebly.com
>> >>
>> >> _______________________________________________
>> >> Pd-list at lists.iem.at mailing list
>> >> UNSUBSCRIBE and account-management ->
>> >> http://lists.puredata.info/listinfo/pd-list
>> >
>> >
>>
>> _______________________________________________
>> Pd-list at lists.iem.at mailing list
>> UNSUBSCRIBE and account-management ->
>> http://lists.puredata.info/listinfo/pd-list
>
>



More information about the Pd-list mailing list