What is a VST Plug-In? And why did we develop it in the first place?
What is new in VST 3?
What is VST 3?
COM Compatibility
Usage Information
Audio Processing
Plug-In Implementation
User Interfaces
Essentially, a VST Plug-in is a pure audio processing component, and not an audio application: It is a component that is utilized within a host application. This host application provides the audio or/and event streams that are processed by the plug-in's code.
Generally speaking, a VST plug-in can take a stream of audio data, apply a process to the audio, and return the result to the host application. A VST Plug-In performs its process normally using the processor of the computer; It does not necessarily need dedicated digital signal processors. The audio stream is broken down into a series of blocks. The host supplies the blocks in sequence. The host and its current environment control the block-size. The VST Plug-In maintains the status of all its own parameters relating to the running process: The host does not maintain any information about what the plug-in did with the last block of data it processed.
From the host application’s point of view, a VST Plug-In is a black box with an arbitrary number of inputs, outputs (Event (Midi) or Audio), and associated parameters. The host needs no implicit knowledge of the plug-in's process to be able to use it. The plug-in process can use whatever parameters it wishes, internally to the process, but depending on the capabilities of the host, it can allow the changes to user parameters to be automated by the host.
The source code of a VST Plug-In is platform independent, but the delivery system depends on the platform architecture:
- On the Windows platform, a VST Plug-In is a multi-threaded DLL (Dynamic Link Library).
- On Mac OS X, a VST Plug-In is a Mach-O Bundle
To learn more about VST you can subscribe to the VST Developer Mailing List - check the 3rd Party Developer Support section at www.steinberg.net.
The VST SDK 3 described in this document is an object-oriented, cross-platform and compiler-independent interface model. It specifies what components must "look like" and how they are created by the host application.
We can separate the specification into 3 layers:
- Interface convention:
Everything visible for both the host and the Plug-In is "wrapped" into interfaces. An interface in C++ is a class with virtual methods only. The basic interface is FUnknown. All other interfaces are directly or indirectly derived from it.
- Module Export Interface:
A module (Windows: Dynamic Link Library, Mac OS X: Mach-O Bundle) contains the implementation of one or more Plug-In classes (e.g. VST Effects). The only symbol searched for is GetPluginFactory, a C-style function to create the Steinberg::IPluginFactory factory object of the module.
- Purpose-specific interfaces:
Each Plug-In category (VST Effects, etc...) defines its own set of purpose-specific interfaces. Additionally, some basic interfaces are shared across all categories.
VST SDK 3 is a general rework of the VST Plug-In Interface. While it is not compatible with the older VST versions, it includes many new features and possibilities. We have rebuilt the interface to make it not only far easier and more reliable for developers to work with, but have also provided completely new possibilities for plug-ins.
These include:
- Improved Performance with the Silence Flag:
processing can optionally be applied to plug-ins only when audio signals are present on their respective inputs, so VST3 plug-ins can apply their processing economically and only when it is needed.
- Multiple Dynamic I/Os:
VST3 plug-ins are no longer limited to a fixed number of inputs and outputs, and their I/O configuration can dynamically adapt to the channel configuration. Side-chains are also very easily realizable. This includes the possibility to deactivate unused busses after loading and even reactivate those when needed. This cleans up the mixer and further helps to reduce CPU load.
- Sample-accurate automation:
VST3 also features vastly improved parameter automation with sample accuracy and support for ramped automation data, allowing completely accurate and rapid parameter automation changes.
- Logical Parameter Organization:
The plug-in parameters are displayed in a tree structure. Parameters are grouped into sections which represent the structure of the plug-in. Plugins can communicate their internal structure for the purpose of overview, but also for some associated functionality (eg program-lists).
While designing VST3, we performed a careful analysis of the existing functionality of VST and rewrote the interfaces from scratch. In doing so, we focussed a lot on providing clear interfaces and their documentation in order to avoid usage errors from the deepest possible layer.
Some more features implemented specifically for developers include:
- More stable technical host/plug-in environment
- Advanced technical definition of the standard
- Modular approach
- Separation of UI and processing
- Advanced Preset System
- Multiple plug-ins per Library
- Test Host included
- Automated Testing Environment
- Test Host and plug-in example code included.
The first layer of the VST SDK is binary compatible to Microsoft® COM (Component Object Model). The Vtable and Interface Identifier of FUnknown match with the corresponding COM interface IUnknown.
The main difference is the organization and creation of components by a host application. The VST SDK does not require any Microsoft® COM source file. It is currently available for Windows and Mac OS X.
You can find information about COM on pages like: http://www.microsoft.com/Com/resources/comdocs.asp.
- Any Plug-In needs to define and export one function called GetPluginFactory. This function returns the basic interface of the Plug-In: IPluginFactory.
- The Plug-In factory can create one or more classes. It also provides information on the nature of those classes.
- Any class that the factory can create is assigned to a category. It is this category that tells the host the purpose of the class (and gives a hint of which interfaces it might implement).
- The entry-point interface for any component class is IPluginBase. The host uses this interface to initialize and to terminate the Plug-In component. When the host initializes the Plug-In, it passes a so-called context. This context contains any interface to the host that the Plug-In will need to work. The number of interfaces may vary from category to category, but any context contains a number of standard Host Interfaces
Interface directions
Most interfaces have got a direction, meaning that the interface is expected to be implemented either in the Plug-In or in the host. In this documentation the nature of an interface is indicated like this:
- [host imp] : the host implements the interface
- [plug imp] : the Plug-In implements the interface
Interface Versions and Inheritance
Unlike C++ classes, COM interfaces do not use inheritance to express specializations of objects. Usually all interfaces are derived from FUnknown. Interfaces are never changed after they have been released.
The VST SDK Interfaces use inheritance only for versioning! All specializations will be modelled as separate interfaces! As an example see: Interface Versions and Inheritance
Audio processing in the plug is accomplished by a process () method. While process () takes input data, applies its processing algorithm, and then adds the result to the output (overwrite the output buffer). out = f(in);
- Note:
- Audio data processed by VST Plug-Ins is 32 bit (single precision) and optionally 64 bit (double precision) floating-point data. The default used range is from -1.0 to +1.0 inclusive [-1.0, +1.0] (where 1.0 corresponds to 0dB, 0.5 to -6dB and 0.0 to -oodB). Note that an effect could generate values above this range.
All parameters - the user parameters, acting directly or indirectly on that data, as automated by the host, are 32 bit floating-point data. They must always range from 0.0 to 1.0 inclusive [0.0, +1.0] (normalized), regardless of their internal or external representation.
If you want to develop a VST Plug-In, you may prefer to go straight to the code examples now. These are very simple examples in which you will learn most of the important basic concepts just by reading a few lines of code. As a Plug-In developer you actually need to know very little about hosting a Plug-In. - Note:
- Never edit any of the SDK source files. Never ever. The host application relies on them being used as they are provided. Anything can be added or changed by overriding in your private classes derived from the given helpers classes.
All user-interface handling is entirely separated from the audio processing. At its simplest there is an option where you can avoid providing a user interface at all. In this case the host will provide a generic editor allowing to edit and visualize the Plug-In parameters. The host can use the separate ASCII strings for the value, the label, and the units of the parameters to construct its own user interface. This is also often a good way to develop a VST Plug-In, it offers a very short development cycle to start to test the algorithm. The proper UI interface can come later.
The next user interface level is provided when the Plug-In defines its own editor. This allows practically any user interface to be defined. A negative aspect is that then you can quickly land up in platform specifics when dealing with the nuts and bolts of the interface issues, even though the audio process, the concepts and methodology remain platform independent.
The final option is to use a portable framework for creating sophisticated user interfaces. This framework takes the form of the VSTGUI Library files that are available for almost all supported VST platforms. The VSTGUI Library classes and their usage is described in separate documentation.
- See also:
- VSTGUI on SourceForge
Empty