[PD] executing commands from pd via pdreceive

Peter P. peterparker at fastmail.com
Mon Sep 6 21:51:03 CEST 2021

Hi list,

I am trying to execute shell commands from withing pd using the FUDI
protocoll and the command line programs pdsend and pdreceive. I want to
trigger the espeak command from within pd. On Debian it already works
	pdreceive 8888 udp | espeak
and sending words to speak as a message to [netsend -u] in a Pd patch.

Now espeak has nice flags, such as the -p 50 flag for pitch. I would
like to send this from pd as well and am now sending the command itself
to pdreceive as
	pdreceive 8888 udp | sh 
and a Pd message containing 
	send espeak -p 20 "blah blah blah"
which works as well. 

Is there a way I can let pd know that the command
has finished executing? For example by sending something back like
	pdreceive 8888 udp | sh - ; echo "done" | pdsend 8889 localhost udp
which sadly does not work?

I would also like to spawn multiple espeak commands
in parallel from one [netsend] using this approach but can't seem to
make it work. Again using the command
	pdreceive 8888 udp | sh 
and including an ampersand at the end of the Pd message like
	send espeak -p 20 "blah blah blah" &
throws a
	sh: 1: Syntax error: ";" unexpected
error on the shell terminal with pdreceive exiting.

Does anyone have an idea what I can try here (except for writing a
wrapper script)?

Thank you for all ideas!

More information about the Pd-list mailing list