Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clone The Repository
First, make a local copy of the
git clone https://github.com/AuburnSounds/Dplug.git
Dplug/ directory and navigate to an example like
When making a new plug-in it is recommended to start from a Dplug example.
Inside the folder, you'll find several directories and files. Below is a breakdown of important items and what they are used for.
main.d(audio processing, parameters)
dub.json(configuration file for DUB)
pluginInfothat is parsed during compilation)
gfx(images used by the gui)
fonts(font used by the gui)
Getting the VST SDK
In order to build VST2 plug-ins with Dplug, you need to setup the VST SDK on your machine. https://www.steinberg.net/en/company/developers.html
VST2_SDK environment variable to the matching VST2_SDK directory in the SDK.
If you were to distribute VST2 plug-ins, be aware that you need an agreement with Steinberg.
To build the plugin you will need DUB, and either dmd or ldc installed on your system.
Note that both dmd and ldc come with their own copy of the
dub utility. You should be able to use either one.
Open a terminal in the same directory as
distort.d and type
dub --compiler=dmd or
If the build is successful, it will generate a new file called distort.dll in the current directory.
macOS and Linux
Building on macOS and Linux is slightly more complicated as it requires the use of the included
Indeed, the generated
.dylib binary needs an application bundle in order to work.
Open a terminal in the
tools/dplug-build directory and type
dub build to build it with the default compiler.
To put it in your PATH:
sudo ln -s /my/path/to/dplug/tools/dplug-build/dplug-build /usr/local/bin/dplug-build
To build the distort example, navigate to the
examples/distort directory and type
dplug-build uses LDC as the default compiler, but you can use
dplug-build --compiler dmd if you prefer to use DMD.
dplug-build --help to print the details of available parameters.
dplug-build is useful (instead of
dub) whenever your are:
- building macOS Universal Binaries
- building a plug-in in several bitness
- building an AAX or AU plug-in which need a special packaging
- building for every OS in the same way
- building a plug-in in different versions ("configurations" as defined by
The only case that doesn't require
dplug-build to build a plug-in is when you're building a VST under Windows (or Linux) with a single configuration, for a single bitness.
With Visual Studio on Windows
You can use Visual Studio + the VisualD extension to have working debugging on Windows.
.sln solution file with
dub generate visuald or
dub generate -a x86_64 visuald for 32-bit or 64-bit plugins respectively.
Launch a host program from there. You are now attached.
- Get Visual Studio here: https://visualstudio.microsoft.com/
- Get VisualD here: http://rainers.github.io/visuald/visuald/StartPage.html or with the D installer.
With Visual Studio Code on macOS and Linux
You can use Visual Studio Code and the
- Get Visual Studio Code here: https://visualstudio.microsoft.com/
- Get the
native-debugextension and related instructions here: https://marketplace.visualstudio.com/items?itemName=webfreak.debug
Break this glass if you can't debug on Windows
When everything fails, you can use the
OutputDebugMessageA Win32 API as a sort of
printf replacement, and launch
dbgview.exe as an Administrator. This enables a barebones print-based debugging.
Break this glass if you can't debug on macOS
LLDB usually saves the day.
lldb -- /Applications/MyHost.app will launch a LLDB session from the command-line.
At startup, the file
.lldbinit is taken as an input command list, this can improve scriptability.
You can then use
core.stdc.stdio.printf to debug.