<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
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/"
><channel><title>Matthieu Brucher&#039;s blog &#187; Music</title> <atom:link href="http://matt.eifelle.com/category/music/feed/" rel="self" type="application/rss+xml" /><link>http://matt.eifelle.com</link> <description></description> <lastBuildDate>Tue, 27 Jul 2010 07:04:23 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.1</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>QtVST: a Chamberlin Variable Filter</title><link>http://matt.eifelle.com/2010/07/06/qtvst-a-chamberlin-variable-filter/</link> <comments>http://matt.eifelle.com/2010/07/06/qtvst-a-chamberlin-variable-filter/#comments</comments> <pubDate>Tue, 06 Jul 2010 07:17:52 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[C++]]></category> <category><![CDATA[Digital filters]]></category> <category><![CDATA[Music]]></category> <category><![CDATA[digital filter]]></category> <category><![CDATA[pyVST]]></category> <category><![CDATA[Qt]]></category> <category><![CDATA[VST]]></category><guid
isPermaLink="false">http://matt.eifelle.com/?p=1251</guid> <description><![CDATA[After my last post on QtAgain, I&#8217;ve decided to test a few simple digital filters. I&#8217;ve tried to make them as generic as possible, and with a VST interface.A templated Chamberlin filter
A Chamberlin filter is a IIR (Infinite Impulse Response) filter, and it is possible to make it output high-, band- or low-pass signals. It [...]]]></description> <content:encoded><![CDATA[<p>After <a
href="http://matt.eifelle.com/2010/03/02/fixing-the-qtagain-plugin/">my last post on QtAgain</a>, I&#8217;ve decided to test a few simple digital filters. I&#8217;ve tried to make them as generic as possible, and with a VST interface.<br
/> <span
id="more-1251"></span></p><h4>A templated Chamberlin filter</h4><p>A Chamberlin filter is a IIR (Infinite Impulse Response) filter, and it is possible to make it output high-, band- or low-pass signals. It has only two parameters that are independent.</p><p>The equations are very simple:<br
/><center><a
href="http://matt.eifelle.com/wp-content/uploads/2010/07/equations.png"><img
src="http://matt.eifelle.com/wp-content/uploads/2010/07/equations.png" alt="" title="Chamberlin Equations" class="aligncenter size-full wp-image-1279" /></a></center></p><p>Each of the series is either the low-pass, the band-pass or the high-pass output.</p><p>There are some factors that are pre-computed:<br
/><center><a
href="http://matt.eifelle.com/wp-content/uploads/2010/07/factors.png"><img
src="http://matt.eifelle.com/wp-content/uploads/2010/07/factors.png" alt="" title="Digital Factors" class="aligncenter size-full wp-image-1280" /></a></center></p><p>The first is a function of the <strong>C</strong>ut frequency and the <strong>S</strong>ampling frequency, a &#8220;numerical frequency&#8221;. The second one is the numerical attenuation, between 0 and 2.</p><p>This is an excerpt of the actual code, I&#8217;ve only displayed the relevant code.</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=1251&amp;download=variable_filter.h">variable_filter.h</a></span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p12512"><td
class="code" id="p1251code2"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">template</span><span style="color: #000080;">&lt;</span><span style="color: #0000ff;">class</span> Data_Type<span style="color: #000080;">&gt;</span>
<span style="color: #0000ff;">class</span> VariableFilter
<span style="color: #008000;">&#123;</span>
<span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
  <span style="color: #0000ff;">typedef</span> Data_Type DataType<span style="color: #008080;">;</span>
&nbsp;
  <span style="color: #0000ff;">void</span> process<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> DataType<span style="color: #000040;">*</span> in, DataType<span style="color: #000040;">*</span> out, <span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">long</span> nb_samples<span style="color: #008000;">&#41;</span>
  <span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">long</span> i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> nb_samples<span style="color: #008080;">;</span> <span style="color: #000040;">++</span>i<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
      yh <span style="color: #000080;">=</span> in<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000040;">-</span> yl <span style="color: #000040;">-</span> numerical_attenuation <span style="color: #000040;">*</span> yb<span style="color: #008080;">;</span>
      yb <span style="color: #000080;">=</span> numerical_frequency <span style="color: #000040;">*</span> yh <span style="color: #000040;">+</span> yb<span style="color: #008080;">;</span>
      yl <span style="color: #000080;">=</span> numerical_frequency <span style="color: #000040;">*</span> yb <span style="color: #000040;">+</span> yl<span style="color: #008080;">;</span>
      <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>selected <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
      <span style="color: #008000;">&#123;</span>
        out<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> yl<span style="color: #008080;">;</span>
      <span style="color: #008000;">&#125;</span>
      <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>selected <span style="color: #000080;">==</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span>
      <span style="color: #008000;">&#123;</span>
        out<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> yb<span style="color: #008080;">;</span>
      <span style="color: #008000;">&#125;</span>
      <span style="color: #0000ff;">else</span>
      <span style="color: #008000;">&#123;</span>
        out<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> yh<span style="color: #008080;">;</span>
      <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
  <span style="color: #008000;">&#125;</span> 
&nbsp;
<span style="color: #0000ff;">protected</span><span style="color: #008080;">:</span>
  <span style="color: #0000ff;">void</span> compute_factors<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
  <span style="color: #008000;">&#123;</span>
    numerical_frequency <span style="color: #000080;">=</span> <span style="color: #0000dd;">2</span> <span style="color: #000040;">*</span> std<span style="color: #008080;">::</span><span style="color: #0000dd;">sin</span><span style="color: #008000;">&#40;</span>M_PI <span style="color: #000040;">*</span> cutoff_frequency <span style="color: #000040;">/</span> sampling_frequency<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    numerical_attenuation <span style="color: #000080;">=</span> <span style="color: #0000dd;">2</span> <span style="color: #000040;">*</span> attenuation<span style="color: #008080;">;</span>
  <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></pre></td></tr></table></div><p>Now, I&#8217;ve written a simple GUI for this plugin.</p><h4>GUI with Qt</h4><p>I&#8217;ve used the QtAgain skeletton to wrap the filter and to make it available to <a
href="http://matt.eifelle.com/2010/03/09/annoucement-pyvst-0-1/">PyVST</a>. It&#8217;s really easy to add other parameters to the skeletton, so I will not write everything here again. There are three parameters, 2 numerical ones, and one three-state variable.</p><p><center><a
href="http://matt.eifelle.com/wp-content/uploads/2010/06/editor.png"><img
src="http://matt.eifelle.com/wp-content/uploads/2010/06/editor-300x102.png" alt="" title="Chamberlin editor" width="300" height="102" class="aligncenter size-medium wp-image-1274" /></a></center></p><h4>Results</h4><p>I&#8217;ve recorded the filter&#8217;s outputs for 6kHz as central frequency, and an attenuation factor of .3. The output signal was generated from a random signal, and then an FFT was performed on the inputs and the outputs and displayed.</p><p>Note: I didn&#8217;t convert the scale to dB.</p><p><center><a
href="http://matt.eifelle.com/wp-content/uploads/2010/06/HighPass.png"><img
src="http://matt.eifelle.com/wp-content/uploads/2010/06/HighPass-300x172.png" alt="" title="High Pass" width="300" height="172" class="aligncenter size-medium wp-image-1273" /></a></center><br
/><center><a
href="http://matt.eifelle.com/wp-content/uploads/2010/06/BandPass.png"><img
src="http://matt.eifelle.com/wp-content/uploads/2010/06/BandPass-300x172.png" alt="" title="Band Pass" width="300" height="172" class="aligncenter size-medium wp-image-1276" /></a></center><br
/><center><a
href="http://matt.eifelle.com/wp-content/uploads/2010/06/LowPass.png"><img
src="http://matt.eifelle.com/wp-content/uploads/2010/06/LowPass-300x172.png" alt="" title="Low Pass" width="300" height="172" class="aligncenter size-medium wp-image-1275" /></a></center></p><p>As you may have noted, the filter amplifies the signal near the central frequency for each output for the attenuation I&#8217;ve selected. The issue is that selecting a higher one has also an impact on the stability of the filter at higher frequencies. The sum of the numerical attenuation and the numerical frequency should always be inferior to 2.</p><h4>Conclusion</h4><p>This numerical is really simple to implement, and it has few parameters. The dark side of this filter is that is not always stable and the central frequency seems to be always amplified. Other filters can be better balanced.</p><p>The code is available on <a
href="https://code.launchpad.net/~matthieu-brucher/+junk/QtVST">Launchpad</a>.</p>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2010/07/06/qtvst-a-chamberlin-variable-filter/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Annoucement: PyVST 0.1</title><link>http://matt.eifelle.com/2010/03/09/annoucement-pyvst-0-1/</link> <comments>http://matt.eifelle.com/2010/03/09/annoucement-pyvst-0-1/#comments</comments> <pubDate>Tue, 09 Mar 2010 08:06:43 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Music]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[ctypes]]></category> <category><![CDATA[VST]]></category><guid
isPermaLink="false">http://matt.eifelle.com/?p=1134</guid> <description><![CDATA[I am pleased to announce the first release of PyVST.
PyVST is a ctypes-based wrapper for the (open) VST standard developed by Steinberg for audio processing.
Version 0.1 provides basic access to the VST interface, as well as a script to analyze and display the audio process of a plugin. It can be easy-installed or downloaded [...]]]></description> <content:encoded><![CDATA[<p>I am pleased to announce the first release of PyVST.<br
/> PyVST is a ctypes-based wrapper for the (open) VST standard developed by <a
href="http://www.steinberg.com/">Steinberg</a> for audio processing.</p><p>Version 0.1 provides basic access to the VST interface, as well as a script to analyze and display the audio process of a plugin. It can be easy-installed or downloaded on <a
href="https://launchpad.net/pyvst">its Launchpad page</a>.</p><p>Changelog for 0.1:</p><ul><li>Uses the VST dispatcher for several functions:<ul><li>processReplacing</li><li>processDoubleReplacing</li><li>open/close the plugin</li><li>open/close the GUI editor</li><li>returns the GUI rectangle</li><li>set the sample rate</li><li>set the block size</li><li>get name/vendor/product</li><li>handle programs</li><li>handle parameters</li><li>suspend/resume</li></ul></li><li>set/get a parameter</li><li>get number of programs</li><li>get number of inputs</li><li>get number of outputs</li><li>display.py script<ul><li>can load any plugin</li><li>displays the editor, if it exists</li><li>uses a stereo sine-sweep</li><li>displays a spectrogram of the process of the stereo sine-sweep</li><li>dumps properties information</li></ul></li></ul><form
action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input
type="hidden" name="cmd" value="_xclick" /> <input
type="hidden" name="business" value="matthieu.brucher@gmail.com" /><input
type="hidden" name="item_name" value="Buy Me a Coffee!" /><input
type="hidden" name="currency_code" value="USD" /><span
style="font-size:10.0pt"><strong> Buy Me a Coffee!</strong></span><br
/><br
/><select
id="amount" name="amount" class=""><option
value="3">Capuccino - 3$</option><option
value="6">Frappuccino - 6$</option><option
value="10">Hot Chocolate - 10$</option><option
value="20">Expensive Coffee - 20$</option><option
value="50">Alien Coffee - 50$</option></select><br
/><br
/><strong>Other Amount:</strong><br
/><br
/><input
type="text" name="amount" size="10" title="Other donate" value="" /><br
/><br
/><strong> Your Email Address :</strong><input
type="hidden" name="on0" value="Reference" /><br
/><br
/><input
type="text" name="os0" maxlength="60" /> <br
/><br
/> <input
type="hidden" name="no_shipping" value="2" /> <input
type="hidden" name="no_note" value="1" /> <input
type="hidden" name="mrb" value="3FWGC6LFTMTUG" /> <input
type="hidden" name="bn" value="IC_Sample" /> <input
type="hidden" name="return" value="http://matt.eifelle.com" /><input
type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but11.gif" name="submit" alt="Make payments with payPal - it's fast, free and secure!" /></form>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2010/03/09/annoucement-pyvst-0-1/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Fixing the QtAGain plugin</title><link>http://matt.eifelle.com/2010/03/02/fixing-the-qtagain-plugin/</link> <comments>http://matt.eifelle.com/2010/03/02/fixing-the-qtagain-plugin/#comments</comments> <pubDate>Tue, 02 Mar 2010 08:21:58 +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=1130</guid> <description><![CDATA[Some months ago, I&#8217;ve modified the AGain plugin sample from the VST SDK to add a Qt window. At that time, I encountered an issue with Vsthost, which is a common VST host. The issue was that in windowed mode, the plugin&#8217;s UI wasn&#8217;t displayed. With Traktion, I didn&#8217;t have this problem, but the minihost [...]]]></description> <content:encoded><![CDATA[<p>Some months ago, <a
href="http://matt.eifelle.com/2009/12/01/vst-plugin-again-reloaded-with-a-qt-gui/">I&#8217;ve modified the AGain plugin sample</a> from the VST SDK to add a Qt window. At that time, I encountered an issue with <a
href="http://www.hermannseib.com/english/vsthost.htm">Vsthost</a>, which is a common VST host. The issue was that in windowed mode, the plugin&#8217;s UI wasn&#8217;t displayed. With Traktion, I didn&#8217;t have this problem, but the minihost (a sample from the SDK) also didn&#8217;t use the UI size.</p><p>When developing <a
href="http://matt.eifelle.com/2010/02/09/pyvst-another-ctypes-based-python-vst-wrapper/">pyvst</a>, I has to implement the retrieval of the size of the plugin, and I&#8217;ve decided to add this to QtAGain. I was surprised to see that it actually work with just giving back the UI size (so fixing this was less than 5 lines).</p><p>So now, I know that to impelment an UI for a VST plugin, I have to implement:</p><ul><li><strong>open()</strong></li><li><strong>close()</strong></li><li>but also <strong>getRect()</strong></li></ul><p>Don&#8217;t make the same mistake as I did, do implement all three of them, even if your favorite VST host can live without <strong>getRect()</strong>.</p><p>P.S.: Mixing Qt for VST UIs and wxPython for pyvst works really fine!</p>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2010/03/02/fixing-the-qtagain-plugin/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>VST plugin AGain reloaded with a Qt GUI</title><link>http://matt.eifelle.com/2009/12/01/vst-plugin-again-reloaded-with-a-qt-gui/</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="p79311"><td
class="code" id="p793code11"><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="p79312"><td
class="code" id="p793code12"><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="p79313"><td
class="code" id="p793code13"><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="p79314"><td
class="code" id="p793code14"><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="p79315"><td
class="code" id="p793code15"><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="p79316"><td
class="code" id="p793code16"><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="p79317"><td
class="code" id="p793code17"><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="p79318"><td
class="code" id="p793code18"><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><form
action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input
type="hidden" name="cmd" value="_xclick" /> <input
type="hidden" name="business" value="matthieu.brucher@gmail.com" /><input
type="hidden" name="item_name" value="Buy Me a Coffee!" /><input
type="hidden" name="currency_code" value="USD" /><span
style="font-size:10.0pt"><strong> Buy Me a Coffee!</strong></span><br
/><br
/><select
id="amount" name="amount" class=""><option
value="3">Capuccino - 3$</option><option
value="6">Frappuccino - 6$</option><option
value="10">Hot Chocolate - 10$</option><option
value="20">Expensive Coffee - 20$</option><option
value="50">Alien Coffee - 50$</option></select><br
/><br
/><strong>Other Amount:</strong><br
/><br
/><input
type="text" name="amount" size="10" title="Other donate" value="" /><br
/><br
/><strong> Your Email Address :</strong><input
type="hidden" name="on0" value="Reference" /><br
/><br
/><input
type="text" name="os0" maxlength="60" /> <br
/><br
/> <input
type="hidden" name="no_shipping" value="2" /> <input
type="hidden" name="no_note" value="1" /> <input
type="hidden" name="mrb" value="3FWGC6LFTMTUG" /> <input
type="hidden" name="bn" value="IC_Sample" /> <input
type="hidden" name="return" value="http://matt.eifelle.com" /><input
type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but11.gif" name="submit" alt="Make payments with payPal - it's fast, free and secure!" /></form>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2009/12/01/vst-plugin-again-reloaded-with-a-qt-gui/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>And now for something completely different: Wiring diagram for a SM STC-2A</title><link>http://matt.eifelle.com/2009/02/10/and-now-for-something-completely-different-wiring-diagram-for-a-sm-stc-2a/</link> <comments>http://matt.eifelle.com/2009/02/10/and-now-for-something-completely-different-wiring-diagram-for-a-sm-stc-2a/#comments</comments> <pubDate>Tue, 10 Feb 2009 07:52:44 +0000</pubDate> <dc:creator>Matt</dc:creator> <category><![CDATA[Electronic]]></category> <category><![CDATA[Music]]></category> <category><![CDATA[Cort GB74]]></category> <category><![CDATA[Seymour Duncan]]></category> <category><![CDATA[Tone circuit]]></category> <category><![CDATA[Tone control]]></category> <category><![CDATA[Wiring diagram]]></category><guid
isPermaLink="false">http://matt.eifelle.com/?p=308</guid> <description><![CDATA[I&#8217;ve recently burnt the tone circuit of my Cort GB-74, so I&#8217;ve changed it for a Seymour Duncan STC-2A. The basic wiring diagram does not include all the options I had on the original diagram, here are the (small, really small) modifications and some impressions on the STC.Changes
First, I had to widen two pot holes [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve recently burnt the tone circuit of my Cort GB-74, so I&#8217;ve changed it for a Seymour Duncan STC-2A. The basic wiring diagram does not include all the options I had on the original diagram, here are the (small, really small) modifications and some impressions on the STC.<br
/> <span
id="more-308"></span></p><h4>Changes</h4><p>First, I had to widen two pot holes in the bass body. Indeed, the GB-74 balance and master volume pots are smaller than the EQ one, contrary to the STC where they all have the same size.</p><p>Then, I&#8217;ve copied the GB-74 bypass switch. When <em>off</em>, the output of the balance pot is the input of the master pot, without any amplification. On the <em>on</em> position, the usual path is kept, from the balance to the tone circuit and from the tone circuit to the volume pot.</p><div
id="attachment_341" class="wp-caption aligncenter" style="width: 247px"><a
href="http://matt.eifelle.com/wp-content/uploads/2009/01/2b_t_circuit.jpg"><img
src="http://matt.eifelle.com/wp-content/uploads/2009/01/2b_t_circuit-237x300.jpg" alt="Modified wiring diagram" title="2b_t_circuit" width="237" height="300" class="size-medium wp-image-341" /></a><p
class="wp-caption-text">Modified wiring diagram</p></div><p>I&#8217;ve also kept the Cort humbucker switch, which can either use one of the two micro lines or both in parallel.</p><p>On the original Cort wiring diagram, the bypass switch is located on the main volume pot, and the EQ switch is alone. With the STC, the EQ switch is located ont he volume pot. It is possible to change this, but it means unsoldering the switch and as the wires are thinner than the Cort ones, I didn&#8217;t do it.</p><h4>Comments</h4><p>I have some comments on my new tone circuit:</p><ul><li>The wires are thinner than the original tone circuit. Compared to the price of the STC-2, using correct, stronger wires would be expected.</li><li>The STC is based on a similar design than the GB74 tone circuit but it is made with &#8220;real&#8221; components, not SOC. The sound color should be better.</li><li>The EQ switch is awkward: to activate it, the main volume pot must be pulled, so the default position is without tone control.</li><li>I think the global volume is lower than before. I will change the pickups in the future for stronger ones</li></ul><p>I&#8217;m satisfied with my new bass electronics. It wasn&#8217;t complicated to install it, so even someone who did not have much experience with soldering may be able to install it inside one&#8217;s bass.</p>]]></content:encoded> <wfw:commentRss>http://matt.eifelle.com/2009/02/10/and-now-for-something-completely-different-wiring-diagram-for-a-sm-stc-2a/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: matt.eifelle.com @ 2010-07-30 08:23:40 by W3 Total Cache -->