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
The netreceive object may be what you need:
"The Netreceive object opens a socket for TCP ("stream") or UDP ("datagram") network reception on a specified port. If using TCP, an outlet gives you the number of Netsend objects (or other compatible clients) have opened connections here."
So as long as you know what to send, this should work.
Never tried it, though.
On Tue, Jul 22, 2003 at 04:08:54PM +0200, lists@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@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
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.
On Tue, 2003-07-22 at 15:08, lists@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@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
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@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@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
you can also use FLASH to communicate with PD... http://www.akustische-kunst.org/puredata/flash/flash.html
-andre
lists@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@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
This is very simple to do in java and I have used It many a time in my work, I generally use netclient object ( from http://www.akustische-kunst.org/ in the maxlib package ) because it allows very easy 2way comms.
I don't know if you know the code to open a socket in java so here it is anyway... Ignore if you do!
You need to
import java.net.*;
Create the objects
Socket s; BufferedReader in; PrintWriter so; boolean connected;
use this code to initiate the connection
try{ s = new Socket("localhost",3000); /*obviously change the values above to the ip number on which the pd patch resides and the port number netclient is listening on*/ in=new BufferedReader( new InputStreamReader(s.getInputStream()) ); so=new PrintWriter(s.getOutputStream()); connected=true; }catch(IOException e){println(e);connected=false;}
Then in your java, you can send the values you want like so...
if(connected){ so.println(values+";");
//make sure you add the ";" for netclient
so.flush();
}
You can simply filter the results in the pd patch for any prefixes you may use to denote what the value is and is for.
If you wanted to get input from the socket (for two way) you would create a new thread listening to the port...
class Listener implements Runnable{ String ln; public Listener(){} public void run(){ println("running"); try{ while((ln=in.readLine())!=null){ dataCheck(ln);//or whatever method you need } }catch(IOException e){println(e);} } }
And start this like so...
l=new Listener(); t=new Thread(l); t.start();
After creating these instances
Listener l; Thread t;
Hope that makes sense, I quickly copied that code out of various applets so they just be complete nonsense, I didn't check:)
Otherwise you can use flash creating a socket with xmlSocket (see the flash documentation) and use the netclient external still.
All the Best, Ed.
-----Original Message----- From: pd-list-admin@iem.at [mailto:pd-list-admin@iem.at] On Behalf Of lists@martinmalm.com Sent: 22 July 2003 15:09 To: pd-list@iem.kug.ac.at Subject: [PD] Web interface for PD patch
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@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
Hello Friends, I just would like to know if some of you already works with urn which a good object but when it finish to make it's job, it's just simply stop!!
for example if you put urn 120, it will explore all the possibilities in this number and whel it will finish it will just stop, my questions is how we could loop his work? Random just simply do that, it repeats the number but not urn...
thanks for your help!
best
juto
hi juto,
2nd outlet of cyclone's urn bangs when urn is empty -- connect this outlet to the message 'clear' sent back to the urn's 1st inlet.
Krzysztof
juto aviten wrote:
Hello Friends, I just would like to know if some of you already works with urn which a good object but when it finish to make it's job, it's just simply stop!!