<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><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: https://git.iem.at/pd/vstplugin/blob/develop/pd/src/vstplugin~.cpp#L521</div>

<div> </div>

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

<div> </div>

<div>Christof</div>

<div> 
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Montag, 05. August 2019 um 21:10 Uhr<br/>
<b>Von:</b> "x nor" <x37v.alex@gmail.com><br/>
<b>An:</b> pd-dev <pd-dev@lists.iem.at><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 Pd-dev@lists.iem.at <a href="https://lists.puredata.info/listinfo/pd-dev" target="_blank">https://lists.puredata.info/listinfo/pd-dev</a></div>
</div>
</div>
</div></div></body></html>