<div dir="ltr"><div><div><div><div>Hi Julian,<br><br></div>In that area there sure is room for improvement, and I should integrate WebPd better with pd-fileutils (which is the module used to render patches to SVG, but also to parse patches from text file to JavaScript). For the moment, you can use the same hack I've used in the examples : <a href="https://github.com/sebpiq/WebPd/blob/master/examples/phasor/index.html#L42">https://github.com/sebpiq/WebPd/blob/master/examples/phasor/index.html#L42</a><br></div>Basically, pd-fileutils is available globally as "pdfu" (ideally it shouldn't be there). Then you take the patch file you loaded (here called "mainStr") you re-parse it with pdfu (ideally you shouldn't need to do), you render the result as SVG and insert the SVG in your web page. In the example it is done in one line, but decomposing the whole thing looks like : <br><br>var parsedPatch = <span class="">pdfu.<span class="">parse</span>(mainStr)</span><br>var svgStr = <span class="">pdfu.renderSvg(parsedPatch, {svgFile<span class="">:</span> <span class="">false</span>, ratio<span class="">:</span> <span class="">1.5</span>})</span><br><span class="">$(<span class=""><span class="">'</span>#svg<span class="">'</span></span>).html(svgStr)</span><br><br><br></div>Hope this helps. Please tell me if you need more help.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 24, 2015 at 2:09 AM, Pall Thayer <span dir="ltr"><<a href="mailto:pallthay@gmail.com" target="_blank">pallthay@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">What does your browser's javascript console say? Any errors showing up?<br></div><br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Tue, Jun 23, 2015 at 7:03 PM Julian Brooks <<a href="mailto:jbeezez@gmail.com" target="_blank">jbeezez@gmail.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div><div>Hello,<br><br></div>I'm exploring WebPd and am stuck - hopefully someone can advise.<br><br></div>Going through Seb's gitpage (good job Seb btw, this is great) I get stuck when attempting to create an svg for my own supersimple patch.<br><br></div>Following instructions from here:<br><a href="https://github.com/sebpiq/WebPd#step-by-step-guide" target="_blank">https://github.com/sebpiq/WebPd#step-by-step-guide</a><br><br>I've got as far as successfully loading myPatch.pd and can hear it.<br><br></div><div>Would like my patch to appear like your 'example' patches in a browser.<br><br></div><div>I'm think it's something to do with 'pd-fileutils' but not sure what to do next?<br><br></div><div>Thanks in advance,<br><br></div><div>Julian<br></div></div></div></div>
_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><span style="color:rgb(153,153,153)"><b><span style="color:rgb(68,68,68)">S</span><span><span style="color:rgb(68,68,68)">ébastien Piquemal</span><br></span></b></span><div><span style="color:rgb(153,153,153)"><b><br></b></span><span style="color:rgb(102,102,102)"><b> </b><span style="color:rgb(204,204,204)">-----</span><b> <font size="1">@sebpiq</font></b></span><br></div><div><span style="color:rgb(102,102,102)"><span style="color:rgb(204,204,204)"> -----</span><b> </b><font size="1"><a href="http://github.com/sebpiq" target="_blank">http://github.com/sebpiq</a></font><b><br></b></span></div><span style="color:rgb(102,102,102)"> <span style="color:rgb(204,204,204)">-----</span> <font size="1"><a href="http://funktion.fm" target="_blank">http://funktion.fm</a></font></span><br></div></div>
</div>