Skip to content

Dplug VST2 Guide

p0nce edited this page Jan 24, 2025 · 16 revisions

How to build VST2 plug-ins with Dplug?

Dplug supports the creation of VST2 plugins based on VST Plug-In Interface Technology by Steinberg Media Technologies GmbH.

Note: as a new entrant in the plugin market, in no way, shape or form, should you release VST2 plug-ins in the public. It won't bring you any advantage. It actually prevents Dplug from evolving and has been abandoned by almost all players. However it can be useful for your tooling since hosting VST2 is super simple.

Step 1. Setting up your environment to support VST2

Please note that newer versions of the VST3 SDK don't contain the full VST2 SDK anymore: The plugin interfaces (required!) are missing. See: https://www.steinberg.net/en/newsandevents/news/newsdetail/article/vst-2-coming-to-an-end-4727.html

It is impossible for a new player to distribute VST2 anymore, however for Dplug it's useful since we don't have any other way to host plugins yet.

For legal reasons Dplug cannot ship with the proprietary VST2_SDK. Instead the said SDK must be provided by Dplug users.

  1. Do you have a valid licensing agreement for Steinberg VST 2 Plug-Ins SDK?
  2. Make sure your copy of the VST SDK contains the VST2 plugin interfaces.
    Check the VST2_SDK folder for whether it has a pluginterfaces sub-directory and finally contains those two files: /VST2_SDK/pluginterfaces/vst2.x/aeffect.h, /VST2_SDK/pluginterfaces/vst2.x/aeffectx.h.
  3. Extract your copy of the VST2 SDK to some persistent folder.
  4. Create an environment variable (named VST2_SDK) that links to it.

Setting an environment variable in Windows using PowerShell

# Replace `C:\VST2_SDK` with your path to the `VST2_SDK` folder (the one containing the `pluginterfaces` directory).
[System.Environment]::SetEnvironmentVariable('VST2_SDK', 'C:\VST2_SDK', [System.EnvironmentVariableTarget]::User)

System-wide: Replace [System.EnvironmentVariableTarget]::User with [System.EnvironmentVariableTarget]::Machine.

Tip There's also a fancy GUI for that. Check out the "Advanced" tab in sysdm.cpl ("System Properties"), there’s a "Environment Variables…" button that opens the graphical editor.

Setting an environment variable in Linux using Bash

System-wide:

# Replace `/opt/VST2_SDK` with your path to the `VST2_SDK` folder (the one containing the `pluginterfaces` directory).
echo -e '\nVST2_SDK="/opt/VST2_SDK"' >> /etc/enviroment
reboot

bash: /etc/enviroment: Permission denied > Make sure to run this command with the necessary privileges (usually root).
For users of sudo: Execute the command in a sudo -Hi root shell.

Step 2. Modifying dub.json

(Dplug v15) Add a dplug:vst2 dependency in your plugin's dub.json

"dependencies":
{
    "dplug:vst2": "~>15.0"
}

Step 3. VST2 Configuration

Add a configuration with a name starting with VST2 in your plugin project.

Dplug v15:

"configurations": [
    {
        "name": "VST2-PLATINUM-EDITION",
        "versions": ["VST2"],
        "targetType": "dynamicLibrary",
        "lflags-osx-ldc": [ "-exported_symbols_list", "module-vst2.lst", "-dead_strip" ],
        "lflags-linux-ldc": [ "--version-script=module-vst2.ver" ]
    }
]

You can find module-vst2.lst and module-vst2.ver in the distort or clipit examples.

Step 4. Building with dplug-build

Build with the right configuration:

$ dplug-build -c VST2-PLATINUM-EDITION

Legal info

Read the Steinberg VST 2 Plug-Ins SDK Licensing Agreement you've signed for further details. Especially, §3 might be interesting for you.