22.12.2020»»вторник

Make Your Own Vst Plugin

22.12.2020

How to add/create your own VST 3 plug-ins Starting from the HelloWorld Example. The SDK provides a HelloWorld example, you can start from this example to create a new VST 3 plug-in. The iZotope Trash2 originated with the iZotope Trash multi-band distortion plugin. It has been rebuilt from the ground up to make your job easier and give you better results in your audio distortion. It offers wave-based distortion, so customizing your own distortion settings is no problem. Making your own VST host is not a trivial task, but the trickiest part is figuring out how to load the plugins and connect them to your code’s callback functions. As the VST documentation is a bit sparse on the subject of hosting, this guide will assist you in setting up your own host. Create Your Own VST Plugins, Part 5: Create An Audio Volume Control – Guest blog by Audio Dev Academy. It just works, right? Let’s take a detailed look at the inner workings of a basic audio volume control. Being a music producer, changing volume is probably so intuitive to you that you take it for granted. “It just works” right. This is the most comprehensive HUB to VST Plugins online. Create realistic drum patterns for your songs or make your own unique percussion sounds for every project.

The VST Effect Plugins mentioned in this post will without a doubt enhance your mix, and you can ́t really go wrong with any of them. By the way, many of the developers of the VST plugins mentioned in this post have either a paid version of it or accept donations if you want to show your support and help these fantastic creators.

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.

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. Making vst plugins with python. 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.

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 Audio Effect Plug-Ins in C++: With Digital Audio Signal Processing Theory
  1. 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.

Make your own vst plugins

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:

Make Your Own Vst Plugins

  • 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

Writing VST plugins is a lot of fun, but it’s even more fun to write your own host which uses the wide variety of plugins already out there to do something original and new. Making your own VST host is not a trivial task, but the trickiest part is figuring out how to load the plugins and connect them to your code’s callback functions. As the VST documentation is a bit sparse on the subject of hosting, this guide will assist you in setting up your own host.

This guide only covers loading the plugin and basic communication, and the language of choice here is C++. C# programmers should consider using the VST.NET framework, and I’m not sure what frameworks exist for other languages.

Also, it’s worth noting that Teragon Audio has developed an open-source VST host, MrsWatson. Feel free to look at the code and fork it for your own project! If you find yourself using a substantial portion of the MrsWatson source in your own code, please let me know so I can add a link to your project from the MrsWatson page.

Code conventions

In the course of your development, you will probably require logging, error handling, etc. To simplify the code in this tutorial, I have simply written “return -1” or “return NULL” statements, but you should consider expanding this to log some info or handle the error.

Also, this tutorial is written for both Windows and Mac OSX developers. As such, there is a lot of platform-specific code, which you will probably need to box with #ifdef/#endif statements in the preprocessor.

Setting up your build environment

You’ll need to first download and install the following tools:

  1. Steinberg’s VST SDK, which requires you to make a free Steinberg Developer account. This tutorial assumes you are working with the VST 2.4 SDK.
  2. Microsoft’s Visual C++ 2010 Express, if you wish to support Windows.
  3. Microsoft’s Platform SDK, again if you are developing on Windows.
  4. Xcode 4.x, if you are developing on Mac OS X.

Project configuration

Aside from your project files, you need only to add the VST SDK headers into your project’s include path. This includes the following files, which are located under the vstsdk2.4/pluginterfaces/vst2.x directory:

  • aeffect.h
  • aeffectx.h
  • vsfxstore.h

On both Windows and Mac OSX, you should probably configure your program to build as a 32-bit binary, simply because most VST plugins are not 64-bit compatible yet. On the Mac, this gets to be a bit hairy because Apple is working to deprecate Carbon, which is a 32-bit framework. If anyone out there has example code in C (not objective-C) to load a plugin from bundle without using Carbon, please let me know so I can update this article.

Loading the VST plugin

