[PD] WebPd 1st try

s p sebpiq at gmail.com
Wed Jun 24 09:26:33 CEST 2015


Hi Julian,

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 :
https://github.com/sebpiq/WebPd/blob/master/examples/phasor/index.html#L42
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
:

var parsedPatch = pdfu.parse(mainStr)
var svgStr = pdfu.renderSvg(parsedPatch, {svgFile: false, ratio: 1.5})
$('#svg').html(svgStr)


Hope this helps. Please tell me if you need more help.

On Wed, Jun 24, 2015 at 2:09 AM, Pall Thayer <pallthay at gmail.com> wrote:

> What does your browser's javascript console say? Any errors showing up?
>
> On Tue, Jun 23, 2015 at 7:03 PM Julian Brooks <jbeezez at gmail.com> wrote:
>
>> Hello,
>>
>> I'm exploring WebPd and am stuck - hopefully someone can advise.
>>
>> 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.
>>
>> Following instructions from here:
>> https://github.com/sebpiq/WebPd#step-by-step-guide
>>
>> I've got as far as successfully loading myPatch.pd and can hear it.
>>
>> Would like my patch to appear like your 'example' patches in a browser.
>>
>> I'm think it's something to do with 'pd-fileutils' but not sure what to
>> do next?
>>
>> Thanks in advance,
>>
>> Julian
>> _______________________________________________
>> Pd-list at lists.iem.at mailing list
>> UNSUBSCRIBE and account-management ->
>> http://lists.puredata.info/listinfo/pd-list
>>
>


-- 

*Sébastien Piquemal*

 -----* @sebpiq*
 ----- http://github.com/sebpiq
 ----- http://funktion.fm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150624/5d1efbfa/attachment.html>


More information about the Pd-list mailing list