Vst Plugin Python

Tor derive valid kinematics or kinetics, use Plug-in Gait or create your own biomechanical model using Vicon BodyBuilder, Python or MATLAB. The following table lists the predefined Plug-in Gait labeling skeleton templates (.vst files) supplied with Nexus, identifying the portion of the body it applies to for gait analysis. An infinite series of free software instruments, made by musicians and sampling experts in London, for anyone, anywhere. Presented in our own plug-in, they are easy to use, and compatible with any DAW. And in case you missed it — they're all free.

Welcome! In this tutorial series we will be learning how to create audio plugins that run as VST, VST3, AU, RTAS, AAX or as a standalone application.

Vst Plugin Python Tutorial

Audio plugins are programs that are loaded into a host software (such as Ableton Live, Logic or REAPER). They process Audio and/or MIDI data and can have a graphical user interface. Here are three examples (U-He Zebra, Sonalksis FreeG and D16 Decimort):

As you can see, the GUI usually contains some controls (the knob being the most common) that change how the plugin processes incoming data. A plugin has presets (in the screenshot they’re called Combo and Emulator) that store all knob positions and other values.

We’ll start with a simple distortion plugin. After that, we’ll create this subtractive synthesizer plugin step by step:

We will use C++ and the WDL-OL library. It is based on Cockos WDL (pronounced whittle). It basically does a lot of work for us, most importantly:

  • Ready-made Xcode / Visual Studio Projects
  • Create VST, AudioUnit, VST3 and RTAS formats from one codebase: Just choose the plugin format and click run!
  • Create 32/64-Bit executables
  • Make your plugin run as a standalone Win/Mac application
  • Most GUI controls used in audio plugins

It also gives you most GUI controls used in audio plugins, and some commonly used audio algorithms like for example resampling. This forum thread has screenshots of a lot of plugins that were done using WDL.

The different plugin formats all do more or less the same, so normally there would be a lot of copy & paste in your code. As a programmer you want to stay DRY, so sooner or later you’d write an abstraction layer over the different formats. This work has already been done in the form of IPlug, which is a part of WDL. These are the annoying parts of audio plugin development, so we can now focus on the fun stuff, such as:

  • How the plugin processes incoming Audio/MIDI
  • What the plugin looks like
  • How it integrates with the host (automation, presets, etc.)

Another good thing about WDL is its permissive license: You can use it freely for commercial applications. See the links above for details.

Vst Plugin Python Free

How we will do this

The chase is better than the catch.

In a previous post, I’ve tried to use Qt for the editor window of a VST plugin. The thing is, I want to do more than just play with a GUI, I also want to see what is done to an audio stream by a plugin.

To do so, I’ve decided to expose the VST interface to Python. There are some implementation I’ve heard of, but they are based on Cython or other wrapping tools. Ctypes has the advantage of not needing a compilation step. There are also every functionality needed, as callback creation (plugins use a callback to ask the host some stuffs), and Python provides the additional mathematical tools to display what the plugin does. It may not be perfect, but it will be enough for a starter.

Vst Plugin Python Download

Wrapping the VST effect class

Wrapping a VST class is not an easy task. The plugin is accessed by a C structure with pointer functions for the main functionalities: processing an audio flow (with floats or doubles), setting and getting parameters, and a general function for setting and getting information. Additionaly, when instantiating a plugin, a callback must be given. This ctypes callback will have to be stored inside the wrapper so that it stays valid through the plugin lifetime.

Vst Plugin Python Software

So the C structure is created as a class that inherits from ctypes.Structure. Then I have to populate a class that will call the correct function or return the appropriate element inside this structure.

The main VST function must be called through a dispatch function available in the structure. I will only show of them:

Rewritting the minihost sample

The minihost sample prints some details of the VST plugin and then displays them. Here, I’ll do the same, but I’ve processed a sine-sweep signal and then display the result. If the 64bits processing is available, I will use it.

Vst Plugin Python

Here are some info that are displayed prior to the processing for the Big Tick NastyShaper plugin:

Here is a graphical result. On the first row, I display the original input, on the second row is the associated output.

To be continued

The whole 2.4 standard is not yet wrapped, far from it. There is still much to do to be able to use this wrapper class for every plugin (how do I load an impulse for a convolution reverb for instance), but it can still help analyze how a lot of plugins change the audio signal.

Some plugins are not working yet (mainly because every input and output must be connected), but I’m working on it 😉

The code is available on Launchpad.