options:gmem=gainer

slider1:1<0,31,1{-----,3+4,5+6,7+8,9+10,11+12,13+14,15+16,17+18,19+20,21+22,23+24,25+26,27+28,29+30,31+32,33+34,35+36,37+38,39+40,41+42,43+44,45+46,47+48,49+50,51+52,53+54,55+56,57+58,59+60,61+62,63+64}>Out channel
slider2:0<0,31,1>Link ID

@init
x=slider2;
y=slider2+1;
v1=gmem[x];
v2=gmem[y];

src_vol = tgt_vol = 10 ^ (v1 / 20);
src_volB = tgt_volB = 10 ^ (v2 / 20);

@slider
channel = slider1*2;
out = channel;
out2 = out+1;

x=slider2;
y=slider2+1;

@block
v1=gmem[x];
v2=gmem[y];
tgt_vol = v1 <= -60.0 ? 0.0 : 10 ^ (v1 / 20);
tgt_volB = 10 ^ (v2 / 20);

d_vol = (tgt_vol-src_vol)/samplesblock;
tvol = src_vol;
src_vol = tgt_vol;

d_vol = (tgt_volB-src_volB)/samplesblock;
tvolB = src_volB;
src_volB = tgt_volB;

@sample
tvol += d_vol;
adj = tvol;

tvolB += d_vol;
adjB = tvolB;

spl(out) = spl0*adj*adjB;
spl(out2) = spl1*adj*adjB;

spl0*=adj*adjB;
spl1*=adj*adjB;
