<?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[How do I create an arbitrary number of signal inlets in an external?]]></title><description><![CDATA[<p>Hi all, I'm trying to create an external that has one float inlet and a number of signal inlets corresponding to the creation argument. Something like <code>[nfader 4]</code> should have four signal inlets and one float inlet for the interpolation parameter.</p>
<p>Yes, I already found abstract-based solutions but dynamic patching is black magic to me so I'd rather code this in C with which I'm quite comfortable.</p>
<p>The problem is I thought I could have a <code>t_inlet **inlets</code> field in the object's struct and then allocate the inlets with the usual combo of <code>(t_inlet **)malloc(n * sizeof(t_inlet *))</code> but apparently sizeof does not have access to <code>_inlet</code> (aliased to <code>t_inlet</code>) as it is an externally defined symbol.</p>
<p>Bottom line: all the examples I could think of that have arbitrary amounts of inlets (and outlets for that matter) are <code>bondo</code> from cyclone and <code>pack</code> from vanilla. I tried <code>expr~</code> but its complexity is not really helping…</p>
<p>… pointers?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 11:42:34 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/13323.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Feb 2021 18:49:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How do I create an arbitrary number of signal inlets in an external? on Thu, 25 Feb 2021 18:49:36 GMT]]></title><description><![CDATA[<p>Hi all, I'm trying to create an external that has one float inlet and a number of signal inlets corresponding to the creation argument. Something like <code>[nfader 4]</code> should have four signal inlets and one float inlet for the interpolation parameter.</p>
<p>Yes, I already found abstract-based solutions but dynamic patching is black magic to me so I'd rather code this in C with which I'm quite comfortable.</p>
<p>The problem is I thought I could have a <code>t_inlet **inlets</code> field in the object's struct and then allocate the inlets with the usual combo of <code>(t_inlet **)malloc(n * sizeof(t_inlet *))</code> but apparently sizeof does not have access to <code>_inlet</code> (aliased to <code>t_inlet</code>) as it is an externally defined symbol.</p>
<p>Bottom line: all the examples I could think of that have arbitrary amounts of inlets (and outlets for that matter) are <code>bondo</code> from cyclone and <code>pack</code> from vanilla. I tried <code>expr~</code> but its complexity is not really helping…</p>
<p>… pointers?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external</guid><dc:creator><![CDATA[morpheu5]]></dc:creator><pubDate>Thu, 25 Feb 2021 18:49:36 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create an arbitrary number of signal inlets in an external? on Thu, 25 Feb 2021 19:05:44 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/morpheu5">@morpheu5</a> A type agnostic version of [pack] was made for Pd extended.<br />
Here is the source file which should help........ <a href="/uploads/files/1614279526061-pack.c">pack.c</a> .....<br />
David.<br />
The help file might be useful to see how arguments are handled......<br />
<img src="/uploads/files/1614279944374-capture.jpg" alt="Capture.JPG" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external/2</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Thu, 25 Feb 2021 19:05:44 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create an arbitrary number of signal inlets in an external? on Thu, 25 Feb 2021 20:02:09 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> Thanks, it looks just like what I was looking for! It also follows the approach I'm familiar with (array of pointers instead of the pointer to <code>t_atom</code> which I found in <code>expr~</code>) and it turns out that I had to use <code>getbytes</code> instead of plain old <code>malloc</code>.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external/3</guid><dc:creator><![CDATA[morpheu5]]></dc:creator><pubDate>Thu, 25 Feb 2021 20:02:09 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create an arbitrary number of signal inlets in an external? on Thu, 25 Feb 2021 20:38:24 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/morpheu5">@morpheu5</a> That's good.  It's largely gobbledegook for me ( Fortran74 at university) but I understand enough to know that it should help someone who knows what they are doing.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external/4</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Thu, 25 Feb 2021 20:38:24 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create an arbitrary number of signal inlets in an external? on Thu, 25 Feb 2021 20:42:28 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/whale-av">@whale-av</a> Of course I'm good enough with C but regularly stumped by PD itself… <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" /> I'm currently trying to figure out how to set up the DSP function with all those parameters, but <a href="https://github.com/pure-data/externals-howto" rel="nofollow">this</a> seems to be a decent resource to start from.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external/5</guid><dc:creator><![CDATA[morpheu5]]></dc:creator><pubDate>Thu, 25 Feb 2021 20:42:28 GMT</pubDate></item><item><title><![CDATA[Reply to How do I create an arbitrary number of signal inlets in an external? on Thu, 25 Feb 2021 21:15:25 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/morpheu5">@morpheu5</a> The source for extended is here...... <a href="https://puredata.info/downloads/pd-extended" rel="nofollow">https://puredata.info/downloads/pd-extended</a> and as it included many externals it should contain something that will help.<br />
Sourceforge has Vanilla sources but vanilla has very few externals so it is probably not helpful.<br />
These might help.....<a href="/uploads/files/1614287229252-these.zip">these.zip</a> ..... but if not then there should be something in the Extended tarball.</p>
<p>But also look in your Pd installation doc folder......... \doc\6.externs for an example of creating a dsp object.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13323/how-do-i-create-an-arbitrary-number-of-signal-inlets-in-an-external/6</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Thu, 25 Feb 2021 21:15:25 GMT</pubDate></item></channel></rss>