%% Specify Hosted Source Plugin Parameter Values
% Load a VST audio source plugin into MATLAB® by specifying its full path. If you are using a Mac, replace the .dll file extension with .vst.

pluginPath = fullfile(matlabroot,'toolbox/audio/samples/oscillator.dll');
hostedSourcePlugin = loadAudioPlugin(pluginPath)

%
% Use info to return information about the hosted plugin.

info(hostedSourcePlugin)

%
% Use setParameter to change the normalized value of the Frequency parameter to 0.8. Specify the parameter by its index.

setParameter(hostedSourcePlugin,1,0.8)

%
% When you set the normalized parameter value, the parameter display value is automatically updated. Generally, the normalized parameter value corresponds to the position of a UI widget or MIDI controller. The parameter display value typically reflects the value used internally by the plugin for processing.
% Use dispParameter to display the updated table of parameters.

dispParameter(hostedSourcePlugin)

%
% Alternatively, you can use getParameter to return the normalized value of a single parameter.

getParameter(hostedSourcePlugin,1)

%
% Copyright 2012 The MathWorks, Inc.