Skip to content

Dplug VST2 Guide

p0nce edited this page Jan 7, 2024 · 12 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.

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

VST SDK v3.6.10 is the latest version suitable.
Starting with VST SDK v3.6.11 those VST2 plugin interfaces are removed.

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.

    If not: Maybe you've got an older version of the SDK somewhere?
    Still no: You could try to contact Steinberg and ask kindly for a copy. Otherwise: Sorry, you can't use VST2 with Dplug. There's no other legal way to set you up with the VST2 SDK. (Please don't post such requests on the issue tracker. They would come to nothing.)
  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 v11) Add a dplug:vst2 dependency in your plugin's dub.json

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

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

eg:

"dependencies":
{
    "dplug:vst": "~>10.0"
}

Step 3. VST2 Configuration

Initially, Dplug didn't have VST3 support. That's why VST2 was usually referred to as VST (no version number) in Dplug. Since Dplug v11, all names have been mentioning either VST2 or VST3 explicitly.

Add a configuration with a name starting with VST2 in your plugin project (or just VST for DPlug <= v10)

Dplug v11:

"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" ]
    }
]

Dplug v10:

"configurations": [
    {
        "name": "VST-PLATINUM-EDITION",
        "versions": ["VST"],
        "targetType": "dynamicLibrary",
        "lflags-osx-ldc": [ "-exported_symbols_list", "module-vst.lst", "-dead_strip" ],
        "lflags-linux-ldc": [ "--version-script=module-vst.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.