Build Vst Plugin
Virtual studio technology (VST) is an audio plug-in software interface that integrates a software synthesizer and effects into digital audio workstations. It uses digital signal processing to simulate a traditional recording studio’s hardware in software.
There are both commercial and freeware versions of VST plug-ins available in the market.
Type of plugin: VSTi. What it does: This virtual analog synth was inspired by the Clavia Nord. I wrote up a HOWTO for VST development on C with Visual Studio awhile back which details the steps necessary to create a basic plugin for the Windows platform (the Mac version of this article is forthcoming). On Windows, a VST plugin is just a normal DLL, but there are a number of 'gotchas', and you need to build the plugin.
Think of VST plugins as an affordable way of making your home studio sound like an expensive commercial studio setup.
- 10 Best Opto Compressor Plugins (VST,AU,AAX) For Transparent Sound
- The 15 Best Delay Plugins For Mixing (VST, AU, AAX)
- The 33 Best WAVES Plugins Of 2020
- 29 Best Sound Design VST Plugins In 2020
- 17 Best Free EQ VST Plugins
What are the Best Tools to Develop VST Plug-ins?
I have listed a couple of libraries and frameworks that can handle most of the coding required in developing VST plug-ins.
JUCE Cross-Platform C++ Library
It is supported by the following platforms: OSX, Windows, Linux, iOS, and Android. It is free for non-commercial releases, but the commercial license works our best. It also covers 64bit systems.
Pricing of its commercial license
- Commercial license for a single product – $521
- Commercial license for any number of products – $912
- Upgrade from single-product version to unlimited version – $455
Despite the cost of the license for retail releases, it is the only library/framework option for a 64bit cross-platform.
Watch this video on how to create an awesome distortion VST/AU Plug-in using C++ / JUCE Framework
SynthEdit
SynthEdit is a framework and a visual circuit design that allows you to create your own synths with only drag & drop without programming. Therefore giving you the flexibility of using your DSP algorithms inside the modules.
At the time of writing this the 64-bit version is in Alpha and its creator Jeff McClintock is working on the ability to exporting it to AU. It’s got a ton of community-produced modules and works great with the 32-bit version. It is soft on your wallet – goes for $70.
Check out this video how SynthEdit work –
FL SynthMaker
FL SynthMaker aka flowstone comes free with FL studio.
It has a straightforward drag-and-drop graphical interface and a wide range of components. You can use it to code modules and DSP in Ruby and comes with loads of examples to get started quickly and its ability to assist you in creating a prototype within a short time is a plus.
How Are VST Plugins Made
You’ll be required to source for information from different sources depending on what your specific goals are.
For beginners, before learning how to code VST plugins, I would advise you to check out these environments:
- SynthEdit, SynthMaker, Reaktor, Max/MSP, PureData
- CSound, SuperCollider, Bidule, Usine
These environments allow you to build something unique without having to write low-level code which most people find difficult to master. You’ll be required to know different areas, and if you already have some, then you’ll only require to fill in the gaps.
Check out this video to learn how to build and design your VST Plugin using JUCE
Audio Basics
Understanding sound and its properties are essential before embarking on the development of VST plug-ins. I have outlined a couple of online resources you should go through them:
Fundamentals of Digital Audio Processing
The Scientist and Engineer’s Guide to Audio Signal Processing
Discrete-time systems, sampling theorem, audio DSP, maths, psychoacoustics, sound analysis, and sound modeling.
Fingerprint vst free. Signals, Sound, and Sensation by William M. Harmann
The book got an introductory text on psychoacoustics and the readers on a journey through the mathematics of signal and processing from its beginnings.
- 6 Best Passive EQ VST Plugins of 2020 (SPL, UAD, Waves, IK Multimedia)
- Top 6 Spectrum Analyzer Plugins Of 2020 – Spectral Analysis Tools
- 37 Best FREE VST Compressor Plugins For Mixing & Mastering
- 11 Best Granulizer Plugins 2020 for a Future Sound Design
- 10 Best Noise Gate Plugins (VST,AU, AAX) of 2020
Programming
Many professional VST plugins available on the market have been written in C++.
There are also several other languages you can use, but each got their pros and cons.
Learning how to develop VST Plug-ins as you’re learning to program isn’t easy. I usually recommend learning how to program before starting to create VST plug-ins.
The Audio Programming Book by Richard Boulanger – This book comes highly recommended for those who want to learn audio plug-ins.
BasicSynth by Daniel Mitchell – This one shows you how to create a custom synthesize in software using C++ programming language.
For more further information about VST development, you should definitely check these resources:
Audio Software (VST Plugin) Development with Practical Application
JUCE framework for VST-plugin development
Maths
You should have some basic engineering mathematics such as linear algebra, complex analysis, among others. Visit this website to get practical algebra lessons: www.purplemath.com.
Digital Signal Processing
You must know what an FFT routine is and why it is useful. Advanced content focusing on audio will usually require you to have at least a conversational level of DSP understanding.
Check out these resources on DSP:
Online and Free:
The Scientist & Engineer’s Guide to Digital Signal Processing
Print:
Understanding Digital Signal Processing by Richard G. Lyons
Audio Digital Signal Processing
Audio DSP extends on core DSP concepts to include the way digital signal processes apply to digital audio. It covers subjects such as audio filters, delays, and non-linear effects; think compression.
DAFX by Udo Zolzer is a book that comes highly recommended and covers many aspects of audio DSP technique.
Check out these online resources to get more info:
DSP Audio Classics
DSP Audio Algorithm Notes by XOXOS
Below are threads on VST Plug-ins I found from a couple of online discussion forums:
Advice for someone with ZERO experience
Developing a Vst Effect Plugin Where To Start?
What is your development setup?
Books
I have listed some books that can serve as a resource in your pursuit of learning how to make VST plug-ins.
Check them here:
Designing Software Synthesizer Plug-Ins in C++: For RackAFX, VST3, and Audio Units
Audio Plug-ins frameworks
JUCE
JUCE is a highly recommended and all-encompassing C++ class library for developing cross-platform software. JUCE includes components for VST, AU, and RTAS. You should have at least a basic grasp of JUCE if you intend to use C++ for the development of your VST plug-in.
IPlug
This is a C++ framework for developing audio plug-ins and GUIs.
VST.NET
It allows VST Plugin developers to write Plugins in any .NET language. It also eases the transition between the C++ and .NET world and its framework built on top of the interop layer provide a clear and structured architecture. Feel free to check this Delphi library for creating VST plugins, VST hosts but also ASIO applications:
Delphi ASIO and VST
It also includes the algorithm for filters and dynamics.
- The 6 Best Ring Modulator VST Plugins in 2020 KiloHearts, Melda
- 7 Best Vari-Mu Compressor Plugins of 2020 Arturia, Manley, IK Multimedia
- 7 Best Autopan VST Plugins 2020 CableGuys, Melda, Waves, Soundtoys
- The 6 Best Frequency Shifter VST Plugins Of 2020
What is the best programming language for the VST plugin?
C++ is one of the best programming languages for creating VST Plug-ins, and the reason for this is that C++ has a wide range of frameworks and libraries that work so well in creating VSTs. Read more What’s the Best Way How To learn C++?
The WDL-OL library makes C++ an attractive programming language for VST plugins because it helps you with the following:
- Creating multiple formats (VST, AudioUnit, VST3, and RTAS) from one codebase: Just choose the plugin format and click “run.”
- Create both 32-Bit and 64-Bit executables.
- Run your plugin as a standalone application (Windows or Mac). It means you don’t technically need a DAW to use the plugin.
- Most GUI controls used in audio plugins (knobs, buttons, visuals).
Understanding what VST Plugins are and their role within the music production industry provides you with the knowledge of identifying the most effective tools for your music production outfit. It makes your music sound like it was produced in a million-dollar music studio.
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).
Write Vst Plugin C++
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)
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:
Build Vst Plugins
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. Free drum track vst. 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.
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.