<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px">> Hi Pd-dev,<br><div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1489676706890_4539" style="display: block;"><div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1489676706890_4538"><div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1489676706890_4537"><div class="y_msg_container" id="yui_3_16_0_ym19_1_1489676706890_4566">> (Hi Hans! Hi Dan!)<br><br><div id="yui_3_16_0_ym19_1_1489676706890_4796">> It's been a while since I was here. I just quit my job and intend to spend some <br></div><div id="yui_3_16_0_ym19_1_1489676706890_4797">time making music boxes. Pd is in my future.</div><br>> There's a couple of things I'd like to spend some time on:<br><br>> 1. I'd like to elminate the clicking that you get when making live edits to a patch.<br><div id="yui_3_16_0_ym19_1_1489676706890_4798"><br></div><div id="yui_3_16_0_ym19_1_1489676706890_4799">These typically come from three sources:</div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4800">1) rebuilding the dsp graph when you make a change to it</div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4801">2) walking the list of objects in a glist<br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4802">3) sending too much data to the GUI over the socket</div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4803"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4804">#1 currently the dsp graph is just a big, flat array of function&argument <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4805">pointers.  It would require substantial changes to only rebuild subsections <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4939">of it.<br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4813"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4814">#2 every time you move the mouse (plus some other events like clicking) <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4924">Pd walks the list of canvas objects, either until it finds an object under the <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4938">mouse or hits the end.  Run Pd with the "-d 3" flag and you will see how <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5046">often Pd does this when editing a patch.</div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5048"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5083">The list of objects is a linked list which, as Bjarne Stroustrup has said, <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5084">"optimizes for cache misses".  But more importantly, all that work happens <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5102">in the same process as the audio engine instead of inside the GUI toolkit <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5103">where it should be.</div><div dir="ltr"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5104">Moving this work to the GUI is not trivial, especially because Pd has no <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5122">formal specification.<br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4904"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4910">#3 The current graphical processing code in the g_*.c files is very chatty <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5230">and unoptimized.  When you move a selection of 100 objects by one pixel, <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5231">all 100 objects send a message to the GUI to move the corresponding <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5245">tagged tk canvas items by 1 pixel.  In Vanilla I believe garrays are still <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5280">redrawn every time you move them which makes things even worse.</div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5298"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5312">Also, every time you paste text into a box each character is sent separately <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5313">to the audio process, concatenated, then sent back to the GUI to display.  <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5314">So you get exponential explosion there.  There are probably other places <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5315">where this happens...</div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5316"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_5317">-Jonathan<br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1489676706890_4806"><br></div><div dir="ltr"><br></div><div><br></div>2. I'd like to get as much of the DSP chain as possible into a threadsafe state.<br><br>Are there any plans around these? Design docs or discussions? Is this on anyone's radar?<br><br>Thanks<br>Damian<br>--<br>damian stewart . digitaler fuzzi . vienna, austria<br><a href="http://damianstewart.com/" target="_blank">http://damianstewart.com </a>. twitter @damian0815<br><br><br><br><br><br><br><br><br>_______________________________________________<br>Pd-dev mailing list<br><a ymailto="mailto:Pd-dev@lists.iem.at" href="mailto:Pd-dev@lists.iem.at">Pd-dev@lists.iem.at</a><br><a href="https://lists.puredata.info/listinfo/pd-dev" target="_blank">https://lists.puredata.info/listinfo/pd-dev</a><br><br><br></div> </div> </div>  </div></div></body></html>