[PD] network send/receive patches

Lazzaro N. CIccoella ciccolix at tiscalinet.it
Sat Jan 8 08:01:21 CET 2005


vlada car wrote:
> hi, 
> i am a complete newbie for Pd and am trying to build a pd patch that
> will receive some data via network from the application my friend is
> developing and that will primarily run on windows.
> so, he is writing that under windows and i am trying to find out what
> patch i can try to use and what kind of output windows' application
> needs to send or what protocol we can use?
> does anyone know any good starts or a tutorial link about this?
> 

For PD side, you can start pd and open "help-netreceive.pd" it work as a 
socket server on port 3000
(you can find it in main-menu/help/Pure_documentation/5.reference/).

Now you must only create in your application a client socket that 
transmits on port 3000 .

Simply your friend must watch a tutorial like "creating a client socket" 
specific for the programming language that has used in order to make its 
application.

Using tcl (it is very portable), you can resolved with a little numbers 
of lines:

##begin
proc sock-client {} {
global s
set s [socket localhost 3000]
##replace "localhost" with the
##network address in which run
##pd if it does not run on the
##same computer of the client.
}
proc trasmetti {trasmissione} {
global s
	puts $s "$trasmissione;\n;";
	flush $s
}
sock-client
trasmetti "hello pd"
##end


bye
--
Lazzaro




More information about the Pd-list mailing list