<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Matthieu Brucher's blog</title> <link>http://matt.eifelle.com</link> <description /> <lastBuildDate>Tue, 09 Feb 2010 08:09:00 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.1</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/eifelle/CPPV" /><feedburner:info uri="eifelle/cppv" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>PyVST: another ctypes-based Python VST wrapper</title><link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/zUUBz7oNrHY/</link> <comments>http://matt.eifelle.com/2010/02/09/pyvst-another-ctypes-based-python-vst-wrapper/#comments</comments> <pubDate>Tue, 09 Feb 2010 08:06:47 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[C++]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[ctypes]]></category> <category><![CDATA[VST]]></category><guid isPermaLink="false">http://matt.eifelle.com/?p=1075</guid> <description><![CDATA[In a previous post, I&#8217;ve tried to use Qt for the editor window of a VST plugin. The thing is, I want to do more than just play with a GUI, I also want to see what is done to an audio stream by a plugin.
To do so, I&#8217;ve decided to expose the VST interface [...]]]></description> <content:encoded><![CDATA[<p>In <a
href="http://matt.eifelle.com/2009/12/01/vst-plugin-again-reloaded-with-a-qt-gui/">a previous post</a>, I&#8217;ve tried to use Qt for the editor window of a VST plugin. The thing is, I want to do more than just play with a GUI, I also want to see what is done to an audio stream by a plugin.</p><p>To do so, I&#8217;ve decided to expose the VST interface to Python. There are some implementation I&#8217;ve heard of, but they are based on Cython or other wrapping tools. Ctypes has the advantage of not needing a compilation step. There are also every functionality needed, as callback creation (plugins use a callback to ask the host some stuffs), and Python provides the additional mathematical tools to display what the plugin does. It may not be perfect, but it will be enough for a starter.<br
/> <span
id="more-1075"></span></p><h4>Wrapping the VST effect class</h4><p>Wrapping a VST class is not an easy task. The plugin is accessed by a C structure with pointer functions for the main functionalities: processing an audio flow (with floats or doubles), setting and getting parameters, and a general function for setting and getting information. Additionaly, when instantiating a plugin, a callback must be given. This ctypes callback will have to be stored inside the wrapper so that it stays valid through the plugin lifetime.</p><p>So the C structure is created as a class that inherits from ctypes.Structure. Then I have to populate a class that will call the correct function or return the appropriate element inside this structure.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left2">Download <a
href="http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=1075&amp;download=aeffect.py">aeffect.py</a></span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p10753"><td
class="code" id="p1075code3"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> AEffect<span style="color: black;">&#40;</span>Structure<span style="color: black;">&#41;</span>:
  _fields_ = <span style="color: black;">&#91;</span>
                    <span style="color: black;">&#40;</span><span style="color: #483d8b;">'magic'</span>, c_int<span style="color: black;">&#41;</span>,
                    <span style="color: black;">&#40;</span><span style="color: #483d8b;">'dispatcher'</span>, c_void_p<span style="color: black;">&#41;</span>,
                    <span style="color: black;">&#40;</span><span style="color: #483d8b;">'process'</span>, c_void_p<span style="color: black;">&#41;</span>,
                    <span style="color: black;">&#40;</span><span style="color: #483d8b;">'setParameter'</span>, c_void_p<span style="color: black;">&#41;</span>,
                    <span style="color: black;">&#40;</span><span style="color: #483d8b;">'getParameter'</span>, c_void_p<span style="color: black;">&#41;</span>,
<span style="color: black;">&#40;</span>...<span style="color: black;">&#41;</span>
                    <span style="color: black;">&#93;</span>
&nbsp;
audiomaster_callback = CFUNCTYPE<span style="color: black;">&#40;</span>c_void_p, POINTER<span style="color: black;">&#40;</span>AEffect<span style="color: black;">&#41;</span>, c_int, c_int, c_long, c_void_p, c_float<span style="color: black;">&#41;</span></pre></td></tr></table></div><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left2">Download <a
href="http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=1075&amp;download=vstplugin.py">vstplugin.py</a></span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p10754"><td
class="code" id="p1075code4"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> VSTPlugin<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
  <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, filename, audio_callback = basic_callback<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;
    Constructor
    Parameters:
      filename is the name of the plugin to load
      audio_callback is the Python function to call (optional)
    &quot;&quot;&quot;</span>
    <span style="color: #008000;">self</span>.__lib = CDLL<span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span>
    <span style="color: #008000;">self</span>.__callback = audiomaster_callback<span style="color: black;">&#40;</span>audio_callback<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">try</span>:
      <span style="color: #008000;">self</span>.__lib.<span style="color: black;">VSTPluginMain</span>.<span style="color: black;">argtypes</span> = <span style="color: black;">&#91;</span>audiomaster_callback, <span style="color: black;">&#93;</span>
      <span style="color: #008000;">self</span>.__lib.<span style="color: black;">VSTPluginMain</span>.<span style="color: black;">restype</span> = POINTER<span style="color: black;">&#40;</span>AEffect<span style="color: black;">&#41;</span>
      <span style="color: #008000;">self</span>.__effect = <span style="color: #008000;">self</span>.__lib.<span style="color: black;">VSTPluginMain</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.__callback<span style="color: black;">&#41;</span>.<span style="color: black;">contents</span>
    <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">AttributeError</span>:
      <span style="color: #008000;">self</span>.__lib.<span style="color: black;">main</span>.<span style="color: black;">argtypes</span> = <span style="color: black;">&#91;</span>audiomaster_callback, <span style="color: black;">&#93;</span>
      <span style="color: #008000;">self</span>.__lib.<span style="color: black;">main</span>.<span style="color: black;">restype</span> = POINTER<span style="color: black;">&#40;</span>AEffect<span style="color: black;">&#41;</span>
      <span style="color: #008000;">self</span>.__effect = <span style="color: #008000;">self</span>.__lib.<span style="color: black;">main</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.__callback<span style="color: black;">&#41;</span>.<span style="color: black;">contents</span></pre></td></tr></table></div><p>The main VST function must be called through a dispatch function available in the structure. I will only show of them:</p><h4>Rewritting the minihost sample</h4><p>The minihost sample prints some details of the VST plugin and then displays them. Here, I&#8217;ll do the same, but I&#8217;ve processed a sine-sweep signal and then display the result. If the 64bits processing is available, I will use it.</p><p>Here are some info that are displayed prior to the processing for the <a
href="http://bigtick.pastnotecut.org/index.php?action=PROD&#038;pcode=200&#038;lang=EN">Big Tick NastyShaper plugin</a>:</p><pre>
Plugin name:
Vendor name:
Product name:
numPrograms = 16
numParams = 11
numInputs = 2
numOutputs = 2

