[...] I discovered, that when you change a parameter using the embedded editor...e.g. using the mouse and dragging some sliders, that for this time BASS stops playing the channel.
For my program, I use an "unchanneled" editor (by setting the channel to NULL on BASS_VST_ChannelSetDSP(), see the documentation in bass_vst.h) and everything works great. Moreover, I have just tried using the editor for effects assigned to a channel - also without problems. Maybe this happens only for some plugins?
It is obviously because you do all in a DSP callback, which is a synchronious call...meaning it'll wait until your DSP callback returns.
The editor runs in an independent thread (normally the GUI one) - this should not be the problem. When calling the get/set parameter functions, I do a little lock, that
may halt the DSP thread if the plugin does
really time-consuming calculations on parameter changes - but I have not seen such a plugin.
The only "special" thing I do when an editor window is opened is to poll 20 times a second for parameter changes to create the BASS_VST_PARAM_CHANGED events if needed (VST has no other mechanism for that). This
may also lock the DSP thread if getParameter is
really time-consuming - however, these polls should be really fast, only some plugin-getParameter calls - and, for my tests I do not found any problems or any high CPU usages.
Just wondring, if that is also the case with the embedded editor...or do you see any workaround for that...so that the user can change the embedded editor without interrupting the channel playing?
Sorry, I do not understand what you mean here.
And one more thing...some VST effects have so called programs or presets to use...any chance to get and/or set them?
Well, I decided not to create functions for this, as the program functionality has a rather dirty API in VST, eg. depending on the plugin's implementation, you cannot query the name or the settings of a preset without selecting it. Some other plugins only implement the "chunk" mechanism and so on. Moreover, most plugins do not really save the programs if the plugin is loaded again.
My suggestion is to load/save the parameters yourself from/to files and initialize the effect by some BASS_VST_SetParam() calls then.
If you really want to access the
programs - most times there are only a very few different
presets -, you can use the VST API directly:
#include <aeffectx.h> // you can get this file from Steinberg
BASS_VST_INFO info;
BASS_VST_GetInfo(vstHandle, &info);
AEffect* aeffect = (AEffect*)info.aeffect;
// get the number of programs - "currProgram" in the following code must be between 0 and numPrograms-1 then
int numPrograms = aeffect->numPrograms;
// get the selected program
int currProgram = aeffect->dispatcher(aeffect, effGetProgram, 0, 0, NULL, 0.0);
// get the name of the selected program
char currProgramName[kVstMaxProgNameLen+1];
aeffect->dispatcher(aeffect, effGetProgramName, 0, 0, currProgramName, 0.0);
// change the name of the selected program
aeffect->dispatcher(aeffect, effSetProgramName, 0, 0, "new name", 0.0);
// select a program
aeffect->dispatcher(aeffect, effSetProgram, 0, currProgram, NULL, 0.0);
Of course, I could add some BASS_VST_* functions for the program handling, but - again - I do not find them very useful (maybe I have not really understood its purpose?).
Bjoern