[PD] Web interface for PD patch
matthijs at devdsp.net
matthijs at devdsp.net
Tue Jul 22 17:35:30 CEST 2003
Hi,
I've just been messing around with netreceive, and it seems fairly easy:
Just insert a netreceive object in your patch [netreceive portnum]
Connect it however you want
On the web server, install a script that opens a tcp connection to your
PD server
Print regular PD messages (bang, float, etc) to the tcp connection.
I used Perl to send a numerical value to PD, which PD would then display
in a numbox. The PD patch was simply:
[netreceive 3000]
|
NUMBOX
And the Perl script read:
#!/usr/bin/perl
use IO::Socket;
$socket = new IO::Socket::INET (PeerAddr => "192.168.123.76",
PeerPort => 3000,
Proto => "tcp",
Type => SOCK_STREAM)
or die "Can't connect $!\n";
print $socket $ARGV[0] # this sends whatever command line argument you
# pass to the script to PD. Spiffy
print $socket ";"; # ; is PD's newline character. Don't forget
# to send this, or it won't work
On Tue, Jul 22, 2003 at 03:51:59PM +0100, Martin Dupras wrote:
> Hi,
>
> I have done this in the past, using PHP and the netreceive object in PD.
> If your server has php installed, it's a very easy solution. Basically
> in the php code you open a socket, send the data through it and close
> the socket. All you need to do is make sure that PD is listening on that
> socket with netreceive.
>
> - martin
>
>
> On Tue, 2003-07-22 at 15:08, lists at martinmalm.com wrote:
> > Hi everyone !
> >
> > I need to control a simple PD patch via a webinterface. Since I know a
> > little bit of Java I would like to use some kind of applet, but I don't
> > know If this is possible ? What other methods / frameworks would work ?
> >
> > For this installation I only need oneway WEB -> PD, but it would be fun to
> > know how to implement two way comunication also.
> >
> > I would be really happy if someone who has done stuff like this before
> > could point me in the right direction or maybe provide a simple example.
> >
> >
> > All the best /
> >
> > Martin Malm
> >
> > _______________________________________________
> > PD-list mailing list
> > PD-list at iem.at
> > http://iem.at/cgi-bin/mailman/listinfo/pd-list
> >
>
>
> _______________________________________________
> PD-list mailing list
> PD-list at iem.at
> http://iem.at/cgi-bin/mailman/listinfo/pd-list
--
take care,
Matthijs de Jonge
http://devdsp.net - news and resources for computer musicians
More information about the Pd-list
mailing list