Hello to all the PD developers!<br><br>As the word goes about improving pd&#39;s GUI speed, I thought this is the perfect opportunity for me to share some ideas, that I&#39;ve already written about on the <a href="http://puredata.info">puredata.info</a> homepage.<br>
<br>Let me introduce myself first. My name is Jakob Leben, I&#39;m from Slovenia and I&#39;m actively using pure data. I can say I have quite some experience with writing pd externals, but I don&#39;t have an integral insight into pd&#39;s source code.<br>
<br>Lately I made an external that visualizes pd&#39;s graphic arrays but much faster than pd natively does. (If I load 20 seconds of audio into a pd&#39;s array the drawing of the array causes clicks in audio. Another big problem is dragging a graphic array around the patch, that works extra slow.<br>
<br>There are two things one could do:<br>1. change the algorithm for visualisation of array&#39;s data.<br>2. draw the data onto a specially loaded Tk canvas, so that when dragging the array around only the canvas&#39; window is translated instead of all the coordinates for the line that represents data.<br>
<br>Detailed explanation:<br>1. When the width of array&#39;s visualisation in pixels is smaller than the number of samples written into array it&#39;s useless to draw a segment of the line for each sample of data. Instead you can only draw one vertical segment of line for each column of pixels drawn: this segment&#39;s endpoints are defined by the minimum and the maximum value of the range of data that is &quot;covered&quot; by this pixel.<br>
The result of this is exactly the same as the way arrays are drawn now, though it involves much less line segments being drawn.<br>2. There is one problem that I came across with using a special canvas to visualise an array: a click on that canvas doesn&#39;t select the pd object that lies &quot;under&quot; this canvas. This canvas will always be &quot;above&quot; the object as all the objects are only items of one single Tk canvas, while this new canvas is the general canvas&#39; child displayed as a general canvas&#39; item of type window. Tk rule is that items of type window are always &quot;above&quot; all other items on a canvas.<br>
Thus it would be necessary to make a new binding for mouse events to this new canvas and somehow pass that click to pd&#39;s object.<br><br>Now, I realized these ideas in the form of a pd extern that visualises an array, but i think it would be great to integrate those ideas into pd&#39;s arrays itself. I could do that if only I understood better how PD&#39;s arrays are drawn and how the selection of pd&#39;s object works... I tried but it seems to my like too big a project to dig out myself where in the code and how those things happen so I would appreciate very much if someone guided me through this.<br>
<br>I&#39;m willing to put all my effort into making those arrays draw faster.<br><br>Sincerely,<br>Jakob Leben<br><br><div class="gmail_quote">On Sat, Apr 12, 2008 at 9:01 PM, Hans-Christoph Steiner &lt;<a href="mailto:hans@eds.org">hans@eds.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
It seems there is a profiler for Tcl. &nbsp;Has anyone ever tried it on Pd?<br>
<br>
Begin forwarded message:<br>
&gt; From: Revar Desmera &lt;<a href="mailto:revarbat@gmail.com">revarbat@gmail.com</a>&gt;<br>
&gt; Date: April 9, 2008 10:58:55 PM EDT<br>
&gt; To: TCL-Mac List &lt;<a href="mailto:tcl-mac@lists.sourceforge.net">tcl-mac@lists.sourceforge.net</a>&gt;<br>
&gt; Subject: Re: [MACTCL] Improving Application GUI Speed<br>
&gt; Delivered-To: <a href="mailto:hans@eds.org">hans@eds.org</a><br>
&gt; X-Mailer: Apple Mail (2.919.2)<br>
&gt; X-Filter-Rule: ALL_LISTS<br>
&gt;<br>
&gt; If you download <a href="http://www.belfry.com/code/profile.tcl" target="_blank">http://www.belfry.com/code/profile.tcl</a>, and add a<br>
&gt; &#39;source profile.tcl&#39; to the beginning of your program, when the<br>
&gt; program finishes, it&#39;ll dump a very detailed timing profile of your<br>
&gt; code to tclprof.txt, which you can use to determine what to optimize.<br>
&gt; The report format is very close to that of gprof.<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; - Revar<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Apr 8, 2008, at 1:10 AM, Randolf Schultz wrote:<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; please help me getting my application up to speed on MacOSX/Aqua.<br>
&gt;&gt; It runs fine on Linux/X11, Win32, and even MacOSX/X11. Only on<br>
&gt;&gt; MacOSX/Aqua it crawls.<br>
&gt;&gt;<br>
&gt;&gt; Want to have a look first?<br>
&gt;&gt; Go to<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://sourceforge.net/project/platformdownload.php" target="_blank">http://sourceforge.net/project/platformdownload.php</a>?<br>
&gt;&gt; group_id=28460&amp;sel_platform=4542<br>
&gt;&gt;<br>
&gt;&gt; (or <a href="http://www.ayam3d.org/download.html" target="_blank">http://www.ayam3d.org/download.html</a>)<br>
&gt;&gt;<br>
&gt;&gt; get both variants (MacOSX/X11 and MacOSX/Aqua).<br>
&gt;&gt;<br>
&gt;&gt; Already the application startup is 2-3s (Linux/X11) vs. 10-15s<br>
&gt;&gt; (MacOSX/Aqua); from then on the MacOSX version is unusably<br>
&gt;&gt; slow, especially when drawing the scrollable GUIs for the object<br>
&gt;&gt; properties (those are implemented as window in a canvas).<br>
&gt;&gt; Another problem area are the pane widgets, that may be dragged<br>
&gt;&gt; quite fine on X11, but on Aqua they do one hop every 1-2s (and<br>
&gt;&gt; this is _without_ continuous re-packing the GUI, only dragging<br>
&gt;&gt; the pane handle, which is a simple packed frame IIRC!).<br>
&gt;&gt;<br>
&gt;&gt; The Linux/X11 and MacOSX/Aqua variants were test-run on the<br>
&gt;&gt; very same machine (MacMini-PPC)!<br>
&gt;&gt;<br>
&gt;&gt; So how would you proceed to tackle this problem?<br>
&gt;&gt; Is there an easy way to profile such complex scenarios with Tcl/Tk?<br>
&gt;&gt;<br>
&gt;&gt; best regards,<br>
&gt;&gt; Randolf<br>
&gt;&gt;<br>
&gt;&gt; ---------------------------------------------------------------------<br>
&gt;&gt; ----<br>
&gt;&gt; This SF.net email is sponsored by the 2008 JavaOne(SM) Conference<br>
&gt;&gt; Register now and save $200. Hurry, offer ends at 11:59 p.m.,<br>
&gt;&gt; Monday, April 7! Use priority code J8TLD2.<br>
&gt;&gt; <a href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://" target="_blank">http://ad.doubleclick.net/clk;198757673;13503038;p?http://</a><br>
&gt;&gt; <a href="http://java.sun.com/javaone" target="_blank">java.sun.com/javaone</a><br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Tcl-mac mailing list<br>
&gt;&gt; <a href="mailto:tcl-mac@lists.sourceforge.net">tcl-mac@lists.sourceforge.net</a><br>
&gt;&gt; <a href="https://lists.sourceforge.net/lists/listinfo/tcl-mac" target="_blank">https://lists.sourceforge.net/lists/listinfo/tcl-mac</a><br>
&gt;<br>
&gt;<br>
&gt; ----------------------------------------------------------------------<br>
&gt; ---<br>
&gt; This SF.net email is sponsored by the 2008 JavaOne(SM) Conference<br>
&gt; Don&#39;t miss this year&#39;s exciting event. There&#39;s still time to save<br>
&gt; $100.<br>
&gt; Use priority code J8TL2D2.<br>
&gt; <a href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://" target="_blank">http://ad.doubleclick.net/clk;198757673;13503038;p?http://</a><br>
&gt; <a href="http://java.sun.com/javaone" target="_blank">java.sun.com/javaone</a><br>
&gt; _______________________________________________<br>
&gt; Tcl-mac mailing list<br>
&gt; <a href="mailto:tcl-mac@lists.sourceforge.net">tcl-mac@lists.sourceforge.net</a><br>
&gt; <a href="https://lists.sourceforge.net/lists/listinfo/tcl-mac" target="_blank">https://lists.sourceforge.net/lists/listinfo/tcl-mac</a><br>
<br>
<br>
<br>
------------------------------------------------------------------------<br>
----<br>
<br>
Using ReBirth is like trying to play an 808 with a long stick. &nbsp; &nbsp;-<br>
David Zicarelli<br>
<br>
<br>
<br>
_______________________________________________<br>
PD-dev mailing list<br>
<a href="mailto:PD-dev@iem.at">PD-dev@iem.at</a><br>
<a href="http://lists.puredata.info/listinfo/pd-dev" target="_blank">http://lists.puredata.info/listinfo/pd-dev</a><br>
</blockquote></div><br>