<br><br><div class="gmail_quote">2011/11/17 IOhannes m zmoelnig <span dir="ltr">&lt;<a href="mailto:zmoelnig@iem.at">zmoelnig@iem.at</a>&gt;</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>
&gt; As a beginner in Pd, I&#39;m also wondering what that means...<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt; Hey IOhannes,<br>
&gt;&gt;<br>
&gt;&gt; thank you, but could you please explain it a bit more in detail? I am not<br>
&gt;&gt; a complete newbie, but not so much into the pd-list speak. I searched in<br>
&gt;&gt; the list for the question, but there was no comprehensible solution shown...<br>
&gt;&gt; It&#39;s on pd extended 0.42.5 on Win XP.<br>
<br>
</div>sorry for talking gibberish.<br>
<br>
i don&#39;t know much about Pd-extended and little about w32.<br>
i&#39;ll give it a try though:<br>
<div class="im"><br>
$ pd -stderr 2&gt;&amp;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 (&quot;pdsend 9999 localhost udp&quot;) 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&#39;ll come to it later. it<br>
basically grabs all messages printed by Pd.<br>
<br>
the fun part is in the middle, &quot;|&quot; (aka &#39;pipe&#39;) takes the &quot;output&quot; of<br>
one program (in this case Pd) and uses it as &quot;input&quot; 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&#39;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 &quot;stdout&quot; (pdsend will read from &quot;stdin&quot;, and the pipe (&quot;|&quot;) 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 &quot;stderr&quot; (see [1] again).<br>
if you start Pd from the console (the cmdline; on w32 this would be e.g.<br>
the &quot;cmd&quot; 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&#39;s printout to some<br>
standard stream!), but we are not there yet (Pd sends to &quot;stderr&quot;,<br>
whereas we want it to send to &quot;stdout&quot;)<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 &quot;2&gt;&amp;1&quot; (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>
&quot;pd&quot;         - start Pd,<br>
&quot;-stderr&quot;    - but send all printout to stderr rather than the pdconsole<br>
&quot;2&gt;&amp;1&quot;       - then redirect the stderr to stdout,<br>
&quot;|&quot;          - pipe the stdout to the stdin<br>
&quot;pdsend ...&quot; - 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 &quot;send: Connection refused (111)&quot;?</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>
&gt;&gt;<br>
&gt;&gt; best<br>
&gt;&gt; mirro<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi list,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I wonder if there is a possibility to receive console messages within a<br>
&gt;&gt; patch. Could be helpful, for instance, when there is a certain error that<br>
&gt;&gt; should immediately trigger a reaction.<br>
&gt;&gt;&gt; Thanks for advice.<br>
&gt;&gt;<br>
&gt;&gt; i guess there are some answers for that in the archives.<br>
&gt;&gt;<br>
&gt;&gt; the simplest is probably still<br>
&gt;&gt; $ pd -stderr 2&gt;&amp;1 | pdsend 9999 localhost udp<br>
&gt;&gt;<br>
&gt;&gt; and then have<br>
&gt;&gt; [netreceive 9999 1]<br>
&gt;&gt; listen for your output.<br>
&gt;&gt;<br>
&gt;&gt; fgmasdr<br>
&gt;&gt; IOhannes<br>
&gt;&gt; --<br>
&gt;<br>
&gt;<br>
&gt;<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 -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br></blockquote></div><br>