<div dir="ltr"><div>Great, Thanks Christof!</div><div>That reminds me, is there documentation for what binbufs are and how they're used? It is something I haven't worked with and `m_pd.h` lacks documentation.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 5, 2019 at 12:52 PM Christof Ressi <<a href="mailto:christof.ressi@gmx.at">christof.ressi@gmx.at</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Verdana;font-size:12px"><div>
<div>Hi,</div>

<div> </div>

<div>> if it is possible to write externals that generate structs/templates?</div>

<div> </div>

<div>Yes, actually Pd itself does this for the private templates needed by [array] and [text], have a look at garray_init() in g_array.c or text_template_init() in x_text.c.</div>

<div> </div>

<div>The patch is just a C string which you put into a binbuf which gets evaluated with pd_canvasmaker as the target.</div>

<div> </div>

<div>You can also create patches programmatically:</div>

<div> </div>

<div>1) create the canvas: <a href="https://git.iem.at/pd/vstplugin/blob/develop/pd/src/vstplugin~.cpp#L521" target="_blank">https://git.iem.at/pd/vstplugin/blob/develop/pd/src/vstplugin~.cpp#L521</a></div>

<div> </div>

<div>2) fill it with stuff: <a href="https://git.iem.at/pd/vstplugin/blob/develop/pd/src/vstplugin~.cpp#L649" target="_blank">https://git.iem.at/pd/vstplugin/blob/develop/pd/src/vstplugin~.cpp#L649</a></div>

<div> </div>

<div>Christof</div>

<div> 
<div name="quote" style="margin:10px 5px 5px 10px;padding:10px 0px 10px 10px;border-left:2px solid rgb(195,217,229)">
<div style="margin:0px 0px 10px"><b>Gesendet:</b> Montag, 05. August 2019 um 21:10 Uhr<br>
<b>Von:</b> "x nor" <<a href="mailto:x37v.alex@gmail.com" target="_blank">x37v.alex@gmail.com</a>><br>
<b>An:</b> pd-dev <<a href="mailto:pd-dev@lists.iem.at" target="_blank">pd-dev@lists.iem.at</a>><br>
<b>Betreff:</b> [PD-dev] can externals create data structures/templates?</div>

<div name="quoted-content">
<div>
<div>I'm starting to work with data structures and I'm curious if it is possible to write externals that generate structs/templates?</div>

<div>Are there any examples of this?</div>

<div>I guess I can do dynamic patching if not?</div>

<div>Thanks!</div>
</div>
_______________________________________________ Pd-dev mailing list <a href="mailto:Pd-dev@lists.iem.at" target="_blank">Pd-dev@lists.iem.at</a> <a href="https://lists.puredata.info/listinfo/pd-dev" target="_blank">https://lists.puredata.info/listinfo/pd-dev</a></div>
</div>
</div>
</div></div></div>
</blockquote></div>