This section describes generation of a Windows VST plugin starting from Faust code, again using the constant-peak-gain resonator example.
The VST (Virtual Studio Technology) plugin standard was developed by Steinberg Media Technologies (makers of Cubase). It enjoys wide usage on Windows and Macintosh platforms. The Faust distribution contains the make-file /usr/lib/faust/Makefile.vstcompile for compiling and installing VST plugins using Xcode on a Mac OS-X machine. For our example, however, we'll create a Windows-format VST plugin (.dll file) using Microsoft Visual C++. The example was tested on a Muse Receptor.K.15
Because the Receptor does not support mono plugins, the process line in the Faust source in Fig.K.7 was modified as follows to make it stereo-compatible:
process = + : firpart : + ~ feedback <: (_,_)This version was named cpgrui_vst.dsp. To generate a VST plugin, we simply use a VST architecture file:
faust -a vst2p4.cpp cpgrui_vst.dsp -o cpgrui_vst.cppNext, the file cpgrui_vst.cpp was copied over to a Windows-XP machine with Microsoft Visual Studio Express installed (including Visual C++ 2008). The programming sample ``again'' from the Steinberg VST-2.4 SDK was copied to an adjacent directory cpgr and trivially modified to create a compilable C++ project. (Specifically, replace again.cpp by cpgrui_vst.cpp, rename again.vcproj to cpgr.vcproj, and change all occurrences of ``again'' to ``cpgrui_vst'' in cpgr.vcproj, and change ``Gain'' to ``CPGR'' to rename the plugin. Finally, double-click on cpgr.vcproj to launch Visual C++ on the cpgr project.) Selecting the menu item ``Build / Build cpgr'' creates cpgr/win/Debug/cpgr.dll (the VST plugin itself). To test the plugin, it was copied into the ``Unsupported Plugins'' folder on the Receptor, and installed by clicking the ``1 installs'' button on the Receptor's Setup page. After that, the plugin could be instantiated on a Receptor ``Mix'' channel, as shown in Fig.K.13, and Fig.K.14 shows the automatically generated edit window of the plugin.
- Download and install the following RPMs from SourceForge:
mingw-binutils-2.18.50-6.fc8.i386.rpm mingw-gcc-core-4.2.1-6.fc8.i386.rpm mingw-gcc-g++-4.2.1-6.fc8.i386.rpm mingw-runtime-3.14-3.fc8.i386.rpm mingw-w32api-3.11-3.fc8.i386.rpm(Unfortunately, mingw is not in the standard yum repos yet.)
- In Makefile.w32vstcompile, edit the VST line
to say where your vstsdk2.4 directory is located, and
change all occurrences of i586-mingw32msvc to
- The plugin name defaults to ``FaustFx''. You can change this by
declaring the name in your Faust source. For the example
of the previous section, we could say
declare name "CPGR";in place of the longer name used in Fig.K.7. (The longer name results in a plugin called ``ConstantPeakGainResonator''.)
- After the make, simply copy the dll file to the Receptor and tell the
Receptor to install it on the Setup page of the Receptor Remote
Control program as before (which requires Windows or a Mac). While
one can press the Setup button on the Receptor front panel and rotate
the Top Display Knob to ``Install/Upgrade'' (the next-to-last entry),
there you will find ``0 files'' even when there is a file to install.
The manual documents that it is not allowed to install plugins from
the Receptor front panel, because some installs require a user
interface (such as to receive an authorization code). This is an
unfortunate and unnecessary restriction in our case that prevents
working entirely directly with the Receptor from a Linux environment.
The Receptor's ``Unsupported Plugins'' directory can be mounted as follows:
> mkdir /mnt/receptor > mount -t cifs <ReceptorIPA>:hard\ drive/Program\ Files/VST\ Plugins/Unsupported\ Plugins \ /mnt/receptor(Remember to say
umount /mnt/receptorwhen you are done.) The Receptor's IP Address (typically assigned by DHCP) can also be viewed by pressing the Setup button and rotating the Top Display Knob to that field.
Generating a MIDI Synthesizer for PD
Generating a LADSPA Plugin via Faust