Hello, we are trying to save the output of fiddle to a file so it can be read by a java program in real-time. We are using a dos prompt and write the pd output to a file using a pipe, then getting this output as text input to java. Unfortunately the way it is done now pd does not update the file fast enough. There is some sort of buffering that prevents real-time. Do you know how this problem can be fixed?
Thanks, Stefania
Here's how I would do it:
I would make a perl based server with a socket that accepts data and sends it back out. Put a netsend in your PD patch and connect to the perl server. Connect fiddles output to the netsend. Create a socket in your java program that connects to the perl server. That's it. Everything will be in real-time, no files to write to.
Pall
On Monday 08 December 2003 16:01, Stefania Serafin wrote:
Hello, we are trying to save the output of fiddle to a file so it can be read by a java program in real-time. We are using a dos prompt and write the pd output to a file using a pipe, then getting this output as text input to java. Unfortunately the way it is done now pd does not update the file fast enough. There is some sort of buffering that prevents real-time. Do you know how this problem can be fixed?
Thanks, Stefania
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
On Mon, 8 Dec 2003, Pall Thayer wrote:
Here's how I would do it:
I would make a perl based server with a socket that accepts data and sends it back out. Put a netsend in your PD patch and connect to the perl server.
perl in the middle sounds a bit redundant to me. why not connect directly to a java server's listening socket?
blip, ub
Because I don't really know the nature of the project. If people want to do everything by hand, then a listening socket in java is fine. The good thing about a server in between is that the PD patch and java program can be disconnected and reconnected at will without any fuss. Put a loadbang on the connect message for the netsend and all you have to do is launch the patch and then launch your java program. I don't know, it just makes sense to me to have something that's constantly active, in between.
Pall
On Monday 08 December 2003 16:31, [·] wrote:
On Mon, 8 Dec 2003, Pall Thayer wrote:
Here's how I would do it:
I would make a perl based server with a socket that accepts data and sends it back out. Put a netsend in your PD patch and connect to the perl server.
perl in the middle sounds a bit redundant to me. why not connect directly to a java server's listening socket?
blip, ub
On Mon, 8 Dec 2003, Pall Thayer wrote:
Because I don't really know the nature of the project.
you're right - it depends on their priorities. so ... if performance is important, i would probably not want to have perl running, when there's already a java vm. (or vice versa ;)
blip, ub
On Monday 08 December 2003 16:31, [·] wrote:
On Mon, 8 Dec 2003, Pall Thayer wrote:
Here's how I would do it:
I would make a perl based server with a socket that accepts data and sends it back out. Put a netsend in your PD patch and connect to the perl server.
perl in the middle sounds a bit redundant to me. why not connect directly to a java server's listening socket?
blip, ub
-- Pall Thayer artist/teacher http://www.this.is/pallit http://www.this.is/isjs http://www.this.is/harmony http://130.208.220.190/panse
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
. . .. . . . . http://blue.test.at . . . ..
Probably the best way to do this would be to use "netsend" within Pd and make teh java code open a port and receive the (text) Pd messages.
Somewhat easier (and certainly the first step to try) would be to "netsend" to the "pdreceive" program (in pd/bin) which you can then pipe to Java. The Pdreceive code should be easy enough to incorporate into the Java program itself if your development environment allows loading C libs into Java...
cheers Miller
On Mon, Dec 08, 2003 at 08:01:19AM -0800, Stefania Serafin wrote:
Hello, we are trying to save the output of fiddle to a file so it can be read by a java program in real-time. We are using a dos prompt and write the pd output to a file using a pipe, then getting this output as text input to java. Unfortunately the way it is done now pd does not update the file fast enough. There is some sort of buffering that prevents real-time. Do you know how this problem can be fixed?
Thanks, Stefania
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
if you want quite basic interaction, you can just use plain MIDI, checkout javax.sound.midi (included in Java2 standard edition 1.3 and up)
ptr.
Stefania Serafin wrote:
Hello, we are trying to save the output of fiddle to a file so it can be read by a java program in real-time. We are using a dos prompt and write the pd output to a file using a pipe, then getting this output as text input to java. Unfortunately the way it is done now pd does not update the file fast enough. There is some sort of buffering that prevents real-time. Do you know how this problem can be fixed?
Thanks, Stefania
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list