Oh right, I see now that that you said you want to be able to slide the left/right levels at different speeds. That will indeed be tricky using BASS_ATTRIB_VOL+PAN. Still, you could try simply replacing the BASS_ChannelSetAttribute calls in the linked code with BASS_ChannelSlideAttribute and see if it works well enough for your purposes. If it doesn't then you may need to use a DSPPROC callback function (via BASS_ChannelSetDSP) instead for full control, which could look something like this:
float vol[2]; // wanted volume levels (left/right)
float volcur[2]; // current volume levels
float volinc[2]; // per-sample volume increments
void CALLBACK LeftRightVolDSP(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user)
{
float *data = (float*)buffer; // assuming floating-point data
for (int a = 0; a < length / sizeof(float); a++) {
if (volinc[a & 1] != 0) { // sliding
volcur[a & 1] += volinc[a & 1];
if ((volinc[a & 1] > 0 && volcur[a & 1] >= vol[a & 1]) || (volinc[a & 1] < 0 && volcur[a & 1] <= vol[a & 1])) { // reached target
volcur[a & 1] = vol[a & 1];
volinc[a & 1] = 0; // stop sliding
}
}
data[a] *= volcur[a & 1]; // apply volume to data
}
}
When you want to change a volume level, you would set "vol" to the wanted level and "volinc" according to how fast you want it to get there:
vol[chan] = level;
volinc[chan] = (level - volcur[chan]) / samplerate / seconds;