Coding For Vst Plugins
- How do I unlock my VST plugins using the FLRegkey.Reg file? This page is a starting point for unlocking various products on Windows and Mac.
- AU plugins do not use the same naming conventions and so FL Studio won't be able to match a VST and AU plugin when loading projects. Most 3rd party developers create VST plugins, then add an additional layer of code to provide AU compatibility. This means VST plugins may have slightly less processing overhead compared to their AU counterparts.
- If you know a.NET language (C#/VB.NET etc) then checkout VST.NET. This framework allows you to create (unmanaged) VST 2.4 plugins in.NET. It comes with a framework that structures and simplifies the creation of a VST Plugin with support for Parameters, Programs and Persistence.
Open Source Audio Plugins & Apps. A list of open source VST (and other format) plugin/app projects. The intention of this list is to catalog open source plugins or apps which are fully featured or are useful examples which have non-trivial features. In this tutorial series we will be learning how to create audio plugins that run as VST, VST3, AU, RTAS, AAX or as a standalone application. Audio plugins are programs that are loaded into a host software (such as Ableton Live, Logic or REAPER).
A list of open source VST (and other format) plugin/app projects. The intention of this list is to catalog open source plugins or apps which are fully featured or are useful examples which have non-trivial features.
The main benefit of having Open Source plugins/apps is that the code itself is preserved for the future, so when the author(s) stop updating it the community can continue using and developing the software. Open Source projects are also a great way to learn how different audio FX/instruments are created.
https://openaudio.webprofusion.com
Please contribute links!
Audio Plugins
Plugin | Description | Type | Framework |
---|---|---|---|
ADLplug | FM Chip Synthesizer — OPL & OPN | Instrument | JUCE |
andes | Sound synthesiser plugin based on Perlin noise | Instrument | JUCE |
Airwindows | Various small and experimental effect plugins | Effect | |
amsynth | Analog-modelling (virtual analog) synthesizer | Instrument | GTK |
Argotlunar | Real-time delay-line granulator | Effect | JUCE |
Audio Effects | Plugins implemented from the explanations in the book “Audio Effects: Theory, Implementation and Application” | Effect | JUCE |
BinAural VST | Mono-to-stereo plugin that positions sound in a 3D space using Head-Related Transfer Functions | Effect | JUCE |
BlackBird | Analog-inspired software synth with its own voice | Instrument | JUCE |
Calf Studio Gear | Many LV2 and Jack audio plug-ins | Effects | GTK |
CHOW | A maximally truculent distortion effect | Effect | JUCE |
Cloud Seed | Algorithmic reverb for emulating huge, endless spaces and modulated echoes | Effect | |
Cocoa Delay | Warm and lively delay | Effect | WDL-OL |
Convolver | Impulse-response reverb | Effect | VSTGUI, JUCE |
Dexed | DX7 FM plugin synth | Instrument | JUCE |
Digits | Phase-distortion synth inspired by Casio CZ series | Instrument | VSTGUI |
Distrho glBars | OpenGL bars visualization plugin (as seen in XMMS and XBMC/Kodi) adapted from jack_glbars | Effect | DPF |
Distrho Juice Plugins | Misc | DPF | |
Distrho Kars | Simple karplus-strong plucked string synth based on the karplong DSSI example synth | Instrument | DPF |
Distrho Mini-Series | Collection of small plugins based on LOSER-Dev Plugins | Effect | DPF |
Distrho MVerb | DPF-based version of MVerb | Effect | DPF |
Distrho ndc Plugs | DPF-based versions of some of ndc Plugs | Effect | DPF |
Distrho Nekobi | Simple single-oscillator synth based on Roland TB-303 | Instrument | DPF |
Distrho ProM | Music-visualizer plugin based on projectM | Effect | DPF |
Dragonfly Reverb | Hall-style reverb based on Freeverb3 algorithms | Effect | DPF |
Element | Advanced Audio Plugin Host | Misc | JUCE |
Eurorack | Diverse set of physical modeling sources, organic processors, wavetable oscillators, waveshapers, granular synths, and utility modules | Misc | |
Flutterbird | Simple pitch fluctuation | Effect | iPlug 2 |
Gverb/Gigaverb | Reverb | Effect | VSTGUI |
Helm | Polyphonic synth with lots of modulation | Instrument | JUCE |
hexter | Yamaha DX7 modeling FM synth for DSSI | Instrument | DPF |
HiLoFilter | Simple hipass/lopass filter controlled with a single knob | Effect | JUCE |
JuceOPLVSTi | FM synth based on Yamaha OPL2/3 emulation from DOSBox | Instrument | JUCE |
Juno 6 | Roland Juno 6/60 Synthesizer | Instrument | |
keithhearne/VSTPlugins | A collection of VST plugins | Effect | JUCE |
K-Meter | Implementation of a K-System meter according to Bob Katz’ specifications | Effect | JUCE |
KickMaker | Synth specifically to create kick-drum sounds | Instrument | VSTGUI |
LameVST | LameMP3 as an effect | Effect | |
Magical8bitPlug 2 | Old 8bit game console style synth | Instrument | JUCE |
mda | FX and virtual instruments for PC and Mac | Misc | (no GUI) |
Mika Micro | Simple subtractive synth | Instrument | WDL-OL |
MVerb | Studio-quality reverb using the Dattorro’s figure-of-eight reverb structure | Effect | VSTGUI |
NotNotchFilter | Performance-oriented filter designed to replace the mid-EQ found in a standard 3-band DJ mixer | Effect | JUCE |
ndc Plugs | VST plugins for Windows and OSX | Misc | |
Odin2 | Polyphonic Synth | Instrument | JUCE |
OwlBass | Additive bass synth | Instrument | JUCE |
OB-Xd | Based on the Oberheim OB-X | Instrument | JUCE |
Oxe FM Synth | Multitimbral 8-operator FM synth (VST 2.4; Windows, Linux, macOS) | Instrument | VSTGUI |
PulseDelay | Timed delay effect | Effect | (no GUI) |
QtVST | VST plugins with a Qt interface | Effect | Qt |
Regrader | Degenerative delay | Effect | VSTGUI |
Roth-AIR | Mixing tool for easily adding airy, crispy presence to audio | Effect | JUCE |
ScorchCrafter Guitar FX | Audio DSP FX and plugins, mostly for guitar (amp sim) and other FX | Effect | VSTGUI |
sfizz | SFZ parser library and instrument plugins | Instrument | VSTGUI |
ShoutVST | VST for streaming sound into Icecast/Shoutcast directly from VST hosts | Effect | VSTGUI, FLUID |
Sound Analyser | Real-time audio analysis to allow anyone to quickly set up and experiment with different algorithms | Effect | JUCE |
Surge | Subtractive wavetable synth | Instrument | VSTGUI |
Synister | Subtractive synth | Instrument | JUCE |
Syntage | VST 2.4 .Net Study Synth | Instrument | |
Temper | Digital distortion targeting VST, VST3, and AU for OS X and Windows | Effect | Faust, JUCE |
Tunefish | VST virtual analog synthesizer | Instrument | JUCE |
traKmeter | Loudness meter for correctly setting up tracking and mixing levels | Effect | JUCE |
VCV Rack | Virtual modular synth | Misc | RtAudio |
VSTSID | SID synthesizer instrument | Instrument | |
VST2413 | FM synth based on emulator of YM2413 (OPLL) chip used in Sega Master System and FM-PAC MSX expansion | Instrument | (no GUI) |
Wolf Shaper | Waveshaper plugin with spline-based graph editor | Effect | DPF |
YK Chorus | Chorus audio effect plugin based on DSP code by TAL | Effect | DPF |
zam-plugins | LADSPA/LV2/VST/JACK audio plugins for high-quality processing | Effect | DPF |
Collections
- Linux Synths - a list of linux based synths, some of which are open source
- SFZ Instruments - a list of SFZ instruments, most of which are free
- VCV library — a library of plugins compatible with VCV Plugin Manager
Open Source Audio Apps
Software | Source | Description |
---|---|---|
Ardour | Ardour/ardour | DAW |
ASIO2WASAPI | levmin/ASIO2WASAPI | Universal ASIO driver for Windows |
Audacity | audacity/audacity | Audio editor |
Carla | falkTX/Carla | GNU/Linux Plugin Host |
Element | Kushview/Element | Advanced Audio Plugin Host |
FlexASIO | dechamps/FlexASIO | Universal ASIO driver for Windows |
Giada | monocasual/giada | Loop machine |
Guitarix | SourceForge → guitarix | GNU/Linux Virtual Amplifier |
Helio Workstation | helio-fm/helio-workstation | Sequencer |
HISE | christophhart/HISE | Cross-platform framework/application for building sample-based virtual instruments (VST, AU, AAX) |
Hydrogen | hydrogen-music/hydrogen | Drum machine |
NewMixer | jatinchowdhury18/NewMixer | Mixing Software |
LMMS | LMMS/lmms | DAW |
OpenMPT | OpenMPT/openmpt | Popular tracker (formerly ModPlug Tracker) for Windows with support for IT, XM, S3M, MOD modules, VST plugins and ASIO |
OwlPlug | DropSnorz/OwlPlug | Audio plugin manager |
orDrumbox | SourceForge → ordrumbox | Drum machine |
Psycle | SourceForge → psycle | Modular music tracker |
StudioRack | github.com/studiorack | Audio plugin manager |
VCV Rack | VCVRack/Rack | Modular synth |
Zrythm | zrythm/zrythm | DAW |
Open Source Software Development Libraries
Library | Source | Description |
---|---|---|
Cabbage | rorywalsh/cabbage | Framework for developing audio plugins and standalone instruments with Csound |
Csound | csound/csound | Programming language for sound and music synthesis |
DPF | DISTRHO/DPF | C++ framework for creating cross-platform audio plugins |
Faust | grame-cncm/faust | Functional programming language for real-time signal processing |
FluidSynth | FluidSynth/fluidsynth | Real-time synth based on the SoundFont 2 specifications |
iPlug 2 | iPlug2/iPlug2 | Simple-to-use C++ framework for developing cross-platform audio plugins/apps |
JUCE | WeAreROLI/JUCE | Cross-platform C++ framework for developing desktop and mobile apps and audio plugins |
jVSTwRapper | SourceForge → jvstwrapper | Wrapper to write audio plugins in Java (VST 2.4, AU, LADSPA; Windows, Linux, macOS) |
libopenmpt | OpenMPT/openmpt | Cross-platform C/C++ module-playback library based on OpenMPT |
PortAudio | Assembla → portaudio | Cross-platform audio I/O library |
RtAudio | thestk/rtaudio | C++ classes for cross-platform real-time audio I/O |
rust-vst | rust-dsp/rust-vst | VST 2.4 API implementation in the Rust language |
Soundpipe | PaulBatchelor/Soundpipe | Lightweight music DSP library written in C; over 100 modules, many ported from Csound |
VSTGUI | steinbergmedia/vstgui | User-interface toolkit mainly for audio plugins |
WDL-OL | olilarkin/wdl-ol | Simple-to-use C++ framework for developing cross-platform audio plugins (superseded by iPlug 2) |
Code Samples
- KlangFalter — a convolution audio plugin (e.g. for usage as convolution reverb)
- FFTConvolver — an audio convolution algorithm in C++ for real-time audio processing
Open Data Resources
- OpenAIR — the Open Acoustic Impulse Response Library (Convolution Reverb Impulse Responses to recreate reverb character of space and equipment/recordings)
Introduction
Microsoft announced that it would offer Visual Studio Express free of charge forever. Though the Express version of Visual C++ (hereafter referred to as VC++) has some limitations, it’s still a great tool and it’s nice to see Microsoft taking some steps to support the developers writing software for their platform. This document will describe how to get VC++ installed and building VST plugins. It assumes that you have prior experience developing VST plugins, and are familiar with the structure and layout of the VST SDK.
If you are trying to write VST’s in a language other than C++, than this guide is not for you. There are lots of other frameworks out there for developing VST plugins in other languages (such as C#, Java, Ruby and Python, just to name a few).
This tutorial will walk you through the process of installing and configuring the tools you’ll need to build your own VST plugins with Visual Studio, and creating a simple VST plugin with optional support for a VSTGUI frontend. This guide only covers building VST 2.x plugins, as the VST3 SDK is not very widely supported yet. Note that Steinberg’s website is a bit confusing and it is easy to accidentally download the wrong version of the SDK, so double-check to make sure that you have the 2.4 SDK.
Download required packages
- Steinberg’s VST SDK, which requires you to make a free Steinberg Developer account.
- Microsoft’s Visual C++. This guide uses the 2010 Express edition, as it was the latest version at time of writing.
- Libpng and zlib (optional)
Install Visual C++
If you already have a working installation of VC++, you can skip this step. Otherwise, download VC++ and install it. The standard installation should be OK, but you can choose to perform a custom installation if you don’t want documentation or other stuff installed with it. Before installing VC++, you must remove any other versions of VC++ on your computer.
Next, download and install the Platform SDK, which will provide you with the standard header files and libraries you’ll need to build software. You may choose to install VC++ anywhere on your hard drive, but the default location is C:Program FilesMicrosoft Visual Studio 10.0
.
Creating your project
Create a new project of type “Class Library”, which we’ll call YourProjectName. In the rest of this tutorial, whenever you see YourProjectName, replace that text with the actual name of your project.
In Visual Studio 9, you’d make a new project with the wizard found at File -> New -> Project. Select Visual C++ -> Win32 Console Application, and choose a directory for your project. When the wizard opens, press “Next” and select DLL as the Application Type. Also check the “Empty Project” box.
If you prefer not to start with an empty project, then you can remove all of the files that VC++ creates for you, but keep the resource.h
and YourProjectName.rc
files, and remove any references to these files (such as YourProjectName.ico
being listed in the resource file).
Add Source Code to the Project
If you already have source code for your plugin, simply add it to the project. Otherwise, you need to create the following files:
- YourProjectName.cpp
- YourProjectName.h
- resource.h (Only needed if building a plugin GUI)
- YourProjectName.rc (Only needed if building a plugin GUI)
Coding For Vst Plugins Vst
You will also need to add the files from the VST SDK, which includes everything under the vstsdk2.4/public.sdk/source/vst2.x
and vstsdk2.4/pluginterfaces/vst2.x
directories. I usually prefer to manually make groups for these directories and drag the files to the groups from Explorer, as dragging the entire “vstsdk2.4” directory to VS can cause it to choke when it tries to add a bunch of unused files to the project.
To start out with, the plugin’s entry point header file (YourProjectName.h) should look something like this:
The accompanying class definition (YourProjectName.cpp) should look something like this:
Note that your project won’t compile just yet, but be patient!
The above code samples are simply blank entry points which don’t do anything exciting. The VST SDK offers lots of methods which you can override in order to do things like setting parameters, receiving MIDI messages, and so on. These things are beyond the scope of this tutorial; if you don’t know what code to put inside of processReplacing, try checking out the “again” example distributed within the VST SDK in the public.sdk/samples/vst2.x/again
folder.
You must also create a module definition file for your project, named YourProjectName.def. Usually this file is placed in the same directory as the VC++ project file, but you may place it somewhere else so long as this definition matches the Module Definition File settings in the Linker section of the project preferences. This is just a plain-text file which should contain the following text:
Configure build settings
Go to the project settings either by right clicking on the project in the solution explorer and then selecting “Properties”. Make the following changes to the project for all build configurations:
- General
- Character Set: Not Set
- Common Language Runtime Support: No Common Language Runtime Support
- C/C++
- General:
- Additional Include Directories:
- (or wherever you put the VST SDK)
- Your source code directory
- Any other directories which you may have header files stored in Global SDK directories, such as
- Additional Include Directories:
- Preprocessor:
- Preprocessor Definitions:
- For Debug builds you may also wish to add
- If you wish to use PNG graphics for a VSTGUI frontend, add
- To avoid lots of compiler nags and warnings, define
- In some cases, you may also need to define
- Code Generation:
- Runtime Library: Multi-threaded. Multi-threaded debug may be used for debug builds. This will build the VC++ common runtime library statically into your plugin, increasing its size by approximately 200Kb. If you choose to use the CRL as a dynamic library, then you must also distribute a copy of the CRL with your application, which complicates deployment and distribution.
- Precompiled Headers:
- Precompiled Header: Not Using Precompiled Headers. Yeah, this makes rebuilding a bit slower, but will avoid a bunch of weird errors as you are getting your project set up. Once you get the project building you can revisit this step.
- General:
- Linker
- General:
- Additional Library Directories: Add any other library directories which your project depends on.
- Input:
- Additional Dependencies (for Release builds):
- libcmt.lib
- uuid.lib
- shell32.lib
- ole32.lib
- gdi32.lib
- User32.lib
- advapi32.lib
- zlib.lib (only if you are building with a GUI)
- libpng.lib (only if you are building with a GUI)
- Additional Dependencies (for Debug builds):
- shell32.lib
- msvcrtd.lib
- ole32.lib
- gdi32.lib
- User32.lib
- advapi32.lib
- zlib.lib (only if you are building with a GUI)
- libpng.lib (only if you are building with a GUI)
- Ignore Specific Default Library (for Release builds):
- msvcrt.lib
- libc.lib
- msvcrtd.lib
- libcd.lib
- libcmtd.lib
- Ignore Specific Default Library (for Debug builds):
- libcmt.lib
- libcmtd.lib
- msvcrt.lib
- Module Definition File: YourProjectName.def
- Additional Dependencies (for Release builds):
- General:
Adding support for VSTGUI (optional)
Include VSTGUI support in your plugin, simply add the VSTGUI files into your project in addition to your own editor class. At a very minimum, these are:
- aeffguieditor.cpp
- vstcontrols.cpp
- vstgui.cpp
Adding support for PNG graphics (optional)
If you would like to use PNG’s in your plugin instead of BMP graphics, you will need to also build your own version of libpng and zlib. Download the source code for both libraries from the links given in the “Requirements” section of the document and place them in the same directory. There is a Visual Studio project for libpng which will also build zlib for you; it is located in the projectsvisualc71
directory. In order to get the projects to build correctly, you’ll need to rename the source code directories to simply “libpng” and “zlib”, removing the version numbers from the directory name.
When you open the project up, VC++ will run you through the project conversion wizard. Convert the project, and change the “Runtime Library” settings in both libpng and zlib to be Multi-Threaded, as described above. Unless this step is performed, the dependency on the CLR will be present in your project. Next, choose the LIB ASM Release or LIB Release build style and build the project; if you build the libraries as DLL’s, you will be unable to statically link them into your plugin. The project should build ok, but throw a few errors when attempting to run the pngtest files. You can ignore these problems, as the libraries will still be correctly compiled and can now be linked to your project.
Visual Studio doesn’t need to have the libraries within your actual project. Instead, place the libraries in a directory of your choosing and be sure to add this path to the list of “Additional Library Directories” in the Linker preferences for your project. You may choose to place the libraries in the same directory as the Microsoft Platform SDK stuff, but I personally prefer to keep them in a separate directory checked into version control. Also be sure to add references to libpng.lib
and zlib.lib
for your project in the “Additional Dependencies” section of your Linker preferences for the project.
The path must be relative to the location of the project file. Then, in resource.h
, add the following preprocessor definitions:
Now you can use IDB_BITMAP1
(or any other name of your choosing) in your code when creating new CBitmap objects.
I have heard some reports of vstgui.cpp
not compiling properly due to the missing symbol png_set_expand_gray_1_2_4_to_8
. Changing png_set_gray_1_2_4_to_8
to png_set_expand_gray_1_2_4_to_8
in vstgui.cpp
seems to fix this issue.
Final considerations
VC++ ships with an optimizing compiler, but sometimes the compiler will choke on certain files and optimization must be disabled. In particular, I have experienced this with Laurent de Soras’ FFTReal libraries, since they are written as template classes. In general, however, optimization is a good idea, as is “Eliminating Unreferenced Data” (in the linker settings). The “Whole Program Optimization” setting appears tempting, but usually results in dozens of build errors and problems, so it’s best to avoid this. Also, be sure to use the optimization features of this compiler and linker, as they can greatly boost runtime performance.
If you are developing on a multi-core machine, then you might need to disable parallel builds by setting the number of parallel builds to 1 under Tools -> Options -> Projects and Solutions -> Build and Run. In past verisons of VS, I noticed that the compiler does not always link projects in the order one would expect, which caused odd errors during linking about missing symbols. However, VS2010 users probably shouldn’t need worry about this setting.
Unresolved symbols when linking
Sometimes you may see errors like the following:
If you are getting errors in your build about missing symbols, make sure that you double- and triple-check the debug and release configurations for the library configuration above, since some of the libraries which are used in one build style are specifically excluded from the other. Also, when you close and re-open the project’s build properties, VS always “forgets” the last selected build style, so remember to check and set this appropriately.
Coding Vst Plugins
Also, you should check to make sure that the Platform SDK was correctly installed on your system and that your project’s include and library paths are pointing to these directories.
Unresolved external symbols
If you are seeing errors like this:
Then this most likely means that the file which contains the given symbol is not correctly added to the VC++ solution.
Linking errors with symbols defined multiple times
This is undoubtedly one of the most frustrating problems which can occur when building a VST in VC++. If you are seeing error messages like this, then it most likely means there is some problem with your library configuration:
Most likely, the libcmt and msvcrt libraries are being included incorrectly in your build. Double-check the library list above, keeping in mind that the recommended configuration uses libcmt for release builds only, and msvcrtd for debug builds only.