<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Send data from pd to py]]></title><description><![CDATA[<p>Hi,</p>
<p>a Python program needs to receive &quot;z&quot; from pd.</p>
<p>In pd I generate &quot;z&quot; values by moving a slider.<br />
The Python code is already ready to receive z.</p>
<p>What is the correct patch to do this?<br />
Thanks,<br />
a.<br />
<img src="/uploads/files/1749934488810-pd2py.png" alt="pd2py.png" class="img-responsive img-markdown" /><br />
<a href="/uploads/files/1749934503440-pd2py.pd">pd2py.pd</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py</link><generator>RSS for Node</generator><lastBuildDate>Sun, 09 Aug 2026 04:32:14 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/15148.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Jun 2025 20:58:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Send data from pd to py on Sat, 14 Jun 2025 21:04:54 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>a Python program needs to receive &quot;z&quot; from pd.</p>
<p>In pd I generate &quot;z&quot; values by moving a slider.<br />
The Python code is already ready to receive z.</p>
<p>What is the correct patch to do this?<br />
Thanks,<br />
a.<br />
<img src="/uploads/files/1749934488810-pd2py.png" alt="pd2py.png" class="img-responsive img-markdown" /><br />
<a href="/uploads/files/1749934503440-pd2py.pd">pd2py.pd</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py</guid><dc:creator><![CDATA[atux]]></dc:creator><pubDate>Sat, 14 Jun 2025 21:04:54 GMT</pubDate></item><item><title><![CDATA[Reply to Send data from pd to py on Sun, 15 Jun 2025 12:01:34 GMT]]></title><description><![CDATA[<p>Simply connect the slider to the sender.</p>
<p><img src="/uploads/files/1749988747352-image.png" alt="image.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/2</guid><dc:creator><![CDATA[FFW]]></dc:creator><pubDate>Sun, 15 Jun 2025 12:01:34 GMT</pubDate></item><item><title><![CDATA[Reply to Send data from pd to py on Sun, 15 Jun 2025 13:35:10 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ffw">@FFW</a> said:</p>
<blockquote>
<p>Simply connect the slider to the sender.</p>
</blockquote>
<p>Ok, but I left the blank space between slider and netsend because I don't know how to write the variable z that python expects. Something like &quot;send z $1&quot;.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/3</guid><dc:creator><![CDATA[atux]]></dc:creator><pubDate>Sun, 15 Jun 2025 13:35:10 GMT</pubDate></item><item><title><![CDATA[Reply to Send data from pd to py on Sun, 15 Jun 2025 17:28:41 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/atux">@atux</a> You can try that.......  <a href="/uploads/files/1750008450648-pd2py_v2.pd">pd2py_v2.pd</a><br />
Does it work?<br />
If not then post your Python code and someone will tell you why not.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/4</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Sun, 15 Jun 2025 17:28:41 GMT</pubDate></item><item><title><![CDATA[Reply to Send data from pd to py on Sun, 15 Jun 2025 18:14:57 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> said:</p>
<blockquote>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/atux">@atux</a> You can try that.......  <a href="/uploads/files/1750010917234-pd2py_v2.pd">pd2py_v2.pd</a><br />
Does it work?<br />
If not then post your Python code and someone will tell you why not.<br />
David.</p>
</blockquote>
<p>Thanks, it works fine.<br />
But in order for python to receive the values ​​correctly, I had to remove &quot;-b&quot; from [netsend -u -b].<br />
These are some values ​​received from pd:</p>
<pre><code>$ python3 py_from_pd.py
Socket bind completed on 127.0.0.1:9999. Waiting for messages...
Raw data received from ('127.0.0.1', 51903): b'z 0.5;\n'
Decoded message: z 0.5;
Value of z: 0.5
Raw data received from ('127.0.0.1', 51903): b'z 0.509868;\n'
Decoded message: z 0.509868;
Value of z: 0.509868
Raw data received from ('127.0.0.1', 51903): b'z 0.519737;\n'
Decoded message: z 0.519737;
</code></pre>
<p>It seems good to me.<br />
I attach both files, so it can be useful:<br />
<a href="/uploads/files/1750010903394-py_from_pd.py">py_from_pd.py</a><br />
<a href="/uploads/files/1750010917234-pd2py_v2.pd">pd2py_v2.pd</a></p>
<p>Thank you,<br />
a.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/5</guid><dc:creator><![CDATA[atux]]></dc:creator><pubDate>Sun, 15 Jun 2025 18:14:57 GMT</pubDate></item><item><title><![CDATA[Reply to Send data from pd to py on Sun, 15 Jun 2025 19:04:18 GMT]]></title><description><![CDATA[<p><code>[netsend]</code> help for the <code>[send(</code> message says &quot;same as list&quot; so you can also do</p>
<pre><code>[hslider]
|
[list prepend z]
|
[netsend]
</code></pre>
]]></description><link>http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/6</guid><dc:creator><![CDATA[FFW]]></dc:creator><pubDate>Sun, 15 Jun 2025 19:04:18 GMT</pubDate></item><item><title><![CDATA[Reply to Send data from pd to py on Sun, 15 Jun 2025 20:44:07 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ffw">@FFW</a> said:</p>
<blockquote>
<p><code>[netsend]</code> help for the <code>[send(</code> message says &quot;same as list&quot; so you can also do</p>
<pre><code>[hslider]
|
[list prepend z]
|
[netsend]
</code></pre>
</blockquote>
<p>Yes, that's how it works too.<br />
<a href="/uploads/files/1750020221615-pd2py_v3.pd">pd2py_v3.pd</a><br />
For less computational effort, is one preferable to the other, or are they equivalent?<br />
Thank you,<br />
a.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/7</guid><dc:creator><![CDATA[atux]]></dc:creator><pubDate>Sun, 15 Jun 2025 20:44:07 GMT</pubDate></item><item><title><![CDATA[Reply to Send data from pd to py on Sun, 15 Jun 2025 21:17:37 GMT]]></title><description><![CDATA[<p>I think it's easier to dynamically upgrade the variable name with the [list prepend] right inlet.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15148/send-data-from-pd-to-py/8</guid><dc:creator><![CDATA[FFW]]></dc:creator><pubDate>Sun, 15 Jun 2025 21:17:37 GMT</pubDate></item></channel></rss>