A newer version of Max is available. Click here to access the latest version of this document.

vst~

Host VST plug-ins

Description

vst~ loads a real-time VST plug-in and uses its audio processing in MSP. Some plug-ins have their own editing window, which is visible when you double-click on the object. Otherwise, double-clicking on the object displays a default parameter editing window. The number of signal inputs and outputs default to 2, but the number required by the plug-in may be less than that. If you want to specify a larger number of inputs and outputs, you can supply them as optional arguments.
Audio plug-ins loaded into a vst~ object can be synchronized by enabling the global transport (choose GlobalTransport from the Extras menu and click on the global transport's Activate button).

Arguments

Name Type Opt Description
number-of-inputs/outputs int opt If the first or first and second arguments are numbers, they set the number of audio inputs and outputs. If there is only one number, it sets the number of outlets. If there are two numbers, the first one sets the number of inlets and the second sets the number of outlets.
VST-plugin-filename symbol opt Sets the name of a VST plug-in file to load when the object is created. You can load a plug-in after the object is created (or replace the one currently in use) with the plug message.
preset-effects-name symbol opt After the plug-in name, a name containing preset effects for the plug-in can be specified. If found, it will be loaded after the plug-in has been loaded.

Messages

int effect-program [int]
In left inlet: Changes the effect program of the currently loaded plug-in. The first program is number 1.
float effect-program [float]
Converted to int.
list parameter-settings [list]
In left inlet: Changes a parameter value in the currently loaded plug-in. The first list element is the parameter number (starting at 1) and the second element is the parameter value. The second number should be a float between 0 and 1, where 0 is the minimum value of the parameter and 1 is the maximum.
anything plugin-parameter (symbol) and setting (float) [list]
A symbol that names a plug-in parameter followed by a float between 0 and 1 set the value of the parameter.
bypass bypass-flag (0 or nonzero) [int]
The word bypass, followed by a non-zero argument, stops any further processing by the currently loaded plug-in and copies the object's signal input to its signal output. bypass 0 enables processing for the plug-in.
(drag) When a VST plug-in file is dragged from the Max 5 File Browser to a vst~ object, the plug-in will be loaded.
(mouse) Double-clicking on a vst~ object opens the plug-in's edit window.
disable mute-flag (0 or nonzero) [int]
The word disable, followed by a non-zero argument, stops any further processing by the currently loaded plug-in and outputs a zero signal. disable 0 enables processing for the plug-in.
get parameter-data-query-index [int]
The word get, followed by a number argument, reports parameter values and plug-in information. This is output from the fourth outlet of vst~ as a list with the said number argument as the first element and the desired information as the second element. If the number argument is between 1 and the number of parameters of the currently loaded plug-in (inclusive), the get message outputs the current parameter value (a float between 0 and 1) of the numbered parameter. If the argument is 0 nothing is output. If the argument is negative, the get message outputs a list with the first element specifying the number argument and the remaining elements specifying the following information:

get-1 the plug-in's number of inputs
get-2 the plug-in's number of outputs
get-3 the plug-in's number of programs
get-4 the plug-in's number of parameters
get-5 whether the plug-in's canMono flag is set. This indicates that the plug-in can be used in either a stereo or mono context
get-6 1 if the plug-in has its own edit window, 0 if it doesn't
get-7 1 if the plug-in is a synth plug-in, 0 if it isn't
get-8 the unique ID of the plug-in as an integer value
get-9 four integer values representing the left, top, right, and bottom coordinates of the desired rectangle of the plug-in UI edit window
get-10 an integer value representing the initial delay of the plug-in in samples to allow you to automatically compensate for the plugin's latency in your patch
getsubnames In left inlet: When using the vst~ object to host a VST "shell" plug-in (e.g. WaveShell) that is not instantiated with a specific plug-in name, the word getsubnames causes a list of sub plug-in names to be sent out the seventh outlet of the vst~ object.
midievent MIDI-message (2 to 4 numbers) [list]
The word midievent, followed by two to four numbers, sends a MIDI event to the plug-in. The first three number arguments are the bytes of the MIDI message. The fourth, optional, argument is a detune parameter used for MIDI note messages. The value ranges from -63 to 64 cents, with 0 being the default.
mix mix-mode-flag (0 or 1) [list]
In left inlet: mix 1 turns mix mode on, in which the plug-in's output is added to the input. mix 0 turns mix mode off. When mix mode is off, the plug-in's output is not added to the input. Only the plug-in's output is sent to the vst~ object's signal outlets.
params The word params causes a list of the plug-in's parameters to be sent out the fourth-from-right outlet.
pgmnames The word pgmnames causes a list of the plug-in's current program names to be sent out the right outlet.
plug plug-in-name [symbol]
In left inlet: The word plug with no arguments opens a standard open file dialog allowing you to choose a new VST plug-in to host. The word plug followed by a symbol argument searches for VST plug-in with the specified name in the Max search path. If a new plug-in is opened and found, the old plug-in (if any) is discarded and the new one loaded. An optional second argument to the plug message can be used to specify a plug-in name within a shell plug-in (e.g. WaveShell). This can either be a symbolic plug-in name or an associated ID value as displayed by the printids message).

