Skip to main content

VST Extension

A VST plug-in is an audio processing component that is utilized within a host application.

With VST Extension, Switchboard SDK can act as a VST plug-in host allowing you to process your audio with a wide range of VST3 plug-ins. This extension runs VST3 plugins in a head-less manner and allows you to configure plug-in parameters directly via VSTProcessorNode

The VST Extension provides the following audio nodes for a Switchboard SDK audio graph:

NodeDescription
VSTProcessorNodeA processor node that can load a 64-bit VST3 plug-in, configure its parameters and process audio through it.

Usage

Initialize the extension

VSTExtension::initialize();

Load a plug-in

VSTProcessorNode vstProcessorNode;
vstProcessorNode.loadPlugin(absolutePathToPlugin);

Get list of all parameters of the loaded plug-in

auto parameters = vstProcessorNode.getPluginParameters();
for (const auto& parameter : parameters) {
std::cout <<
"parameter name: " << parameter.name << std::endl <<
"parameter id: " << parameter.id << std::endl <<
"parameter default value: " << parameter.defaultValue << std::endl;
}

Change value of a parameter

VST3 plug-in parameters have float values and range from 0.0 to 1.0. Each plug-in has different names and default values for its parameters set my the VST3 plug-in manufacturer.

We can call setPluginParameter method to set the values.

vstProcessorNode.setPluginParameter("Room size", 1.0);

Using string values for a parameter

Using float values that range from 0.0 to 1.0 is not developer friendly for certain cases. For example, for a parameter that is a switch and has a behaviour of Off/On, we can use setValueNamesForPluginParameter and setPluginParameterByValueName methods to string values instead of float values when changing paramters.

We let the extension know this parameter has two possible values by passing string names for those values in a vector:

std::vector<std::string> valueNames { "Off", "On" };
vstProcessorNode.setValueNamesForPluginParameter("Switch", valueNames);

Now that the extension knows Switch parameter has two values (Off and On), it will map Off to 0.0 and On to 0.5, we can set parameter values with strings.

vstProcessorNode.setPluginParameterByValueName("Switch", "On");

This is perticularly useful when a parameter has more than two states. Lets assume an auto-tune VST plugin has a parameter named Key that configures which key the plugin should tune input audio to.

std::vector<std::string> valueNames { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
vstProcessorNode.setValueNamesForPluginParameter("Key", valueNames);

Extension will internally assign following float values to each of the value names:

C  - 0.0
C# - 0.08
D - 0.17
D# - 0.25
E - 0.33
F - 0.42
F# - 0.5
G - 0.58
G# - 0.67
A - 0.75
A# - 0.83
B - 0.92

Now if we want to set Key parameter to E, instead of using setPluginParameter method with float value 0.33 we can use setPluginParameterByValueName with string value E.

vstProcessorNode.setPluginParameterByValueName("Key", "E");

Example

To configure OrilRiver reverb plugin

VSTProcessorNode vstProcessorNode;
vstProcessorNode.loadPlugin("/Library/Audio/Plug-Ins/VST3/OrilRiver.vst3");
vstProcessorNode.setPluginParameter("Room size", 1.0);
vstProcessorNode.setPluginParameter("Decay time ", 0.3);

Download SDK Extension

You can download this SDK extension from our Downloads Page.

Visit the page to access the latest version and start integrating it into your project!