BASS.NET API for the Un4seen BASS Audio Library

BassVstBASS_VST_ChannelSetDSP Method (Int32, String, BASSVSTDsp, Int32, String, Int32)

BASS.NET API for the Un4seen BASS Audio Library
Assigns a Shell-VST effect (defined by a DLL file name) to any BASS channels resp. retrieves the list of Shell-VST plugins.

This overload implements the Unicode overload for the dllFile name, so the BASS_UNICODE flag will automatically be added if not already set.

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

public static int BASS_VST_ChannelSetDSP(
	int chan,
	string dllFile,
	BASSVSTDsp flags,
	int priority,
	out string pluginList,
	int pluginID
)

Parameters

chan
Type: SystemInt32
The channel handle... a HSTREAM, HMUSIC, or HRECORD. Or 0, if you want to test, if the dll is a valid VST plugin.
dllFile
Type: SystemString
The fully qualified path and file name to the VST effect plugin (a DLL file name).
flags
Type: Un4seen.Bass.AddOn.VstBASSVSTDsp
A combination of these flags (see BASSVSTDsp):
BASS_VST_KEEP_CHANSBy default, mono effects assigned to stereo channels are mixed down before processing and converted back to stereo afterwards. Set this flag to avoid this behavior in which case only the first channel is affected by processing.
BASS_UNICODEdllFile is Unicode (16-bit characters) (not needed here, since the overloads already take care of it).
priority
Type: SystemInt32
Same meaning as for BASS_ChannelSetDSP(Int32, DSPPROC, IntPtr, Int32) - DSPs with higher priority are called before those with lower.
pluginList
Type: SystemString
If pluginID is 0, this returns the list of available shell plugins in the form: 'pluginName TAB pluginID LF'.
pluginID
Type: SystemInt32
Specify 0 to get the list of available plugins (returned in the pluginList

Return Value

Type: Int32
On success, the method returns the new vstHandle that must be given to all the other functions, else 0 is returned (also in case you request the available lst of plugins). Use BASS_ErrorGetCode to get the error code.
Remarks

The VST plugin is implemented via a DSP callback on the channel. That means when you play the channel (or call BASS_ChannelGetData(Int32, IntPtr, Int32) if it's a decoding channel), the sample data will be sent to the VST effect at the same time. If the channel is freed all DSPs are removed automatically, also all VST DSPs are removed as well. If you want or need to free the VST DSP manually you can call BASS_VST_ChannelRemoveDSP(Int32, Int32).

To request a list of available shell plugins, first call this method with a pluginID of 0. Then parse and select the available plugin and call this method again using the selected pluginID as returned in the pluginList.

You may safely assign the same DLL to different channels at the same time - the library makes sure, every channel is processed indepeningly. But take care to use the correct vstHandles in this case.

Finally, you can use any number of VST effects on a channel. They are processed alongside with all other BASS DSPs in the order of it's priority.

To set or get the parameters of a VST effect you might use BASS_VST_GetParamCount(Int32) alongside with BASS_VST_GetParam(Int32, Int32) and BASS_VST_SetParam(Int32, Int32, Single) to enumerate over the total number of effect parameters. To retrieve details about an individual parameter you might use BASS_VST_GetParamInfo(Int32, Int32, BASS_VST_PARAM_INFO). If the VST effect supports an embedded editor you might also invoke this one with BASS_VST_EmbedEditor(Int32, IntPtr). If the embedded editor also supports localization you might set the language in advance with BASS_VST_SetLanguage(String).

If you need to temporarily bypass the VST effect you might call BASS_VST_SetBypass(Int32, Boolean) - BASS_VST_GetBypass(Int32) will tell you the current bypass status though.

Use BASS_VST_GetInfo(Int32, BASS_VST_INFO) to get even more details about a loaded VST plugin.

See Also

Reference