After your host performs its own internal initialization routines, it is time to load the VST plugin from source. This procedure varies a bit depending on the platform, but the algorithm is fundamentally the same: find the plugin, load the dynamic library into memory, acquire the plugin’s main address, and create a VST callback connection. These callbacks are defined function pointers which you should define in one of your project’s header files, and are as follows:

On Windows, VST plugins are simply dynamically linked libraries (DLL’s). The code for opening a DLL library in Windows is fairly simple:

On Mac OSX, VST plugins are also dynamic libraries, but they are packaged as bundles. Your host can open these bundles through the Carbon API. On Mac OS9, VST plugins were packaged as CFM files, which has long since been deprecated, and it is highly unlikely that any modern VST host should need to support this format.

The procedure for opening a plugin under OSX is a bit more complex, but the code should be fairly straightforward. Keep in mind that although a VST plugin can be loaded from any location on disk, they are usually stored in either /Library/Audio/Plug-Ins/VST or $HOME/Library/Audio/Plug-Ins/VST.

Anyways, to load the VST plugin on Mac OSX, that will look something like this:

You need to keep the bundle pointer around until the host is ready to unload the plugin. At this point, you call CFBundleUnloadExecutable and then CFRelease on the bundle’s reference.

Setting up plugin callbacks

At this point, you should now have successfully loaded the plugin into memory, and you can now establish the plugin dispatcher callbacks:

Plugin initialization

At this point, the plugin should be ready to go, so you can initialize it through the dispatcher handle created in the previous step:

Suspending and resuming

Calling the plugin’s suspend and resume methods are a bit counter-intuitive, and are done like this:

Plugin capabilities

The VST protocol uses “canDo” strings to define plugin capabilities, the most common of which are defined in audioeffectx.cpp in the PlugCanDos namespace near the top of the file. To ask a plugin if it supports one of these capabilities, make the following dispatcher call:

Host capabilities

The plugin can also ask the host if it supports a given capability, which is done through the hostCallback() function defined above. The implementation of this file looks something like this:

The full list of opcodes is defined in aeffect.h (for the VST 1.x protocol) and aeffectx.h (for VST 2.x protocol). There are a lot of opcodes, and your application doesn’t need to support them all, but you will soon figure out which ones are the most important through trial and error. Depending on the nature of the opcall, you will either be required to return a given integer value, call a method in the plugin’s dispatcher, or fill the *ptr pointer with some type of data. The VST SDK header files have fairly good documentation specifying what you need to do depending on the opcode.

The MrsWatson source code also contains an example implementation of this function with the most common opcode cases.

Processing audio

In the VST SDK 2.4, processReplacing() became the new standard call. You may have to add in support to your host for the old style of process() plugins, though there aren’t so many plugins out there which still do this. To have the plugin process some audio:

In the above code, there is an inputs and outputs array which should be initialized by your application as soon you have calculated the desired channel count and buffer size. You should not allocate the inputs and outputs arrays in the processAudio() function, as doing so may severely impact performance. Hence, the call to initializeIO() should be made as soon as possible and before the first call to processAudio(). You should also take care to properly initialize the data in both the inputs and outputs array to zero, or else you can get static or other random noise in the processed signal.

Sending MIDI messages

How To Make Your Own Vst Plugins

Processing MIDI events is very similar to processing audio:

The above events array should be allocated and properly initialized by the host to contain the MIDI events which the plugin will receive. The VstEvent structure is defined in aeffectx.h, and there you will also find the respective VstEvent types, all of which are deprecated except for kVstMidiType and kVstSysExType.

Note that the plugin must support the receiveVstMidiEvent canDo in order to process MIDI.

Make Your Own Vst Plugin

Plugin

Final Notes

Make Your Own Vst Plugins

At this point, you should have a basic working host capable of loading and communicating with a VST plugin. As you continue your development, take care to thoroughly read the VST SDK header files and other associated documentation, as they will provide you with further hints as to the correct implementation. Also, you should take time to create good logging facilities in your host, particularly in the hostCallback() method, as most plugin incompatibilities are usually triggered from some error there.

 mo41onless.netlify.app © 2020