BASS.NET API for the Un4seen BASS Audio LibraryBassVstBASS_VST_SetProgramParam Method BASS.NET API for the Un4seen BASS Audio Library
Set all parameters of any program in a VST effect.

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

public static bool BASS_VST_SetProgramParam(
	int vstHandle,
	int programIndex,
	float[] param
)

Parameters

vstHandle
Type: SystemInt32
The VST effect handle as returned by BASS_VST_ChannelSetDSP(Int32, String, BASSVSTDsp, Int32).
programIndex
Type: SystemInt32
The program number for which to set the parameter values, must be smaller than BASS_VST_GetProgramCount(Int32).
param
Type: SystemSingle
An array with the parameter values to set. The array needs to have as many elements as defined by BASS_VST_GetParamCount(Int32) or as returned be BASS_VST_GetProgramParam(Int32, Int32).

Return Value

Type: Boolean
If successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

This function does not change the selected program!

If you use BASS_VST_SetCallback(Int32, VSTPROC, IntPtr), the BASS_VST_PARAM_CHANGED event is only posted if you select a program with parameters different from the prior.

Examples

Copy all parameters from the current program to program #3:
VB
' get the current program number
Dim vstCurrProg As Integer = BassVst.BASS_VST_GetProgram(vstHandle)
' query all parameter values of the current program
Dim prog0Params As Single() = BassVst.BASS_VST_GetProgramParam(vstHandle, vstCurrProg)
' query all parameter values of the program #3
Dim prog1aParams As Single() = BassVst.BASS_VST_GetProgramParam(vstHandle, 3)
' copy all parameters from the current program to #3
Dim ok As Boolean = BassVst.BASS_VST_SetProgramParam(vstHandle, 3, prog0Params)
' and query all parameter values of the program #3 again...
Dim prog1bParams As Single() = BassVst.BASS_VST_GetProgramParam(vstHandle, 3)
// get the current program number
int vstCurrProg = BassVst.BASS_VST_GetProgram(vstHandle);
// query all parameter values of the current program
float[] prog0Params = BassVst.BASS_VST_GetProgramParam(vstHandle, vstCurrProg);
// query all parameter values of the program #3
float[] prog1aParams = BassVst.BASS_VST_GetProgramParam(vstHandle, 3);
// copy all parameters from the current program to #3
bool ok = BassVst.BASS_VST_SetProgramParam(vstHandle, 3, prog0Params);
// and query all parameter values of the program #3 again...
float[] prog1bParams = BassVst.BASS_VST_GetProgramParam(vstHandle, 3);
See Also

Reference