<?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 a message from an outlet]]></title><description><![CDATA[<p>Hello,<br />
the question is silly but I couldn't figure out from <a href="http://pdstatic.iem.at/externals-HOWTO/" rel="nofollow">http://pdstatic.iem.at/externals-HOWTO/</a></p>
<p>I am writing an externals that initializes netsend_tilde by sending a message of the type:<br />
[connect &lt;IP&gt; &lt;port&gt;(<br />
As I coded it now, my external sends out this:<br />
symbol connect 123.123.123.123 12345<br />
Within the patch I can put a [$1( between the outlet of my external and netsend, however I want to print out from the outlet a clean &quot;connect &lt;IP&gt; &lt;port&gt;&quot; message without &quot;symbol&quot; in front of it.</p>
<p>My code:</p>
<pre><code>x-&gt;x_nsend_outlet = outlet_new(&amp;x-&gt;x_obj, &amp;s_symbol); // I tried also 0 as the first argument (message outlet-type) but did not work
char nsend_message[MESSAGE_LEN];
sprintf(nsend_msg,&quot;connect %s %d&quot;,inet_ntoa(cli_addr.sin_addr),nsend_port); // create the message to send out &quot;connect &lt;IP&gt; &lt;port&gt;&quot;
outlet_symbol(x-&gt;x_nsend_outlet, gensym((char*) nsend_msg)); // outlets the message
</code></pre>
<p>Thanks, cheers</p>
<p>Leopard</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/7031/send-a-message-from-an-outlet</link><generator>RSS for Node</generator><lastBuildDate>Sat, 08 Aug 2026 12:48:10 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/7031.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 25 Jan 2013 16:24:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Send a message from an outlet on Fri, 25 Jan 2013 16:24:57 GMT]]></title><description><![CDATA[<p>Hello,<br />
the question is silly but I couldn't figure out from <a href="http://pdstatic.iem.at/externals-HOWTO/" rel="nofollow">http://pdstatic.iem.at/externals-HOWTO/</a></p>
<p>I am writing an externals that initializes netsend_tilde by sending a message of the type:<br />
[connect &lt;IP&gt; &lt;port&gt;(<br />
As I coded it now, my external sends out this:<br />
symbol connect 123.123.123.123 12345<br />
Within the patch I can put a [$1( between the outlet of my external and netsend, however I want to print out from the outlet a clean &quot;connect &lt;IP&gt; &lt;port&gt;&quot; message without &quot;symbol&quot; in front of it.</p>
<p>My code:</p>
<pre><code>x-&gt;x_nsend_outlet = outlet_new(&amp;x-&gt;x_obj, &amp;s_symbol); // I tried also 0 as the first argument (message outlet-type) but did not work
char nsend_message[MESSAGE_LEN];
sprintf(nsend_msg,&quot;connect %s %d&quot;,inet_ntoa(cli_addr.sin_addr),nsend_port); // create the message to send out &quot;connect &lt;IP&gt; &lt;port&gt;&quot;
outlet_symbol(x-&gt;x_nsend_outlet, gensym((char*) nsend_msg)); // outlets the message
</code></pre>
<p>Thanks, cheers</p>
<p>Leopard</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/7031/send-a-message-from-an-outlet</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/7031/send-a-message-from-an-outlet</guid><dc:creator><![CDATA[leopard86]]></dc:creator><pubDate>Fri, 25 Jan 2013 16:24:57 GMT</pubDate></item><item><title><![CDATA[Reply to Send a message from an outlet on Thu, 31 Jan 2013 14:09:32 GMT]]></title><description><![CDATA[<p>A very gentle bump for this topic</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/7031/send-a-message-from-an-outlet/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/7031/send-a-message-from-an-outlet/2</guid><dc:creator><![CDATA[leopard86]]></dc:creator><pubDate>Thu, 31 Jan 2013 14:09:32 GMT</pubDate></item><item><title><![CDATA[Reply to Send a message from an outlet on Thu, 31 Jan 2013 22:07:06 GMT]]></title><description><![CDATA[<p>I've never done it myself, but I would imagine you would need to use the <a href="http://iem.at/pd/externals-HOWTO/node9.html#SECTION000931100000000000000" rel="nofollow">outlet_anything()</a> function.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/7031/send-a-message-from-an-outlet/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/7031/send-a-message-from-an-outlet/3</guid><dc:creator><![CDATA[Maelstorm]]></dc:creator><pubDate>Thu, 31 Jan 2013 22:07:06 GMT</pubDate></item><item><title><![CDATA[Reply to Send a message from an outlet on Wed, 17 Apr 2013 16:47:26 GMT]]></title><description><![CDATA[<p>Thanks. I forgot to add how I did solve this for future use.</p>
<pre><code>t_atom connect_values[2];
SETSYMBOL(&amp;connect_values[0],gensym(inet_ntoa(x-&gt;x_peers[cp].addr)));
SETFLOAT(&amp;connect_values[1],nsend_port);
outlet_anything(x-&gt;x_nsend_outlet,gensym(&quot;connect&quot;),2,connect_values);
</code></pre>
<p>First I instantiate two atoms (one will carry a IP address, the second an int port number), then I set the two symbols to the desired values (x-&gt;x_peers[cp].addr and nsend_port).<br />
Finally I output them and voila they will appear as a message [connect &lt;IP&gt; &lt;port&gt;(<br />
where the &quot;connect&quot; string appears first thanks to gensym(&quot;connect&quot;)</p>
<p>L</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/7031/send-a-message-from-an-outlet/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/7031/send-a-message-from-an-outlet/4</guid><dc:creator><![CDATA[leopard86]]></dc:creator><pubDate>Wed, 17 Apr 2013 16:47:26 GMT</pubDate></item></channel></rss>