<br><br><div class="gmail_quote">2011/11/17 IOhannes m zmoelnig <span dir="ltr"><<a href="mailto:zmoelnig@iem.at">zmoelnig@iem.at</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<div class="im"><br>
On 2011-11-17 02:25, Vincent Kaschner wrote:<br>
> As a beginner in Pd, I'm also wondering what that means...<br>
><br>
><br>
><br>
>> Hey IOhannes,<br>
>><br>
>> thank you, but could you please explain it a bit more in detail? I am not<br>
>> a complete newbie, but not so much into the pd-list speak. I searched in<br>
>> the list for the question, but there was no comprehensible solution shown...<br>
>> It's on pd extended 0.42.5 on Win XP.<br>
<br>
</div>sorry for talking gibberish.<br>
<br>
i don't know much about Pd-extended and little about w32.<br>
i'll give it a try though:<br>
<div class="im"><br>
$ pd -stderr 2>&1 | pdsend 9999 localhost udp<br>
<br>
</div>this basically means:<br>
- - take the output of Pd, and send it (using pdsend) to port 9999 of the<br>
local machine.<br>
<br>
the 2nd part of the line ("pdsend 9999 localhost udp") should be fairly<br>
obvious: it calls the pdsend program (on w32 it is called pdsend.exe and<br>
you might have to find out where it is - somewhere in the Pd\bin\ folder<br>
is a good guess), with some parameters, that specify the target port<br>
(9999), the target host (localhost, the machine the program is executed<br>
on) and the protocol (udp).<br>
<br>
the 1st part is a bit more complicated, i'll come to it later. it<br>
basically grabs all messages printed by Pd.<br>
<br>
the fun part is in the middle, "|" (aka 'pipe') takes the "output" of<br>
one program (in this case Pd) and uses it as "input" to another program<br>
(here: pdsend)<br>
<br>
<br>
the slightly unorthodox part is the 1st one:<br>
we have to make Pd produce it's output in a form that is usable as input<br>
for pdsend. this basically means that instead of sending the printout to<br>
the pd-console, we have to redirect it to a special output, that is<br>
called "stdout" (pdsend will read from "stdin", and the pipe ("|") will<br>
magically transform the stdout of the 1st program to the stdin of the<br>
2nd; see [1] for more information)<br>
Pd usually send s it output to the Pd-console.<br>
however, you can start it with a special cmdline flag, that will all<br>
messages to a special output, the "stderr" (see [1] again).<br>
if you start Pd from the console (the cmdline; on w32 this would be e.g.<br>
the "cmd" program), all messages sent to the stderr will show up on the<br>
console (note, that on w32 you will have to start <a href="http://pd.com" target="_blank">pd.com</a> rather than<br>
pd.exe, because else windows will prevent the stderr to be printed to<br>
the console).<br>
this is almost what we want (we are sending Pd's printout to some<br>
standard stream!), but we are not there yet (Pd sends to "stderr",<br>
whereas we want it to send to "stdout")<br>
<br>
luckily enough, many cmdline interpreters have a special syntax for<br>
redirecting stdstreams. on bash (a common cmdline interpreter on un*x)<br>
and afaik on w32, you can do redirect the stderr of a program to the<br>
stdout using "2>&1" (stderr has a numeric file descriptor 2; stdout has<br>
a numeric file descriptor 1; so this redirection means: take<br>
filedescriptor 2 (stderr) and send it to filedescriptor 1 (stdout))<br>
<br>
so the line i gave means:<br>
"pd" - start Pd,<br>
"-stderr" - but send all printout to stderr rather than the pdconsole<br>
"2>&1" - then redirect the stderr to stdout,<br>
"|" - pipe the stdout to the stdin<br>
"pdsend ..." - of pdsend, which will send the data (back to Pd)<br>
<br>
<br>
hope that helps.<br>
<br>
fgamrt<br>
IOhannes<br>
<br><br></blockquote><div>How do I get past "send: Connection refused (111)"?</div><div><br></div><div>gr,</div><div>Tim </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<br>
[1] <a href="http://en.wikipedia.org/wiki/Standard_streams" target="_blank">http://en.wikipedia.org/wiki/Standard_streams</a><br>
<div class="im"><br>
>><br>
>> best<br>
>> mirro<br>
>><br>
>>> Hi list,<br>
>>><br>
>>> I wonder if there is a possibility to receive console messages within a<br>
>> patch. Could be helpful, for instance, when there is a certain error that<br>
>> should immediately trigger a reaction.<br>
>>> Thanks for advice.<br>
>><br>
>> i guess there are some answers for that in the archives.<br>
>><br>
>> the simplest is probably still<br>
>> $ pd -stderr 2>&1 | pdsend 9999 localhost udp<br>
>><br>
>> and then have<br>
>> [netreceive 9999 1]<br>
>> listen for your output.<br>
>><br>
>> fgmasdr<br>
>> IOhannes<br>
>> --<br>
><br>
><br>
><br>
<br>
</div>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.11 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
iEYEARECAAYFAk7ExbcACgkQkX2Xpv6ydvQVrgCgqNEW7N3V8vWSk8M01MLpDr22<br>
jVcAoIFKLeGVp/g3+gV6K1wm4KuYH+Ri<br>
=0WOh<br>
-----END PGP SIGNATURE-----<br>
<br>
<br>_______________________________________________<br>
<a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br></blockquote></div><br>