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.