BASS.NET API for the Un4seen BASS Audio LibraryBassVstBASS_VST_SetParam Method BASS.NET API for the Un4seen BASS Audio Library
Set a value of a single VST effect parameter.

Namespace: Un4seen.Bass.AddOn.Vst
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.12.0
Syntax

[DllImportAttribute("bass_vst.dll", CharSet = CharSet.Auto)]
public static bool BASS_VST_SetParam(
	int vstHandle,
	int paramIndex,
	float newValue
)

Parameters

vstHandle
Type: SystemInt32
The VST effect handle as returned by BASS_VST_ChannelSetDSP(Int32, String, BASSVSTDsp, Int32).
paramIndex
Type: SystemInt32
The index of the parameter (must be smaller than BASS_VST_GetParamCount(Int32)).
newValue
Type: SystemSingle
The new value to set in the range from 0.0 to 1.0 (float). See the documentation of the actual VST implementation for details of the effective value representation.

Return Value

Type: Boolean
on success.
Remarks

All VST effect parameters are in the range from 0.0 to 1.0 (float), however, from the view of a VST effect, they may represent completely different values. E.g. some might represent a multiplier to some internal constants and will result in number of samples or some might represent a value in dB etc.

So it is a good idea to call BASS_VST_GetParamInfo(Int32, Int32, BASS_VST_PARAM_INFO) after you modified a parameter, in order to to get further information about the parameter in question, which will also present you with the current value in a readable format.

Examples

VB
' assign and load the VST effect
vstHandle = BassVst.BASS_VST_ChannelSetDSP(_stream, 
                    "C:\VstPlugins\DelayEditGUI.dll", BASSVSTDsp.BASS_VST_DEFAULT, 1)

' create a paramInfo object
Dim paramInfo As New BASS_VST_PARAM_INFO()
' set a parameter with index number 1 to 0.7
BassVst.BASS_VST_SetParam(vstHandle, 1, 0.75)
' and get the info about the parameter back, so that we know how is looks like in a readable format
BassVst.BASS_VST_GetParamInfo(vstHandle, i, paramInfo)
Console.WriteLine([String].Format("{0} = {1} {2}", paramInfo.name, paramInfo.display, paramInfo.unit))
' this might look like this: "Volume = -2.49877 dB"
// assign and load the VST effect
vstHandle = BassVst.BASS_VST_ChannelSetDSP(_stream, 
                    "C:\\VstPlugins\\DelayEditGUI.dll", BASSVSTDsp.BASS_VST_DEFAULT, 1);

// create a paramInfo object
BASS_VST_PARAM_INFO paramInfo = new BASS_VST_PARAM_INFO();
// set a parameter with index number 1 to 0.7
BassVst.BASS_VST_SetParam(vstHandle, 1, 0.75);
// and get the info about the parameter back, so that we know how is looks like in a readable format
BassVst.BASS_VST_GetParamInfo(vstHandle, i, paramInfo);
Console.WriteLine(String.Format( "{0} = {1} {2}", paramInfo.name, paramInfo.display, paramInfo.unit));
// this might look like this: "Volume = -2.49877 dB"
See Also

Reference