slider1:2000<20,22000,1>X-Over (Hz)
slider2:1<0.1,1,0.1>Q

@slider

w0 = 2*3.1415*slider1/srate;
alpha = sin(w0)/(2*slider2);
b0 = (1. - cos(w0))*0.5;
b1 = 1. - cos(w0);
b2 = (1. - cos(w0))*0.5;
a0 = 1. + alpha;
a1 = -2.*cos(w0);
a2 = 1. - alpha;

b0 /= a0;
b1 /= a0;
b2 /= a0;
a1 /= a0;
a2 /= a0;

@sample

/* x over */
low0 = b0 * spl0 + b1 * xl1 + b2 * xl2 - a1 * yl1 - a2 * yl2;
xl2 = xl1; xl1 = spl0; yl2 = yl1; yl1 = low0;
high0 = spl0 - low0;

low1 = b0 * spl1 + b1 * xl1 + b2 * xl2 - a1 * yl1 - a2 * yl2;
xl2 = xl1; xl1 = spl1; yl2 = yl1; yl1 = low1;
high1 = spl1 - low1;

spl0=low0;
spl1=low1;

spl2=high0;
spl3=high1;