Skip to content

Dplug VST2 Guide

Elias Batek edited this page Aug 23, 2019 · 4 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 VST2_SDK by itself. Instead that SDK has to be provided by the user.

  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 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.

There's also a fancy GUI for that. See: http://lmgtfy.com/?s=d&q=windows+environment+variable+gui

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

Add a dplug:vst dependency in your plugin's dub.json

eg:

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

Step 3. VST2 Configuration

Initially, Dplug didn't have VST3 support. That's why VST2 is usually referred to as VST (no version number) in Dplug.

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

"configurations": [
    {
        "name": "VST-PLATINUM-EDITION",
        "versions": ["VST"],
        "targetType": "dynamicLibrary",
        "lflags-osx-ldc": [ "-exported_symbols_list", "module-vst.lst", "-dead_strip" ]
    }
]

You can find module-vst.lst in the distort or clipit examples.

Step 4. Building with dplug-build

Build with the right configuration:

$ dplug-build -c VST-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.

You can’t perform that action at this time.