4 *ar { arg in, freq = 1200.0, rq = 1.0, mul = 1.0, add = 0.0;
5 ^this.multiNew('audio', in, freq, rq).madd(mul, add);
8 *sc { arg dummy, freq = 1200.0, rq = 1.0;
9 var w0, cos_w0, i, alpha, a0, a1, b0rz, b1, b2, sr;
11 w0 = pi * 2 * freq * SampleDur.ir;
12 cos_w0 = w0.cos; i = 1 - cos_w0;
13 alpha = w0.sin * 0.5 * rq;
14 b0rz = (1 + alpha).reciprocal;
17 b1 = cos_w0 * 2 * b0rz;
18 b2 = (1 - alpha) * b0rz.neg;
19 ^[a0, a1, a0, b1, b2];
24 *ar { arg in, freq = 1200.0, rq = 1.0, mul = 1.0, add = 0.0;
25 ^this.multiNew('audio', in, freq, rq).madd(mul, add);
28 *sc { arg dummy, freq = 1200.0, rq = 1.0;
29 var i, w0, cos_w0, alpha, a0, a1, b0rz, b1, b2, sr;
31 w0 = pi * 2 * freq * SampleDur.ir;
32 cos_w0 = w0.cos; i = 1 + cos_w0;
33 alpha = w0.sin * 0.5 * rq;
34 b0rz = (1 + alpha).reciprocal;
37 b1 = cos_w0 * 2 * b0rz;
38 b2 = (1 - alpha) * b0rz.neg;
39 ^[a0, a1, a0, b1, b2];
44 *ar { arg in, freq = 1200.0, rq = 1.0, mul = 1.0, add = 0.0;
45 ^this.multiNew('audio', in, freq, rq).madd(mul, add);
48 *sc { arg dummy, freq = 1200.0, rq = 1.0;
49 var w0, alpha, a0, b1, b0rz, sr;
51 w0 = pi * 2 * freq * SampleDur.ir;
52 alpha = w0.sin * 0.5 * rq;
53 b0rz = (1 + alpha).reciprocal;
54 a0 = (1 - alpha) * b0rz;
55 b1 = 2.0 * w0.cos * b0rz;
56 ^[a0, b1.neg, 1.0, b1, a0.neg];
60 BBandPass : BEQSuite {
61 *ar {arg in, freq = 1200.0, bw = 1.0, mul = 1.0, add = 0.0;
62 ^this.multiNew('audio', in, freq, bw).madd(mul, add);
65 *sc { arg dummy, freq = 1200.0, bw = 1.0;
66 var w0, sin_w0, alpha, a0, b0rz, b1, b2, sr;
68 w0 = pi * 2 * freq * SampleDur.ir;
70 // alpha = w0.sin * 0.5 * rq;
71 alpha = sin_w0 * sinh(0.34657359027997 * bw * w0 / sin_w0);
72 b0rz = (1 + alpha).reciprocal;
74 b1 = w0.cos * 2 * b0rz;
75 b2 = (1 - alpha) * b0rz.neg;
76 ^[a0, 0.0, a0.neg, b1, b2];
80 BBandStop : BEQSuite {
81 *ar {arg in, freq = 1200.0, bw = 1.0, mul = 1.0, add = 0.0;
82 ^this.multiNew('audio', in, freq, bw).madd(mul, add);
85 *sc { arg dummy, freq = 1200.0, bw = 1.0;
86 var w0, sin_w0, alpha, b1, b2, b0rz, sr;
88 w0 = pi * 2 * freq * SampleDur.ir;
90 // alpha = w0.sin * 0.5 * rq;
91 alpha = sin_w0 * sinh(0.34657359027997 * bw * w0 / sin_w0);
92 b0rz = (1 + alpha).reciprocal;
93 b1 = 2.0 * w0.cos * b0rz;
94 b2 = (1 - alpha) * b0rz.neg;
95 ^[b0rz, b1.neg, b0rz, b1, b2];
100 *ar {arg in, freq = 1200.0, rq = 1.0, db = 0.0, mul = 1.0, add = 0.0;
101 ^this.multiNew('audio', in, freq, rq, db).madd(mul, add);
104 *sc { arg dummy, freq = 1200.0, rq = 1.0, db = 0.0;
105 var a, w0, alpha, a0, a2, b1, b2, b0rz, sr;
108 w0 = pi * 2 * freq * SampleDur.ir;
109 alpha = w0.sin * 0.5 * rq;
110 b0rz = (1 + (alpha / a)).reciprocal;
111 a0 = (1 + (alpha * a)) * b0rz;
112 a2 = (1 - (alpha * a)) * b0rz;
113 b1 = 2.0 * w0.cos * b0rz;
114 b2 = (1 - (alpha / a)) * b0rz.neg;
115 ^[a0, b1.neg, a2, b1, b2];
119 BLowShelf : BEQSuite {
120 *ar {arg in, freq = 1200.0, rs = 1.0, db = 0.0, mul = 1.0, add = 0.0;
121 ^this.multiNew('audio', in, freq, rs, db).madd(mul, add);
124 *sc { arg dummy, freq = 120.0, rs = 1.0, db = 0.0;
125 var a, w0, sin_w0, cos_w0, alpha, i, j, k, a0, a1, a2, b0rz, b1, b2, sr;
128 w0 = pi * 2 * freq * SampleDur.ir;
131 alpha = sin_w0 * 0.5 * sqrt((a + a.reciprocal) * (rs - 1) + 2.0);
134 k = 2 * sqrt(a) * alpha;
135 b0rz = ((a+1) + j + k).reciprocal;
136 a0 = a * ((a+1) - j + k) * b0rz;
137 a1 = 2 * a * ((a-1) - i) * b0rz;
138 a2 = a * ((a+1) - j - k) * b0rz;
139 b1 = 2.0 * ((a-1) + i) * b0rz;
140 b2 = ((a+1) + j - k) * b0rz.neg;
141 ^[a0, a1, a2, b1, b2];
145 BHiShelf : BEQSuite {
146 *ar {arg in, freq = 1200.0, rs = 1.0, db = 0.0, mul = 1.0, add = 0.0;
147 ^this.multiNew('audio', in, freq, rs, db).madd(mul, add);
150 *sc { arg dummy, freq = 120.0, rs = 1.0, db = 0.0;
151 var a, w0, sin_w0, cos_w0, alpha, i, j, k, a0, a1, a2, b0rz, b1, b2, sr;
154 w0 = pi * 2 * freq * SampleDur.ir;
157 alpha = sin_w0 * 0.5 * sqrt((a + a.reciprocal) * (rs - 1) + 2.0);
160 k = 2 * sqrt(a) * alpha;
161 b0rz = ((a+1) - j + k).reciprocal;
162 a0 = a * ((a+1) + j + k) * b0rz;
163 a1 = -2.0 * a * ((a-1) + i) * b0rz;
164 a2 = a * ((a+1) + j - k) * b0rz;
165 b1 = -2.0 * ((a-1) - i) * b0rz;
166 b2 = ((a+1) - j - k) * b0rz.neg;
167 ^[a0, a1, a2, b1, b2];
173 *ar { arg in, freq = 1200.0, rq = 1.0, mul = 1.0, add = 0.0;
176 coefs = BLowPass.sc(nil, freq, rq);
177 ^SOS.ar(SOS.ar(in, *coefs), *coefs ++ [mul, add]);
182 *ar { arg in, freq = 1200.0, rq = 1.0, mul = 1.0, add = 0.0;
185 coefs = BHiPass.sc(nil, freq, rq);
186 ^SOS.ar(SOS.ar(in, *coefs), *coefs ++ [mul, add]);