Wow, thanks. I didn't know about pdsend and pdreceive, I had always just written my own network handling scripts and/or used netcat. Since I don't need pd to deal with any of the program output this may be a good avenue to explore.
andy On Sat, Mar 22, 2008 at 1:49 PM, Claude Heiland-Allen <[EMAIL PROTECTED]> wrote: > An alternative method that I like for asynchronous execution is: > > [netsend] > [netreceive] -- optional, for knowing when the command has completed > > and a bash script like: > > #!/bin/bash > pdreceive ... | > while read line > do > somecommand "$LINE" >/dev/null > echo "done;" # optional > done | # optional (pipe) > pdsend ... # optional > > > pdsend and pdreceive are little tools provided with Pd to interact with > netsend and netreceive. > > A concrete example: > > ----8<---- > #!/bin/bash > pdreceive 1570 | > while read line ; do > ppmhist -map <histogram-in.ppm >histogram-tmp.ppm > ppmtoppm <histogram-tmp.ppm >histogram-out.ppm > echo "ready ;" > done | > pdsend 1571 > ----8<---- > > The Pd patch uses GridFlow to save histogram-in.ppm and sends "go" to > netsend, which executes one run through the loop, then when Pd > netreceive receives "ready", it loads histogram-out.ppm and carries on > processing - hopefully GridFlow will get histogram support soon, if it > doesn't already. > > > Claude > > > Andrew Turley wrote: > > It looks like that should work. Thanks. > > > > andy > > > > On Sat, Mar 22, 2008 at 12:43 PM, Hans-Christoph Steiner <[EMAIL > PROTECTED]> wrote: > >> [shell] and [popen] should work. > >> > >> .hc > >> > >> > >> > >> On Mar 22, 2008, at 2:09 PM, Andrew Turley wrote: > >> > >> > Hey, I was wondering if there was a way to execute a program from pd. > >> > Specifically, I would like to use the osascript command in Mac OS X to > >> > send a command to iTunes. > >> > > >> > I can write an external to do this, but if there is already something > >> > out there to do then then I will use that. > >> > > >> > andy > >> > > >> > _______________________________________________ > >> > PD-list@iem.at mailing list > >> > UNSUBSCRIBE and account-management -> http://lists.puredata.info/ > >> > listinfo/pd-list > >> > >> > >> > >> ------------------------------------------------------------------------ > >> ---- > >> > >> The arc of history bends towards justice. - Dr. Martin Luther > >> King, Jr. > >> > >> > >> > > > > _______________________________________________ > > PD-list@iem.at mailing list > > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list > > -- > http://claudiusmaximus.goto10.org > _______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list