<?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[data types in pure data with pd-lib-builder]]></title><description><![CDATA[<p>Hey,<br />
I've been writing small externals in C using pd-lib-builder (as in <a href="https://github.com/pure-data/externals-howto/tree/master" rel="nofollow">this tutorial</a>) for a while, all the time not really understanding what on earth is being done with all this object-oriented business I'm writing. All the stuff that comes to and from the pure data environment is in some sort of wrapper data-type shenanigan, i.e. a float that is passed into an inlet of a pd object might be a (t_atom) with symbol &quot;float&quot; or it might be a (t_float) sometimes ?? And in order to interact with any of this I use a getter method, or just treat it as what it should be and cross my fingers (maybe with some forced typing now and then too). I don't like not understanding my data types, and I don't really know what documentation I can look at beyond that git repo I linked above.</p>
<p>anyway I'm just trying to write an object with a construction argument of one (1) float that won't crash Pd when given garbage/nothing on construction.<br />
I'm looking for some kind of check for &lt;t_floatarg f&gt; that it is a ) populated and b ) actually a float.</p>
<pre><code>//constructor called when a new instance is made
void *rms_tilde_new(t_floatarg f) {
    t_rms_tilde *x = (t_rms_tilde *) pd_new(rms_tilde_class);

    //creating a signal outlet
    x-&gt;signalout = outlet_new(&amp;x-&gt;x_obj, &amp;s_signal);

    //passing creation arguments to internal variables
    x-&gt;windowsize = 64;
    if(f &gt;= 1) {
        x-&gt;windowsize = f;
    }
    
    return (void *)x;
}
</code></pre>
]]></description><link>http://forum.pdpatchrepo.info/topic/15929/data-types-in-pure-data-with-pd-lib-builder</link><generator>RSS for Node</generator><lastBuildDate>Fri, 18 Sep 2026 11:16:36 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/15929.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 17 Sep 2026 03:47:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to data types in pure data with pd-lib-builder on Thu, 17 Sep 2026 03:47:33 GMT]]></title><description><![CDATA[<p>Hey,<br />
I've been writing small externals in C using pd-lib-builder (as in <a href="https://github.com/pure-data/externals-howto/tree/master" rel="nofollow">this tutorial</a>) for a while, all the time not really understanding what on earth is being done with all this object-oriented business I'm writing. All the stuff that comes to and from the pure data environment is in some sort of wrapper data-type shenanigan, i.e. a float that is passed into an inlet of a pd object might be a (t_atom) with symbol &quot;float&quot; or it might be a (t_float) sometimes ?? And in order to interact with any of this I use a getter method, or just treat it as what it should be and cross my fingers (maybe with some forced typing now and then too). I don't like not understanding my data types, and I don't really know what documentation I can look at beyond that git repo I linked above.</p>
<p>anyway I'm just trying to write an object with a construction argument of one (1) float that won't crash Pd when given garbage/nothing on construction.<br />
I'm looking for some kind of check for &lt;t_floatarg f&gt; that it is a ) populated and b ) actually a float.</p>
<pre><code>//constructor called when a new instance is made
void *rms_tilde_new(t_floatarg f) {
    t_rms_tilde *x = (t_rms_tilde *) pd_new(rms_tilde_class);

    //creating a signal outlet
    x-&gt;signalout = outlet_new(&amp;x-&gt;x_obj, &amp;s_signal);

    //passing creation arguments to internal variables
    x-&gt;windowsize = 64;
    if(f &gt;= 1) {
        x-&gt;windowsize = f;
    }
    
    return (void *)x;
}
</code></pre>
]]></description><link>http://forum.pdpatchrepo.info/topic/15929/data-types-in-pure-data-with-pd-lib-builder</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15929/data-types-in-pure-data-with-pd-lib-builder</guid><dc:creator><![CDATA[Ulrike]]></dc:creator><pubDate>Thu, 17 Sep 2026 03:47:33 GMT</pubDate></item></channel></rss>