Program 000: Nasty Shaper
(...)
Program 015: Nasty Shaper
Param 000: Pre-Gain [0.00 dB] (normalized = 0.500000)
Param 001: Post-Gain [0.00 dB] (normalized = 0.500000)
Param 002: WS1 [25.00  %] (normalized = 0.250000)
Param 003: WS2 [35.00  %] (normalized = 0.350000)
Param 004: WS3 [45.00  %] (normalized = 0.450000)
Param 005: WS4 [55.00  %] (normalized = 0.550000)
Param 006: WS5 [20.00  %] (normalized = 0.200000)
Param 007: WS6 [60.00  %] (normalized = 0.600000)
Param 008: WS7 [30.00  %] (normalized = 0.300000)
Param 009: WS8 [40.00  %] (normalized = 0.400000)
Param 010: Oversample [OFF  ] (normalized = 0.000000)
Testing with floats (32bits)
</pre><p>Here is a graphical result. On the first row, I display the original input, on the second row is the associated output.</p><p><center><a
href="http://matt.eifelle.com/wp-content/uploads/2010/02/Big-Tick-NastyShaper.png"><img
src="http://matt.eifelle.com/wp-content/uploads/2010/02/Big-Tick-NastyShaper-300x225.png" alt="" title="Big Tick NastyShaper spectrogram" width="300" height="225" class="aligncenter size-medium wp-image-1101" /></a</center></p><h4>To be continued</h4><p>The whole 2.4 standard is not yet wrapped, far from it. There is still much to do to be able to use this wrapper class for every plugin (how do I load an impulse for a convolution reverb for instance), but it can still help analyze how a lot of plugins change the audio signal.</p><p>Some plugins are not working yet (mainly because every input and output must be connected), but I&#8217;m working on it <img
src='http://matt.eifelle.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p>The code is available on <a
href="https://launchpad.net/pyvst">Launchpad</a>.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/U3PMDCwKATcX33WCbRMfzsoVVYA/0/da"><img src="http://feedads.g.doubleclick.net/~a/U3PMDCwKATcX33WCbRMfzsoVVYA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/U3PMDCwKATcX33WCbRMfzsoVVYA/1/da"><img src="http://feedads.g.doubleclick.net/~a/U3PMDCwKATcX33WCbRMfzsoVVYA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/eifelle/CPPV/~4/zUUBz7oNrHY" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2010/02/09/pyvst-another-ctypes-based-python-vst-wrapper/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://matt.eifelle.com/2010/02/09/pyvst-another-ctypes-based-python-vst-wrapper/</feedburner:origLink></item> <item><title>Annoucement: scikits.optimization 0.1</title><link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/HBRM0UB01CE/</link> <comments>http://matt.eifelle.com/2010/02/02/annoucement-scikits-optimization-0-1/#comments</comments> <pubDate>Tue, 02 Feb 2010 08:36:18 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Generic optimizers]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Annoucement]]></category> <category><![CDATA[numpy]]></category> <category><![CDATA[Optimization]]></category> <category><![CDATA[scikit]]></category><guid isPermaLink="false">http://matt.eifelle.com/?p=1093</guid> <description><![CDATA[I&#8217;m pleased to announce the first release of one of my projects. This scikits is based on a generic framework that can support unconstrained cost function minimization. It is based on a separation principle and is also completely object oriented.
Several optimizers are available:Nelder-Mead or simplex minimization
Unconstrained gradient-based minimizationThe usual criterias can be used:Iteration limit
Parameter change [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m pleased to announce the first release of one of my projects. This scikits is based on a generic framework that can support unconstrained cost function minimization. It is based on a separation principle and is also completely object oriented.</p><p>Several optimizers are available:</p><ul><li>Nelder-Mead or simplex minimization</li><li>Unconstrained gradient-based minimization</li></ul><p>The usual criterias can be used:</p><ul><li>Iteration limit</li><li>Parameter change (relative and absolute)</li><li>Cost function changer (relative and absolute)</li><li>Composite criterion generation (AND/OR)</li></ul><p>Different direction searches are available:</p><ul><li>Gradient</li><li>Several conjugate-gradient (Fletcher-Reeves, &#8230;)</li><li>Decorators for selecting part of the gradient</li><li>Marquardt step</li></ul><p>Finally several line searches (1D minimization) were coded:</p><ul><li>Fibonacci and gold number methods (exact line searches)</li><li>Wolfe-Powell soft and strong rules</li><li>Goldstein line search</li><li>Cubic interpolation</li></ul><p>Additional helper classes can be used:</p><ul><li>Finite difference differentation (central and forward)</li><li>Quadratic cost (for least square estimation)</li><li>Levenberg-Marquardt approximation for least square estimation</li></ul><p>Although it is the 0.1 version, the code is quite stable and is used in the <a
href="http://sourceforge.net/projects/scikit-learn">learn scikit</a>.</p><p>The package can be easy-installed or can be found on <a
href="http://pypi.python.org/pypi/scikits.optimization/0.1">PyPI</a>.</p><p>Several tutorials are available or will be available on the future at the following locations:</p><ul><li><a
href="http://matt.eifelle.com/tag/optimization/">http://matt.eifelle.com/tag/optimization/</a></li><li><a
href="http://projects.scipy.org/scikits/wiki/Optimization/tutorial">http://projects.scipy.org/scikits/wiki/Optimization/tutorial</a></li></ul>
<p><a href="http://feedads.g.doubleclick.net/~a/IgXzNNEfmd3IhDDfz4d7we9LVvk/0/da"><img src="http://feedads.g.doubleclick.net/~a/IgXzNNEfmd3IhDDfz4d7we9LVvk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/IgXzNNEfmd3IhDDfz4d7we9LVvk/1/da"><img src="http://feedads.g.doubleclick.net/~a/IgXzNNEfmd3IhDDfz4d7we9LVvk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/eifelle/CPPV/~4/HBRM0UB01CE" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2010/02/02/annoucement-scikits-optimization-0-1/feed/</wfw:commentRss> <slash:comments>2</slash:comments> <feedburner:origLink>http://matt.eifelle.com/2010/02/02/annoucement-scikits-optimization-0-1/</feedburner:origLink></item> <item><title>Fun book: Dreaming In Code</title><link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/DKxK9EzW-5U/</link> <comments>http://matt.eifelle.com/2010/01/26/fun-book-dreaming-in-code/#comments</comments> <pubDate>Tue, 26 Jan 2010 08:29:27 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Book review]]></category> <category><![CDATA[Open source]]></category><guid isPermaLink="false">http://matt.eifelle.com/?p=1085</guid> <description><![CDATA[I&#8217;ve decided for once to read a novel about software. This book is about the story of Chandler, a piece of software that was a dream that didn&#8217;t quite came true.Content and opinions
The audience of this book is mainly people that do not know much about software but that want to know about a story [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve decided for once to read a novel about software. This book is about the story of Chandler, a piece of software that was a dream that didn&#8217;t quite came true.<br
/> <span
id="more-1085"></span></p><h4>Content and opinions</h4><p>The audience of this book is mainly people that do not know much about software but that want to know about a story that drove people for several years. There are a lot of fkashbacks inside software history or parenthesises on software.</p><p>Also the book is acclaimed by the critics, I didn&#8217;t find it that much interesting. It is very difficult to read the whole book, as the the thread goes from history to context to side stories to the main stories, sometimes after each parenthesis. This is tiresome, and is a drawback for a good book when you want to relax a little bit. Here, you won&#8217;t be able to do so, you&#8217;ll have to keep focusing on what the author wants to tell you (and that&#8217;s not really easy).</p><h4>Conclusion</h4><p>Not as much fun as I expected, but still, there are some passages that may be worth it for managers that don&#8217;t want to read a book on software project management. I won&#8217;t recommend it, but you may still want to learn from other people&#8217;s mistakes.</p><div
style="border: 1px solid #000; padding: 5px; margin-bottom: 15px; background: url(http://matt.eifelle.com/wp-content/uploads/2009/12/BN_Logo_3tier.jpg) right bottom no-repeat #ffffff;"> <a
rel="nofollow" href="http://r.popshops.com/pp/71454/dreaming-in-code-two-dozen-programmers-three-years-4-732-bugs-and-one-quest-for-"><img
style="width: 150px;" src="http://images.barnesandnoble.com/images/22210000/22210186.JPG" border="0" alt="Dreaming in Code: Two Dozen Programmers, Three Years, 4, 732 Bugs, and One Quest for Transcendent Software" /></a><br
/> <a
rel="nofollow" href="http://r.popshops.com/pp/71454/dreaming-in-code-two-dozen-programmers-three-years-4-732-bugs-and-one-quest-for-">Dreaming in Code: Two Dozen Programmers, Three Years, 4, 732 Bugs, and One Quest for Transcendent Software</a><br
/> Price: $11.92</div><div
class="subcolumns"><div
style="border: 1px solid #000; padding: 5px; margin-bottom: 15px; background: url(http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/amazon_US_small.gif) right bottom no-repeat #ffffff;"><div
style="width: 50px; float: left; margin-right: 5px;"> <a
href="http://www.amazon.com/exec/obidos/ASIN/1400082471/masbl03-20" target="_blank"><img
src="http://ecx.images-amazon.com/images/I/51Klh6hn1KL._SL75_.jpg" width="50" height="75" border="0" /></a></div><div><p><a
href="http://www.amazon.com/exec/obidos/ASIN/1400082471/masbl03-20" target="_blank">Dreaming in Code: Two Dozen Programmers, Three Years, 4,732 Bugs, and One Quest for Transcendent Software</a> (Paperback)<br
/> <span
style="font-size: 0.8em;">by <strong>Scott Rosenberg</strong></span><br
/> ISBN: 1400082471</p><p><strong>Price:</strong> <span
style="color: #990000; font-weight: bold;">USD 9.86</span><br
/> <strong>53 used &#038; new</strong> available from <span
style="color: #990000; font-weight: bold;">USD 5.06</span></p><p> <img
src="http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/stars-4.gif" class="asa_rating_stars" /> | 4 | 70</div><div
style="clear: both;"></div></div></div>
<p><a href="http://feedads.g.doubleclick.net/~a/vn1OhALF_HAu-INaXBWmDrTSGao/0/da"><img src="http://feedads.g.doubleclick.net/~a/vn1OhALF_HAu-INaXBWmDrTSGao/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/vn1OhALF_HAu-INaXBWmDrTSGao/1/da"><img src="http://feedads.g.doubleclick.net/~a/vn1OhALF_HAu-INaXBWmDrTSGao/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/eifelle/CPPV/~4/DKxK9EzW-5U" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2010/01/26/fun-book-dreaming-in-code/feed/</wfw:commentRss> <slash:comments>1</slash:comments> <feedburner:origLink>http://matt.eifelle.com/2010/01/26/fun-book-dreaming-in-code/</feedburner:origLink></item> <item><title>Book review: Software Project Secrets: Why Software Projects Fail</title><link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/Rn45JC8jzNs/</link> <comments>http://matt.eifelle.com/2010/01/19/book-review-software-project-secrets-why-software-projects-fail/#comments</comments> <pubDate>Tue, 19 Jan 2010 08:03:46 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[APress]]></category> <category><![CDATA[Book review]]></category> <category><![CDATA[Development process]]></category><guid isPermaLink="false">http://matt.eifelle.com/?p=1080</guid> <description><![CDATA[There are more stories of failed software projects than of failed insert_another_field projects. But why is that so? Of course, software management is young, contrary to the other fields, but there are a set of management practices that should help project managers in their jobs. Why are they failing? Is it because they are not [...]]]></description> <content:encoded><![CDATA[<p>There are more stories of failed software projects than of failed <em>insert_another_field</em> projects. But why is that so? Of course, software management is young, contrary to the other fields, but there are a set of management practices that should help project managers in their jobs. Why are they failing? Is it because they are not applied? Because the field is really too young? Or something else?<br
/> <span
id="more-1080"></span></p><h4>Content and opinions</h4><p>The first part is dedicated to the reasons why a software project can fail. It starts with 12 reasons of why software is different than other fields. This implies some assumptions that can differ from the usual project management. The last chapter is a simulation of what a failing software project is. All in all, the main message passes, but I think it is too harsh. The underlying idea is that software is different than all the other fields, but in fact, it may be all the same (at least on the points that were underlined): building a bridge is something we know how to do through usual management, but it can still run late/too expensive/&#8230; Besides, the example is overdone. It cumulates all the typical mistakes that we know now how to avoid.</p><p>The second part gives the pieces of advice to fix what the first part uncovered. Three agile processes are explained, then tools to budget with one of these processes. the last is the example of the first part reloaded with agile methods. I agree that agile methods are an answer to the software management project, but each time software management is really opposed to usual management. There are issues that are still really different in software projects: defining the needs of the users. When you build a bridge or when you build a house, you know what you want. You know the number of ways, or the number of doors/windows/rooms, &#8230; In software projects, you don&#8217;t know how many doors you need. Another issue is that people think that software is easy to do, so it&#8217;s easy to add something else (mainly because it is mandatory&#8230; or not).</p><h4>Conclusion</h4><p>If the book is really easy to read, there are some shortcuts that did bother me: the two examples are caricatures of reality (not even a real example where things went well or really bad, they are a story), and software management is also exagerated compared to project management. Perhaps the real conclusion is this one: exageration. Software project management is too difficult to be explained by a caricature: it may lead to the opposite effect.</p><div
style="border: 1px solid #000; padding: 5px; margin-bottom: 15px; background: url(http://matt.eifelle.com/wp-content/uploads/2009/12/BN_Logo_3tier.jpg) right bottom no-repeat #ffffff;"><a
rel="nofollow" href="http://r.popshops.com/pp/69813/the-passionate-<a rel="nofollow" href="http://r.popshops.com/pp/70573/software-project-secrets-why-software-projects-fail"><img
style="width: 150px;" src="http://images.barnesandnoble.com/images/17380000/17382509.JPG" border="0" alt="Software Project Secrets: Why Software Projects Fail" /></a><br
/> <a
rel="nofollow" href="http://r.popshops.com/pp/70573/software-project-secrets-why-software-projects-fail">Software Project Secrets: Why Software Projects Fail</a><br
/> Price: $49.49</div><div
class="subcolumns"><div
style="border: 1px solid #000; padding: 5px; margin-bottom: 15px; background: url(http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/amazon_US_small.gif) right bottom no-repeat #ffffff;"><div
style="width: 49px; float: left; margin-right: 5px;"> <a
href="http://www.amazon.com/exec/obidos/ASIN/1590595505/masbl03-20" target="_blank"><img
src="http://ecx.images-amazon.com/images/I/51dgzhEfKJL._SL75_.jpg" width="49" height="75" border="0" /></a></div><div><p><a
href="http://www.amazon.com/exec/obidos/ASIN/1590595505/masbl03-20" target="_blank">Software Project Secrets: Why Software Projects Fail (Expert&#8217;s Voice)</a> (Hardcover)<br
/> <span
style="font-size: 0.8em;">by <strong>George Stepanek</strong></span><br
/> ISBN: 1590595505</p><p><strong>Price:</strong> <span
style="color: #990000; font-weight: bold;">USD 21.26</span><br
/> <strong>44 used &#038; new</strong> available from <span
style="color: #990000; font-weight: bold;">USD 1.97</span></p><p> <img
src="http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/stars-4.5.gif" class="asa_rating_stars" /> | 4.5 | 6</div><div
style="clear: both;"></div></div></div>
<p><a href="http://feedads.g.doubleclick.net/~a/V4bt0U-JKewhHyMuYnPYLkLScxg/0/da"><img src="http://feedads.g.doubleclick.net/~a/V4bt0U-JKewhHyMuYnPYLkLScxg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/V4bt0U-JKewhHyMuYnPYLkLScxg/1/da"><img src="http://feedads.g.doubleclick.net/~a/V4bt0U-JKewhHyMuYnPYLkLScxg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/eifelle/CPPV/~4/Rn45JC8jzNs" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2010/01/19/book-review-software-project-secrets-why-software-projects-fail/feed/</wfw:commentRss> <slash:comments>1</slash:comments> <feedburner:origLink>http://matt.eifelle.com/2010/01/19/book-review-software-project-secrets-why-software-projects-fail/</feedburner:origLink></item> <item><title>Thinking of good practices when developing with accelerators</title><link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/DrGEqxlVdKk/</link> <comments>http://matt.eifelle.com/2010/01/05/thinking-of-good-practices-when-developing-with-accelerators/#comments</comments> <pubDate>Tue, 05 Jan 2010 08:48:57 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[C++]]></category> <category><![CDATA[Design Patterns]]></category> <category><![CDATA[Development process]]></category> <category><![CDATA[Distributed Computing]]></category> <category><![CDATA[High Performance Computing]]></category> <category><![CDATA[Tools]]></category> <category><![CDATA[CUDA]]></category> <category><![CDATA[Fortran]]></category> <category><![CDATA[Grid computing]]></category> <category><![CDATA[HMPP]]></category> <category><![CDATA[MPI]]></category> <category><![CDATA[Multithreaded applications]]></category> <category><![CDATA[Scientific computing]]></category><guid isPermaLink="false">http://matt.eifelle.com/?p=997</guid> <description><![CDATA[Due to the end of the free lunch, manufacturers started to provide differents processing units and developers started to go parallel. It&#8217;s kind of back to the future, as accelerators existed before today (the x87 FPU started as a coprocessor, for instance). If those accelerators were integrated into the CPU, their instruction set were also.
Today&#8217;s [...]]]></description> <content:encoded><![CDATA[<p>Due to the end of the <a
href="http://www.gotw.ca/publications/concurrency-ddj.htm">free lunch</a>, manufacturers started to provide differents processing units and developers started to go parallel. It&#8217;s kind of back to the future, as accelerators existed before today (the x87 FPU started as a coprocessor, for instance). If those accelerators were integrated into the CPU, their instruction set were also.</p><p>Today&#8217;s accelerators are not there yet. The tools are not ready yet (code translators) and usual programming practices may not be adequate. All the ecosystem will evolve, accelerators will change (GPUs are the main trend, but they will be different in a few years), so what you will do today needs to be shaped with these changes in mind. How is it possible to do so? Is it even possible?<br
/> <span
id="more-997"></span></p><h4>Available code translators</h4><p>Code translators are the easiest path to solution. I know two of them.</p><p>The first is the <a
href="http://www.pgroup.com/resources/accel.htm">PGI compiler</a>. It only supports CUDA and the Fortran and C99 language. I didn&#8217;t use it yet, also I plan of testing it in the near future. It is based on pragmas, and the compiler generates the CUDA microcode.</p><p>The second solution is <a
href="http://www.caps-entreprise.com/fr/page/index.php?id=49&amp;p_p=36">HMPP</a>. It supports more than just CUDA (also CAL/IL or OpenCL) and Fortran/C (also Java now). As the PGI compiler, it is based on pragmas, and a excellent thing is that it detects the available accelerators and launches the correct kernel (if you authorized it) or the original code. You can also modify the generated code to put your own (you can tune the code for instance, which may give you an additional x2 factor). Unfortunately, it is not possible to call functions inside the parallelized kernels, which means that only simple or badly-written (too many lines or duplicated code) kernels can be called. I think this is the same for the PGI compiler.</p><p>It seems that code translators still need work:</p><ul><li>only few accelerators are supported (CUDA, and sometimes CAL/IL or OpenCL),</li><li>almost no langage (Fortran/C/Java, a lot of Virtual Machines should be able to use them natively, without developers using specific tools),</li><li>only one function can be parallelized at a time.</li></ul><p>The last point is currently the biggest issue. You need to cut your function int pieces to have clean code and a good portability/evolutivity for the future.</p><p>This is why one still need to program a lot for those accelerators, and so we need to adapt our programming practices, develop in the accelerators&#8217; native langages (even if we know that they may disappear in a few years).</p><h4>Developping your own &#8220;tool chain&#8221; for accelerators</h4><p>For accelerators, there are a lot of things that needs to be done each time: copying some data, computing and getting some data back. These are the steps that code translators automate, in fact it is a common practice to use tools to automate stuff. The issue is that complex kernels are not supported by those translators. So what?</p><p>Creating automatic functions that will copy the data you need is in fact very common in metaprogramming. Coding the kernel on an accelerator is in fact not that difficult: the manufacturers provide the needed compilers (that&#8217;s what nVidia does and the success of the tool chain cannot be denied), and this is really the cornerstone. One has to write more code, some parts are less portable (because they are written in one of the accelerator&#8217;s languages), but in the end, with metaprogramming, the code can be better tuned, enhanced and read. This is the leverage of the accelerators.</p><h4>Conclusion</h4><p>Why do we care developing for accelerators? We know that they will go away. Before they do, they are the only way of speeding up our software. Code translators are the best tools to develop in a portable way, but they need time to support more accelerators, languages and method of programming. When CPUs will be on a par with accelerators, their progress will help compilers to target them correctly. It&#8217;s just a matter of time.<br
/> Meanwhile, metaprogrammin is the next best solution to automate processes that code translators cannot support yet.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/PGxp42lmHDi_9R_1LTaYPxVqjdQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/PGxp42lmHDi_9R_1LTaYPxVqjdQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/PGxp42lmHDi_9R_1LTaYPxVqjdQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/PGxp42lmHDi_9R_1LTaYPxVqjdQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/eifelle/CPPV/~4/DrGEqxlVdKk" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2010/01/05/thinking-of-good-practices-when-developing-with-accelerators/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://matt.eifelle.com/2010/01/05/thinking-of-good-practices-when-developing-with-accelerators/</feedburner:origLink></item> <item><title>Book review: The Passionate Programmer</title><link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/OJLs_WhxRIw/</link> <comments>http://matt.eifelle.com/2009/12/29/book-review-the-passionate-programmer/#comments</comments> <pubDate>Tue, 29 Dec 2009 08:53:16 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Book review]]></category> <category><![CDATA[Pragmatic Bookshelf]]></category><guid isPermaLink="false">http://matt.eifelle.com/?p=993</guid> <description><![CDATA[It&#8217;s all about passion. The second edition of the book saw its title changed (it was called My Job Went To India) to something less depressing and more adequate to what we all should do: be passionate about our work and be happy to do it (it also applies to other job than developers!).Content and [...]]]></description> <content:encoded><![CDATA[<p>It&#8217;s all about passion. The second edition of the book saw its title changed (it was called <u>My Job Went To India</u>) to something less depressing and more adequate to what we all should do: be passionate about our work and be happy to do it (it also applies to other job than developers!).<br
/> <span
id="more-993"></span></p><h4>Content and opinions</h4><p>The book consists of a lot of pieces of advice (the brand of Pragmatic Bookshelf, the publisher), not too many so as not to be bored at the end.</p><p>It starts with the field (i.e. language and technology) you may focus on. Either you want to be at the edge, or rely on a mature technology. It depends, but there are some specifics you should know if you want to bloom.<br
/> The second aspect/part is dedicated to your network: how do you get information and how do you give it? Who should you be working with? All these aspects help you be the best at what you do.<br
/> When you actually work, there are some advice to make you really essential to your company: speak your mind, read the leader&#8217;s one, make your job profitabe to your company, &#8230;<br
/> The fourth part is about marketing. It is perhaps surprising, but you have to sell yourself. You may be the best in your field, have an excellent network and are essential to your company, if it doesn&#8217;t know it, you&#8217;re screwed. Sell yourself, this will be also great if you want/have to switch jobs.<br
/> Your carrier path is not clear with all the technology changes, with the current economical situation. You have to ready yourself to this, which is what the last part is all about: prospects and your future.</p><p>Each time the chapter is clear and goes straight to the point. The content is also explained with music metaphors, as the author is also a musician. Other well-known people give their opinion on some chapters of the book, each time shedding a new light on our own situation.</p><h4>Conclusion</h4><p>Pragmatic advice starts with obvious advice. If the content seems rather obvious (especially if you want to be better at your job, you may have applied a lot of the pieces of advice of the book), it&#8217;s always good to have it reminded, as we tend to not see the forest of the trees.</p><p>The main idea is to be at the edge. Learn from others, listen to the trends and the people who make them, and act accordingly.</p><div
style="border: 1px solid #000; padding: 5px; margin-bottom: 15px; background: url(http://matt.eifelle.com/wp-content/uploads/2009/12/BN_Logo_3tier.jpg) right bottom no-repeat #ffffff;"> <a
rel="nofollow" href="http://r.popshops.com/pp/69813/the-passionate-programmer-creating-a-remarkable-career-in-software-development"><img
style="width: 150px;" src="http://images.barnesandnoble.com/images/37010000/37010184.JPG" border="0" alt="The Passionate Programmer: Creating a Remarkable Career in Software Development" /></a><br
/> <a
rel="nofollow" href="http://r.popshops.com/pp/69813/the-passionate-programmer-creating-a-remarkable-career-in-software-development">The Passionate Programmer: Creating a Remarkable Career in Software Development</a><br
/> Price: $20.47</div><div
class="subcolumns"><div
style="border: 1px solid #000; padding: 5px; margin-bottom: 15px; background: url(http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/amazon_US_small.gif) right bottom no-repeat #ffffff;"><div
style="width: 50px; float: left; margin-right: 5px;"> <a
href="http://www.amazon.com/exec/obidos/ASIN/1934356344/masbl03-20" target="_blank"><img
src="http://ecx.images-amazon.com/images/I/41fyjTVARFL._SL75_.jpg" width="50" height="75" border="0" /></a></div><div><p><a
href="http://www.amazon.com/exec/obidos/ASIN/1934356344/masbl03-20" target="_blank">The Passionate Programmer: Creating a Remarkable Career in Software Development (Pragmatic Life)</a> (Paperback)<br
/> <span
style="font-size: 0.8em;">by <strong>Chad Fowler</strong></span><br
/> ISBN: 1934356344</p><p><strong>Price:</strong> <span
style="color: #990000; font-weight: bold;">USD 16.29</span><br
/> <strong>41 used &#038; new</strong> available from <span
style="color: #990000; font-weight: bold;">USD 14.60</span></p><p> <img
src="http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/stars-4.5.gif" class="asa_rating_stars" /> | 4.5 | 28</div><div
style="clear: both;"></div></div></div>
<p><a href="http://feedads.g.doubleclick.net/~a/pZffRKOeIwnytIedc_XNjvm67tY/0/da"><img src="http://feedads.g.doubleclick.net/~a/pZffRKOeIwnytIedc_XNjvm67tY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/pZffRKOeIwnytIedc_XNjvm67tY/1/da"><img src="http://feedads.g.doubleclick.net/~a/pZffRKOeIwnytIedc_XNjvm67tY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/eifelle/CPPV/~4/OJLs_WhxRIw" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2009/12/29/book-review-the-passionate-programmer/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://matt.eifelle.com/2009/12/29/book-review-the-passionate-programmer/</feedburner:origLink></item> <item><title>Optimization scikit: Starting with gradient-free simple optimization</title><link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/KwLfKaCxSTw/</link> <comments>http://matt.eifelle.com/2009/12/22/optimization-scikit-starting-with-gradient-free-simple-optimization/#comments</comments> <pubDate>Tue, 22 Dec 2009 08:01:25 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Generic optimizers]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[numpy]]></category> <category><![CDATA[Optimization]]></category> <category><![CDATA[scikit]]></category> <category><![CDATA[scipy]]></category><guid isPermaLink="false">http://matt.eifelle.com/?p=999</guid> <description><![CDATA[Some months ago, I&#8217;ve finished my manifold learning posts serie. As support for the manifold learning toolkit, I&#8217;ve also developed an optimization framework, which I&#8217;ll be blogging about, starting now.The goal was to provide a general way of designing the optimization procedure one needed for his cost function. The development is more or less stopped [...]]]></description> <content:encoded><![CDATA[<p>Some months ago, I&#8217;ve finished my <a
href="http://matt.eifelle.com/category/python/manifold-learning/">manifold learning posts serie</a>. As support for the manifold learning toolkit, I&#8217;ve also developed <a
href="http://projects.scipy.org/scikits/wiki/Optimization">an optimization framework</a>, which I&#8217;ll be blogging about, starting now.<br
/> <span
id="more-999"></span><br
/> The goal was to provide a general way of designing the optimization procedure one needed for his cost function. The development is more or less stopped at the moment, but it does not mean that it is not usable, as you may have seen in the manifold learning posts.</p><h4>A function to optimize</h4><p>The function I&#8217;ll be trying to optimize is the following one:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p999code7'); return false;">View Code</a> PYTHON</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p9997"><td
class="code" id="p999code7"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> Function<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
  <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__call__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, x<span style="color: black;">&#41;</span>:
    t = numpy.<span style="color: black;">sqrt</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>x<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">*</span>x<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>+x<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">*</span>x<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> -numpy.<span style="color: black;">sinc</span><span style="color: black;">&#40;</span>numpy.<span style="color: black;">pi</span> <span style="color: #66cc66;">*</span> t<span style="color: black;">&#41;</span></pre></td></tr></table></div><p>This function is a 2D sinc function for which I try to find the maximum, which is in (0,0). To do so, I&#8217;ll be minimizing the opposite function.</p><div
id="attachment_1007" class="wp-caption aligncenter" style="width: 310px"><a
href="http://matt.eifelle.com/wp-content/uploads/2009/12/2d-sinc2d.png"><img
class="size-medium wp-image-1007" title="2D display of the sinc() function" src="http://matt.eifelle.com/wp-content/uploads/2009/12/2d-sinc2d-300x226.png" alt="" width="300" height="226" /></a><p
class="wp-caption-text">2D display of the sinc() function</p></div><div
id="attachment_1010" class="wp-caption aligncenter" style="width: 310px"><a
href="http://matt.eifelle.com/wp-content/uploads/2009/12/3d-sinc2d.png"><img
class="size-medium wp-image-1010" title="3D display of the sinc() function" src="http://matt.eifelle.com/wp-content/uploads/2009/12/3d-sinc2d-300x226.png" alt="" width="300" height="226" /></a><p
class="wp-caption-text">3D display of the sinc() function</p></div><h4>The simplex method</h4><p>The simplex method, or polytope or Nelder Mead method, uses a simplex/polytope in the parameters space to search for the global minimum of a function.</p><p>The set of current points is sorted, and a mean parameter point is computed with the n best points. The symmetric point of the worst/unsued point with respect to the mean point is compared to the current set, and depending on the result, additional steps of expansion or contraction are taken.</p><p>At the end, unless the symmetric point, the expanded or the contracted points do not enhance the solution, the mean cost of the simplex points is always enhanced.</p><h4>The polytope optimizer usage</h4><p>The framework is based on several principles I&#8217;ll will talk about later. I will only explain what I will be doing.</p><p>Once the function is defined, I&#8217;m set to optimize it:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p999code8'); return false;">View Code</a> PYTHON</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p9998"><td
class="code" id="p999code8"><pre class="python" style="font-family:monospace;">  <span style="color: #ff7700;font-weight:bold;">from</span> scikits.<span style="color: black;">optimization</span>.<span style="color: black;">optimizer</span> <span style="color: #ff7700;font-weight:bold;">import</span> PolytopeOptimizer
  <span style="color: #ff7700;font-weight:bold;">from</span> scikits.<span style="color: black;">optimization</span> <span style="color: #ff7700;font-weight:bold;">import</span> criterion
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">from</span> function <span style="color: #ff7700;font-weight:bold;">import</span> Function
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">import</span> numpy
&nbsp;
  optimizer = PolytopeOptimizer<span style="color: black;">&#40;</span>function = Function<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>,
                                x0 = numpy.<span style="color: #dc143c;">random</span>.<span style="color: black;">randn</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">3</span>, <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">*</span> .5,
                                criterion = criterion.<span style="color: black;">OrComposition</span><span style="color: black;">&#40;</span>criterion.<span style="color: black;">RelativeParametersCriterion</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.00001</span><span style="color: black;">&#41;</span>, criterion.<span style="color: black;">IterationCriterion</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">20</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
  optimizer.<span style="color: black;">optimize</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
  <span style="color: #ff7700;font-weight:bold;">print</span> numpy.<span style="color: black;">mean</span><span style="color: black;">&#40;</span>optimizer.<span style="color: black;">state</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'new_parameters'</span><span style="color: black;">&#93;</span>, axis=<span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span></pre></td></tr></table></div><p>The creation of the optimizer is done by calling <em>PolytopeOptimizer</em> with several arguments:</p><ul><li><em>function</em> which is the instance of the function to optimize</li><li><em>x0</em> is the array of starting points (n+1 points of n-dimension points)</li><li><em>criterion</em> is the stopping criterion, a complex criterion indicating to stop when some iterations are done or if the set of optimal points does not change much</li></ul><p>Then, I can call the actual optimization, and display the mean of the set of optimal points.</p><p>To end this post, here is a video of the evolution of the optimization.</p><p><object
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param
name="allowFullScreen" value="true" /><param
name="allowscriptaccess" value="always" /><param
name="src" value="http://www.youtube.com/v/Aqqo7FAE0SQ&amp;hl=fr_FR&amp;fs=1&amp;" /><param
name="allowfullscreen" value="true" /><embed
type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/Aqqo7FAE0SQ&amp;hl=fr_FR&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p><p>All the code is available freely on <a
href="http://svn.scipy.org/svn/scikits/trunk/optimization/">the scikits SVN</a> and <a
href="https://bazaar.launchpad.net/~matthieu-brucher/+junk/optimization-tutorials/">the tutorials repository on Launchpad</a>.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/0xGvm0j_0pbiFMDuPbXAvv5ppLQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/0xGvm0j_0pbiFMDuPbXAvv5ppLQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/0xGvm0j_0pbiFMDuPbXAvv5ppLQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/0xGvm0j_0pbiFMDuPbXAvv5ppLQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/eifelle/CPPV/~4/KwLfKaCxSTw" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2009/12/22/optimization-scikit-starting-with-gradient-free-simple-optimization/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://matt.eifelle.com/2009/12/22/optimization-scikit-starting-with-gradient-free-simple-optimization/</feedburner:origLink></item> <item><title>Book review: What Would Google Do?</title><link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/AVtVXEXayO8/</link> <comments>http://matt.eifelle.com/2009/12/15/book-review-what-would-google-do/#comments</comments> <pubDate>Tue, 15 Dec 2009 08:48:39 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Book review]]></category> <category><![CDATA[HarperCollins]]></category> <category><![CDATA[Google]]></category><guid isPermaLink="false">http://matt.eifelle.com/?p=896</guid> <description><![CDATA[Is there a Google way of doing things? How did Google become the company we know? Did the society change its way of consuming? These are the kind of questions that this book tries to answer. Jeff Jarvis, the author, has a blog on which he writes about his book and the issues of the [...]]]></description> <content:encoded><![CDATA[<p>Is there a Google way of doing things? How did Google become the company we know? Did the society change its way of consuming? These are the kind of questions that this book tries to answer. Jeff Jarvis, the author, has <a
href="http://www.buzzmachine.com/">a blog</a> on which he writes <a
href="http://www.buzzmachine.com/what-would-google-do/">about his book and the issues of the new economy</a>.<br
/> <span
id="more-896"></span><br
/> The title of the book is a pun with the famous WWJD in the Christian world. It may seems that Google will be replacing God, but it isn&#8217;t about that. I was curious about this (that&#8217;s a reason why I borrowed the book), but it is more about specific Google actions than about some kind of religious approach. In fact, Google approach is similar to Jesus&#8217;s, but perhaps more pragmatic.</p><h4>Content and opinions</h4><p>The book is split in two parts: what Google does and what it may be doing in several different industries.</p><p>The laws of Google are what steers Google (or at least it what is steered them at some point). Focusing on client needs, decentralizing your industry, this is basically the core of Google. The book describes the implications of this on the client behavior, and on how information flows on the Web: the Dell experience is blatant is that matter. In this part, Jeff Jarvis says that almost everyone can use this approach, but I&#8217;m not so sure. Jeff uses the Google approach to money, saying that you can earn enough money through moneytizing your website through advertisement. With the current crisis, I don&#8217;t know how this pattern can be applied to everyone. At some point, you will still need a lot of classic webstores for web journals/magazines. The current discussion between News Corp, Google and Microsoft is clear about that: even with the visitors Google provides, News Corp does not make enough money. Well, it also be that News Corp is not embracing change as it should be. I still think that not everyone/every industry (that sells content) can make a living with just moneytizing.</p><p>Still, the ideas are very clever and a lot of things can be used for anyone (like giving power to the clients to help you create a better product, warranty service, &#8230;)</p><p>The second part tackles several industries that may benefit from the Google way. The first and obvious ones are the movies and music ones. Needless to say that their path is currently exactly this opposite, and for the music industry this means far less customers. In France we have the same issues, with these industries trying to keep their customers the wrong way. They alienate us, and this means that we run from them. Indeed, a Google approach is better suited. Although I don&#8217;t agree with Jeff Jarvis on the Intellectual Property (the authors must make a living, I&#8217;m not talking about the majors and the labels that can make money in different ways), a half-way between the current status and its proposal may lead to a far better place to watch movies and to listen to enjoyable music (it&#8217;s not the case at the moment at all).</p><p>Books are also an industry that may change, but they are still many pitfalls in the current approach. Jeff Jarvis praises the Amazon model, but for eBooks, I think it is really lame. The price for an eBook is the same as the price for a real book, there are no free updates (this is something an eBook would benefit from, I hate to see one of my books being superseded by a new version) and with DRMs, the market is closed. Jeff Jarvis states that eBooks are great because they can last longer than books. For the moment, thanks to DRMs (and Amazon&#8217;s Kindle), I don&#8217;t think that an eBook in another format than a pdf can last longer than the life of the Kindle/Nook/&#8230; it uses. When the eBook market will be opened, I think the situation will evolve. It&#8217;s sad that a firm that is praised by Jeff Jarvis for its Google attitude fails so short in this new market.</p><p>There are other chapters for other domains, the one that was the most astonishing is the energy one. The rest is decent IMHO, so I will not speak about them. Google approach to energy is to find a new source of energy (hurrah, but everyone is doing the same). The issue is that Google almost needs an exponential supply, which cannot be. So what does it say? I think the Google way is the right way for the next decade, at least. After that, we will face the end of a Ponzi scheme of some sort with the Google way (moneytizing, network and dillution). Google was the first on this scheme, and it benefits from it. The followers do not earn as much, the next ones even less, &#8230; The energy wall might be what will hit Google first: the next energy source is not yet discovered, and to fulfill its need, Google will still have to wait several years, years during which it will use the current supplies (projection says that new energies will account for less than 25% in twenty years IIRC).</p><h4>Conclusion</h4><p>Even if I do not share the Google Dream, there are several laws that our old industries have forgotten about. Google has used them extensively, and it is a good thing. We should all do the same, but we also need to step back and have some insight on the Google way. As with every industry, Google has its golden age and it may be now. It will end in some years, and as we listen to this trend now, we will have to stay alert to the new one then.</p><div
style="border: 1px solid #000; padding: 5px; margin-bottom: 15px; background: url(http://matt.eifelle.com/wp-content/uploads/2009/12/BN_Logo_3tier.jpg) right bottom no-repeat #ffffff;"> <a
rel="nofollow" href="http://r.popshops.com/pp/69393/what-would-google-do"><img
style="width: 150px;" src="http://images.barnesandnoble.com/images/34010000/34013739.JPG" border="0" alt="What Would Google Do?" /></a><br
/> <a
rel="nofollow" href="http://r.popshops.com/pp/69393/what-would-google-do">What Would Google Do? (Hardcover)</a><br
/> Price: $19.43</div><div
style="border: 1px solid #000; padding: 5px; margin-bottom: 15px; background: url(http://matt.eifelle.com/wp-content/uploads/2009/12/BN_Logo_3tier.jpg) right bottom no-repeat #ffffff;"> <a
rel="nofollow" href="http://r.popshops.com/pp/69392/what-would-google-do"><img
style="width: 150px;" src="http://images.barnesandnoble.com/images/45850000/45859115.PNG" border="0" alt="What Would Google Do?" /></a><br
/> <a
rel="nofollow" href="http://r.popshops.com/pp/69392/what-would-google-do">What Would Google Do? (eBook)</a><br
/> Price: $12.59</div><div
class="subcolumns"><div
style="border: 1px solid #000; padding: 5px; margin-bottom: 15px; background: url(http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/amazon_US_small.gif) right bottom no-repeat #ffffff;"><div
style="width: 47px; float: left; margin-right: 5px;"> <a
href="http://www.amazon.com/exec/obidos/ASIN/0061709719/masbl03-20" target="_blank"><img
src="http://ecx.images-amazon.com/images/I/41kq9FjSRfL._SL75_.jpg" width="47" height="75" border="0" /></a></div><div><p><a
href="http://www.amazon.com/exec/obidos/ASIN/0061709719/masbl03-20" target="_blank">What Would Google Do?</a> (Hardcover)<br
/> <span
style="font-size: 0.8em;">by <strong>Jeff Jarvis</strong></span><br
/> ISBN: 0061709719</p><p><strong>Price:</strong> <span
style="color: #990000; font-weight: bold;">USD 17.81</span><br
/> <strong>58 used &#038; new</strong> available from <span
style="color: #990000; font-weight: bold;">USD 14.25</span></p><p> <img
src="http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/stars-4.gif" class="asa_rating_stars" /> | 4 | 99</div><div
style="clear: both;"></div></div></div>
<p><a href="http://feedads.g.doubleclick.net/~a/bpsZz9gyaonMBMoOgBNA4nP0-uA/0/da"><img src="http://feedads.g.doubleclick.net/~a/bpsZz9gyaonMBMoOgBNA4nP0-uA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/bpsZz9gyaonMBMoOgBNA4nP0-uA/1/da"><img src="http://feedads.g.doubleclick.net/~a/bpsZz9gyaonMBMoOgBNA4nP0-uA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/eifelle/CPPV/~4/AVtVXEXayO8" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2009/12/15/book-review-what-would-google-do/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://matt.eifelle.com/2009/12/15/book-review-what-would-google-do/</feedburner:origLink></item> <item><title>Book review: The Art of Concurrency: A Thread Monkey’s Guide to Writing Parallel Applications</title><link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/0KljS57W-xs/</link> <comments>http://matt.eifelle.com/2009/12/08/book-review-the-art-of-concurrency-a-thread-monkeys-guide-to-writing-parallel-applications/#comments</comments> <pubDate>Tue, 08 Dec 2009 07:57:54 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Book review]]></category> <category><![CDATA[C++]]></category> <category><![CDATA[Debugger]]></category> <category><![CDATA[General]]></category> <category><![CDATA[O'Reilly]]></category> <category><![CDATA[Profiler]]></category> <category><![CDATA[Tools]]></category> <category><![CDATA[Multithreaded applications]]></category><guid isPermaLink="false">http://matt.eifelle.com/?p=847</guid> <description><![CDATA[Free lunch is over, it&#8217;s time to go concurrent. The Art of Concurrency addresses the need for a workflow to develop concurrent/parallel applications.Mainly based on multithreaded applications, the book covers pthreads, Windows threads, OpenMP or Intel Threading Building Blocks library. It also covers some part of multiprocess applications if there are differences with threaded ones.
Content [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.gotw.ca/publications/concurrency-ddj.htm">Free lunch is over</a>, it&#8217;s time to go concurrent. <span
style="text-decoration: underline;">The Art of Concurrency</span> addresses the need for a workflow to develop concurrent/parallel applications.<br
/> <span
id="more-847"></span><br
/> Mainly based on multithreaded applications, the book covers pthreads, Windows threads, OpenMP or <a
href="http://matt.eifelle.com/2008/07/09/book-review-intel-threading-building-blocks-outfitting-c-for-multi-core-processor-parallelism/">Intel Threading Building Blocks library</a>. It also covers some part of multiprocess applications if there are differences with threaded ones.</p><h4>Content and opinions</h4><p>The book starts with two chapers on what actions to take before parallelizing and what can and what cannot. Before the usual algorithms that can be parallelized, the author takes three chapters to explain how you may achieve your goal. Ensuring correctness is a difficult task, so the book gives 8 rules to help and then an explanation of several support libraries that can be used.</p><p>The biggest part of the book, as I&#8217;ve hinted, is dedicated to simple but usual algorithms that may be parallelized: sums and scans, mapreduce, sorts, searches, and graph algorithms. Each time, several different algorithms are first coded in a serial way and then parallelized with possibly different support libraries. Also each time, the efficiency, the simplicity, the portability and the scalability conclude the sub art: it helps standing back.</p><p>The last chapter is a small overview of the additional tools that you may use (but they are not mandatory). They are mainly Intel&#8217;s tools, but it&#8217;s mainly because Intel provides the developer with some of the best tools.</p><h4>Conclusion</h4><p>Although the author works for Intel, he doesn&#8217;t expose Intel tools more than others. The book tone is adequate, not too much serious, not like a &#8220;For Dummies&#8221;, so just enjoyable.</p><p>If you need advices to parallelize your applications and you don&#8217;t want to buy <a
href="http://matt.eifelle.com/2009/03/10/book-review-patterns-for-parallel-programming/">Patterns for Parallel Programming</a>, buy this one (well, buy it anyway).</p><div
style="border: 1px solid #000; padding: 5px; margin-bottom: 15px; background: url(http://matt.eifelle.com/wp-content/uploads/2009/12/BN_Logo_3tier.jpg) right bottom no-repeat #ffffff;"> <a
rel="nofollow" href="http://r.popshops.com/pp/69253/the-art-of-concurrency-a-thread-monkey-s-guide-to-writing-parallel-applications"><img
style="width: 150px;" src="http://images.barnesandnoble.com/images/37180000/37189689.JPG" border="0" alt="The Art of Concurrency: A Thread Monkey's Guide to Writing Parallel Applications" /></a><br
/> <a
rel="nofollow" href="http://r.popshops.com/pp/69253/the-art-of-concurrency-a-thread-monkey-s-guide-to-writing-parallel-applications">The Art of Concurrency: A Thread Monkey&#8217;s Guide to Writing Parallel Applications</a><br
/> Price: $40.49</div><div
class="subcolumns"><div
style="border: 1px solid #000; padding: 5px; margin-bottom: 15px; background: url(http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/amazon_US_small.gif) right bottom no-repeat #ffffff;"><div
style="width: 57px; float: left; margin-right: 5px;"> <a
href="http://www.amazon.com/exec/obidos/ASIN/0596521537/masbl03-20" target="_blank"><img
src="http://ecx.images-amazon.com/images/I/51T%2BAeugoYL._SL75_.jpg" width="57" height="75" border="0" /></a></div><div><p><a
href="http://www.amazon.com/exec/obidos/ASIN/0596521537/masbl03-20" target="_blank">The Art of Concurrency: A Thread Monkey&#8217;s Guide to Writing Parallel Applications</a> (Paperback)<br
/> <span
style="font-size: 0.8em;">by <strong>Clay Breshears</strong></span><br
/> ISBN: 0596521537</p><p><strong>Price:</strong> <span
style="color: #990000; font-weight: bold;">USD 40.11</span><br
/> <strong>34 used &#038; new</strong> available from <span
style="color: #990000; font-weight: bold;">USD 27.05</span></p><p> <img
src="http://matt.eifelle.com/wp-content/plugins/amazonsimpleadmin/img/stars-3.5.gif" class="asa_rating_stars" /> | 3.5 | 5</div><div
style="clear: both;"></div></div></div>
<p><a href="http://feedads.g.doubleclick.net/~a/NCaeqDUYtb-IUSXdClKE89kQ88g/0/da"><img src="http://feedads.g.doubleclick.net/~a/NCaeqDUYtb-IUSXdClKE89kQ88g/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/NCaeqDUYtb-IUSXdClKE89kQ88g/1/da"><img src="http://feedads.g.doubleclick.net/~a/NCaeqDUYtb-IUSXdClKE89kQ88g/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/eifelle/CPPV/~4/0KljS57W-xs" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2009/12/08/book-review-the-art-of-concurrency-a-thread-monkeys-guide-to-writing-parallel-applications/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://matt.eifelle.com/2009/12/08/book-review-the-art-of-concurrency-a-thread-monkeys-guide-to-writing-parallel-applications/</feedburner:origLink></item> <item><title>VST plugin AGain reloaded with a Qt GUI</title><link>http://feedproxy.google.com/~r/eifelle/CPPV/~3/Vxc7MkQrQPE/</link> <comments>http://matt.eifelle.com/2009/12/01/vst-plugin-again-reloaded-with-a-qt-gui/#comments</comments> <pubDate>Tue, 01 Dec 2009 09:19:54 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[C++]]></category> <category><![CDATA[Music]]></category> <category><![CDATA[Qt]]></category> <category><![CDATA[VST]]></category><guid isPermaLink="false">http://matt.eifelle.com/?p=793</guid> <description><![CDATA[Years ago, I&#8217;ve tried to use the GPL version of Qt, but it couldn&#8217;t be done without a Qt Solution that was at the time non-free. Now, Nokia has freed and Qt and the appropriate Qt Solution.
I&#8217;ve searched if someone has already used this new version to create a VST plugin. The only blog post [...]]]></description> <content:encoded><![CDATA[<p>Years ago, I&#8217;ve <a
href="http://lists.trolltech.com/qt-interest/2006-01/thread00332-0.html">tried to use the GPL version of Qt</a>, but it couldn&#8217;t be done without a Qt Solution that was at the time non-free. Now, Nokia has freed and Qt and <a
href="http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Windows/qtwinmigrate/">the appropriate Qt Solution</a>.</p><p>I&#8217;ve searched if someone has already used this new version to create a VST plugin. <a
href="http://vokicodder.blogspot.com/2009/04/vst-plugins-with-qt-user-interface.html">The only blog post I&#8217;ve found</a> does not use the Qt Solution and is not perfect. According to the documentation what is missing in this solution is precisely what the Solution should do. So let&#8217;s try it.<br
/> <span
id="more-793"></span></p><p>So I&#8217;ve download the 2.4 VST SDK as well as Qt 4.5 and the WinMigrate Solution. As I&#8217;ll be using Qt with signals and slots, I used SCons to build my small plugin.</p><h4>Designing the interface and testing it</h4><p>The interface is really simple: a label with a name, the value of the gain and a slider. Here is what it looks like in Tracktion 3:<br
/> <a
href="http://matt.eifelle.com/wp-content/uploads/2009/11/Tracktion-qtagain.png"><img
src="http://matt.eifelle.com/wp-content/uploads/2009/11/Tracktion-qtagain.png" alt="QtAgain in Tracktion 3" title="QtAgain in Tracktion 3" width="300" height="178" class="aligncenter size-full wp-image-835" /></a><br
/> The slider takes values from 0 to 99, value that will be displayed in a label. This will be the gain factor in percentage.</p><p>Nothing fancy here with the class header:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left2">Download <a
href="http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=793&amp;download=QVstPanel.h">QVstPanel.h</a></span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p79317"><td
class="code" id="p793code17"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">class</span> QVstPanel <span style="color: #008080;">:</span> <span style="color: #0000ff;">public</span> QWinWidget
<span style="color: #008000;">&#123;</span>
  HWND h_parent<span style="color: #008080;">;</span>
  AudioEffectX <span style="color: #000040;">*</span>again<span style="color: #008080;">;</span>
&nbsp;
  QLabel <span style="color: #000040;">*</span>valueLabel<span style="color: #008080;">;</span>
  QSlider <span style="color: #000040;">*</span>slider<span style="color: #008080;">;</span>
<span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
  QVstPanel<span style="color: #008000;">&#40;</span>AudioEffectX <span style="color: #000040;">*</span>again, HWND h_parent <span style="color: #000080;">=</span> <span style="color: #0000ff;">NULL</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></pre></td></tr></table></div><p>The panel is created with a link to the actual audio effect (needed in the future) and the parent HWND given by the host.</p><p>The actual code is even simplier:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left2">Download <a
href="http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=793&amp;download=QVstPanel.cpp">QVstPanel.cpp</a></span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p79318"><td
class="code" id="p793code18"><pre class="cpp" style="font-family:monospace;">QVstPanel<span style="color: #008080;">::</span><span style="color: #007788;">QVstPanel</span><span style="color: #008000;">&#40;</span>AudioEffectX <span style="color: #000040;">*</span>again, HWND h_parent<span style="color: #008000;">&#41;</span>
<span style="color: #008080;">:</span>QWinWidget<span style="color: #008000;">&#40;</span>h_parent, <span style="color: #0000ff;">NULL</span><span style="color: #008000;">&#41;</span>, again<span style="color: #008000;">&#40;</span>again<span style="color: #008000;">&#41;</span>, h_parent<span style="color: #008000;">&#40;</span>h_parent<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  setAttribute<span style="color: #008000;">&#40;</span>Qt<span style="color: #008080;">::</span><span style="color: #007788;">WA_DeleteOnClose</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
  QLabel <span style="color: #000040;">*</span>label <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> QLabel<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;Gain&quot;</span>, <span style="color: #0000dd;">this</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  valueLabel <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> QLabel<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;0&quot;</span>, <span style="color: #0000dd;">this</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  slider <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> QSlider<span style="color: #008000;">&#40;</span>Qt<span style="color: #008080;">::</span><span style="color: #007788;">Horizontal</span>, <span style="color: #0000dd;">this</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  QHBoxLayout <span style="color: #000040;">*</span>layout <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> QHBoxLayout<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">this</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  layout<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>addWidget<span style="color: #008000;">&#40;</span>label<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  layout<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>addWidget<span style="color: #008000;">&#40;</span>valueLabel<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  layout<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>addWidget<span style="color: #008000;">&#40;</span>slider<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  setLayout<span style="color: #008000;">&#40;</span>layout<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div><p>Now this is the class that will be opened by the VST editor this way:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left2">Download <a
href="http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=793&amp;download=guiagain.h">guiagain.h</a></span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p79319"><td
class="code" id="p793code19"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">class</span> QtAGain <span style="color: #008080;">:</span> <span style="color: #0000ff;">public</span> AEffEditor
<span style="color: #008000;">&#123;</span>
  QWinWidget<span style="color: #000040;">*</span> widget<span style="color: #008080;">;</span>
  AudioEffectX<span style="color: #000040;">*</span> effect<span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
  QtAGain<span style="color: #008000;">&#40;</span>AudioEffectX<span style="color: #000040;">*</span> effect<span style="color: #008000;">&#41;</span>
    <span style="color: #008080;">:</span>widget<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">NULL</span><span style="color: #008000;">&#41;</span>, effect<span style="color: #008000;">&#40;</span>effect<span style="color: #008000;">&#41;</span>
  <span style="color: #008000;">&#123;</span>
  <span style="color: #008000;">&#125;</span>
&nbsp;
  ~QtAGain<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
  <span style="color: #008000;">&#123;</span>
  <span style="color: #008000;">&#125;</span>
&nbsp;
  <span style="color: #0000ff;">bool</span> open<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000040;">*</span> ptr<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  <span style="color: #0000ff;">void</span> close<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></pre></td></tr></table></div><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left2">Download <a
href="http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=793&amp;download=guiagain.cpp">guiagain.cpp</a></span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p79320"><td
class="code" id="p793code20"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">bool</span> QtAGain<span style="color: #008080;">::</span><span style="color: #007788;">open</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000040;">*</span> ptr<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  AEffEditor<span style="color: #008080;">::</span><span style="color: #007788;">open</span> <span style="color: #008000;">&#40;</span>ptr<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  widget <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> QVstPanel<span style="color: #008000;">&#40;</span>effect, <span style="color: #0000ff;">static_cast</span><span style="color: #000080;">&lt;</span>HWND<span style="color: #000080;">&gt;</span><span style="color: #008000;">&#40;</span>ptr<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  widget<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>move<span style="color: #008000;">&#40;</span> <span style="color: #0000dd;">0</span>, <span style="color: #0000dd;">0</span> <span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  widget<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>adjustSize<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  widget<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setMinimumSize<span style="color: #008000;">&#40;</span>widget<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>size<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  widget<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>show<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
  <span style="color: #0000ff;">return</span> <span style="color: #0000ff;">true</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">void</span> QtAGain<span style="color: #008080;">::</span><span style="color: #007788;">close</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  <span style="color: #0000dd;">delete</span> widget<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div><p>Now, in AGain&#8217;s constructor, I can add my custom editor:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left2">Download <a
href="http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=793&amp;download=again.cpp">again.cpp</a></span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p79321"><td
class="code" id="p793code21"><pre class="cpp" style="font-family:monospace;">  QtAGain<span style="color: #000040;">*</span> again <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> QtAGain<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">this</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  setEditor<span style="color: #008000;">&#40;</span>again<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></td></tr></table></div><p>So there isn&#8217;t anything really fancy, it kind of works out of the box. Unfortunately, it doesn&#8217;t work as well as in T3 in every host. I cannot resize the window VSTHost gives to the <em>open()</em> method, even if I tested it with almost all solutions I&#8217;ve found on MSDN.</p><h4>Adding interactivity</h4><p>Now, I will eventually use the power of Qt. The <em>QtAGain</em> class will be a <em>QObject</em>, as will be the <em>AGain</em> effect. This way, I can connect signals from the GUI to the effect when a parameter is modified by the user, and vice-versa, the UI will be updated when the effect sees a parameter change (indicated by the host for instance).</p><p>So I add a connection inside the <em>QVstPanel</em> constructor to a new slot that will update the underlying effect:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left2">Download <a
href="http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=793&amp;download=QVstPanel.cpp">QVstPanel.cpp</a></span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p79322"><td
class="code" id="p793code22"><pre class="cpp" style="font-family:monospace;">connect<span style="color: #008000;">&#40;</span>slider, SIGNAL<span style="color: #008000;">&#40;</span>sliderMoved<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>, <span style="color: #0000dd;">this</span>, SLOT<span style="color: #008000;">&#40;</span>update<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">void</span> QVstPanel<span style="color: #008080;">::</span><span style="color: #007788;">update</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> value<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  valueLabel<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setText<span style="color: #008000;">&#40;</span>QString<span style="color: #008080;">::</span><span style="color: #007788;">number</span><span style="color: #008000;">&#40;</span>value<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  again<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setParameter<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">0</span>, value <span style="color: #000040;">/</span> <span style="color: #0000dd;">100</span>.<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div><p>The trouble arises from the effect: what should I do if the effect gets a <em>setParameter</em> that didn&#8217;t come from the UI? If there is no UI, everything is fine though. So I will add a signal inside <em>QtAgain</em>, the editor, that will forward a signal emitted by <em>AGain</em> only if the UI is up.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left2">Download <a
href="http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=793&amp;download=again.cpp">again.cpp</a></span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p79323"><td
class="code" id="p793code23"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> AGain<span style="color: #008080;">::</span><span style="color: #007788;">setParameter</span> <span style="color: #008000;">&#40;</span>VstInt32 index, <span style="color: #0000ff;">float</span> value<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  fGain <span style="color: #000080;">=</span> value<span style="color: #008080;">;</span>
  emit update<span style="color: #008000;">&#40;</span>value<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div><p>So now, the signal that the UI will get is a float, so I can reuse the name <em>update()</em> for my slot:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left2">Download <a
href="http://matt.eifelle.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=793&amp;download=QVstPanel.cpp">QVstPanel.cpp</a></span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p79324"><td
class="code" id="p793code24"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> QVstPanel<span style="color: #008080;">::</span><span style="color: #007788;">update</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">float</span> value<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  <span style="color: #0000ff;">int</span> intValue <span style="color: #000080;">=</span> value <span style="color: #000040;">*</span> <span style="color: #0000dd;">100</span><span style="color: #008080;">;</span>
  valueLabel<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setText<span style="color: #008000;">&#40;</span>QString<span style="color: #008080;">::</span><span style="color: #007788;">number</span><span style="color: #008000;">&#40;</span>intValue<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  slider<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setValue<span style="color: #008000;">&#40;</span>intValue<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>  
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div><p>Of course, you will have several parameters inside your VST plugin, I suggest you use the editor instance to the mapping between the effect and the different slots you may have inside your UI.</p><h4>Conclusion</h4><p>Although I couldn&#8217;t get it to work with VSTHost (the host widget is not resized), I think the <em>QWinWidget</em> is a good class to help developing Qt VST plugins. I may want to use this skeletton to test some digital effects with a cool UI.</p><p>If you have a solution to make VSTHost work, I&#8217;m all ears.</p><p>The code is available on <a
href="https://code.launchpad.net/~matthieu-brucher/+junk/QtAGain">Launchpad</a>.</p>
<p><a href="http://feedads.g.doubleclick.net/~a/E2dWq9t4c6VEVEspq5c2RS0FSGM/0/da"><img src="http://feedads.g.doubleclick.net/~a/E2dWq9t4c6VEVEspq5c2RS0FSGM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/E2dWq9t4c6VEVEspq5c2RS0FSGM/1/da"><img src="http://feedads.g.doubleclick.net/~a/E2dWq9t4c6VEVEspq5c2RS0FSGM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/eifelle/CPPV/~4/Vxc7MkQrQPE" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2009/12/01/vst-plugin-again-reloaded-with-a-qt-gui/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://matt.eifelle.com/2009/12/01/vst-plugin-again-reloaded-with-a-qt-gui/</feedburner:origLink></item> </channel> </rss><!-- Served from: lb3.celeonet.com @ 2010-02-09 10:57:36 by W3 Total Cache -->