Note that upon first loading vst~ the system VST folder will be added to the max search path. On the Macintosh this is generally /Library/Audio/Plug-ins/VST/ and on windows this is the folder specified in the VstPluginsPath string value under the registry key HKLM\Software\VST.
open window-coordinates [list]
The word open with no arguments opens the plug-in's edit window. If the window was previously opened then the edit window location will persist. The word open followed by two integer values specifying the left and top window coordinates respectively will open or move the plug-in's edit window to the given coordinates.
printids In left inlet: When using the vst~ object to host a VST "shell" plug-in (e.g. WaveShell) that is not instantiated with a specific plug-in name, the word printids causes a list of sub plug-in IDs to be sent out the seventh outlet of the vst~ object.
read filename [symbol]
With no arguments, read opens a standard open file dialog prompting for a file of effect programs, either in bank or individual program format. read accepts an optional symbol argument where it looks for a VST plug-in bank or effect program file in the Max search path.
set effect-program-name [symbol]
In left inlet: The word set, followed by a symbol, changes the name of the current effect program to the symbol.
settitle window-title [symbol]
In left inlet: The word settitle, followed by a symbol, changes the title displayed for the name of the plug-in's edit window.
signal Input to be processed by the plug-in. If the plug-in is an instrument plug-in, the input will be ignored.
subname plug-in-name [symbol]
In left inlet: The word subname, followed by a plug-in name or plug-in ID, will cause a "shell" VST plug-in (e.g. WaveShell) to be re-instantiated with the specified name/ID.
wclose Closes the plug-in's edit window.
write file/pathname [symbol]
With no arguments, write opens a standard Save As dialog box prompting you to choose the name and type of the effect program file (single program or bank). write accepts an optional symbol argument that specifies a full or partial destination pathname. An individual program file is written in this case.
writebank program-bank-file/pathname [symbol]
With no arguments, writebank opens a standard Save As dialog box prompting you to choose the name of the effect program bank file. writebank accepts an optional symbol argument that specifies a full or partial destination pathname.
writepgm inividual-effect-program-file/pathname [symbol]
With no arguments, writepgm opens a standard Save As dialog box prompting you to choose the name of the individual effect program file. writepgm accepts an optional symbol argument that specifies a full or partial destination pathname.

Attributes

Name Type g/s Description

Information for box attributes common to all objects

Output

float: Out fourth outlet: Parameter values or plug-in informational values in response to the get message.
int: Out fourth outlet: Parameter values or plug-in informational values in response to the get message.

Out fifth outlet: Raw MIDI bytes received by the plug-in (but not any MIDI messages received using the midievent message).
list: Out seventh outlet: When a VST "shell" plug-in (e.g. WaveShell) is instantiated without specifying a plug-in name, a list of symbols specifying sub plug-in IDs are sent out the seventh outlet in response to the printids message.
signal: Out left outlet (and other signal outlets as defined by the number of outputs argument): Audio output from the plug-in. The left outlet is the left channel (or channel 1).
symbol: Out third outlet: The plug-in's parameters are sent out as a series of symbols in response to the params message.
Note: Some plug-ins, especially those with their own editors, fail to name the parameters.

Out sixth outlet: A series of symbols are sent out in response to the pgmnames message. If there are no program names, the message pgmnames: Default is output.

Out seventh outlet: When a VST "shell" plug-in (e.g. WaveShell) is instantiated without specifying a plug-in name, a series of symbols specifying plug-in names are sent out the seventh outlet in response to the getsubnames message.

Examples

Process an audio signal with a VST plug-in

See Also

Name Description
rewire~ Host ReWire devices