Skip to content

Commit 73739f6

Browse files
committed
Start boost mode
1 parent 207900b commit 73739f6

File tree

3 files changed

+107
-142
lines changed

3 files changed

+107
-142
lines changed

Ripple.jsfx

+107-130
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ in_pin:Right
66
out_pin:Left
77
out_pin:Right
88

9-
slider1:band_count=6<1,20,1>Number of bands
9+
slider1:band_count=6<2,20,1>Number of bands
1010
slider2:low_freq=200<30,2000>Low freq
1111
slider3:high_freq=6000<1000,18000>High freq
1212
slider4:cycle_phase_offset=0.5<0,1>Phase Offset
13-
slider5:cycle_phase_lfo_hz=0<-10,10>Phase LFO (hz)
14-
slider6:cycle_phase_invbeat=0.5<-4,4,0.5>Phase LFO (/beat)
15-
slider7:filter_mode=0<0,1,1{cut, boost}>-Filter type
16-
slider8:filter_db=12<0,60,0.1>Filter strength (dB)
17-
slider9:filter_width_factor=0.3<0.01,0.7>Filter width
18-
slider10:filter_restoration=1<0,2>Filter compensation
13+
slider5:cycle_phase_stereo_offset=0.15<-0.5,0.5>Stereo Offset
14+
slider6:cycle_phase_lfo_hz=0<-10,10>Phase LFO (hz)
15+
slider7:cycle_phase_invbeat=0.5<-4,4,0.5>Phase LFO (/beat)
16+
slider8:filter_mode=0<0,1,1{cut, boost}>Filter type
17+
slider9:filter_db=60<0,60,0.1>Filter strength (dB)
18+
slider10:filter_width_factor=0.3<0.01,0.7>Filter width
1919

2020
import ui-lib.jsfx-inc
2121
import filter-utils.jsfx-inc
@@ -25,7 +25,8 @@ import filter-utils.jsfx-inc
2525
MAX_BAND_COUNT = 20 + 5;
2626

2727
freemem = ui_setup(0);
28-
freemem = (filter_mem = freemem) + 18*MAX_BAND_COUNT;
28+
freemem = (filter_mem_l = freemem) + 14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/*MAX_BAND_COUNT;
29+
freemem = (filter_mem_r = freemem) + 14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/*MAX_BAND_COUNT;
2930

3031
phase_logger_length = ceil(srate*1/(samplesblock ? samplesblock : 256));
3132
freemem = (phase_logger_buffer = freemem) + phase_logger_length;
@@ -45,50 +46,48 @@ function gain_window(x) (
4546
0.5 - 0.5*cos(x*2*$pi);
4647
);
4748

48-
function calculate_filters() local(i, freq, gain, band_gain, bw, future_samples, future_factor, future_phase, filter_mem_i) (
49+
function calculate_filters(filter_mem, current_phase) local(i, freq, gain, band_gain, bw, future_samples, future_factor, future_phase, filter_mem_i) (
4950
filters_to_mem();
5051

5152
// Calculate filter targets
5253
// Future time is min(samples_to_next_block, [when the next filter will pop off an edge])
5354
// Predict that far in future, divide by distance
5455
future_samples = samples_to_next_block;
5556
cycle_phase_step > 0 ? (
56-
future_samples = min(future_samples, ceil((1 - cycle_phase)/cycle_phase_step));
57+
future_samples = min(future_samples, ceil((1 - current_phase)/cycle_phase_step));
5758
) : cycle_phase_step < 0 ? (
58-
future_samples = min(future_samples, ceil(cycle_phase/-cycle_phase_step));
59+
future_samples = min(future_samples, ceil(current_phase/-cycle_phase_step));
5960
);
6061
future_factor = future_samples ? 1/future_samples : 0;
6162

62-
future_phase = cycle_phase + cycle_phase_step*future_samples;
63+
future_phase = current_phase + cycle_phase_step*future_samples;
6364

6465
bw = filter_width_factor*(log(high_freq/low_freq)/log(2)/band_count);
6566

6667
i = 0;
6768
loop(band_count + 2,
68-
filter_mem_i = filter_mem + 18/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1_L, X1_L, Y2_L, X2_L, Y1_R, X1_R, Y2_R, X2_R*/*i;
69+
filter_mem_i = filter_mem + 14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/*i;
6970
i >= band_count ? (
70-
// Magic equations found through trial and error!
7171
band_width = filter_width_factor*log(high_freq/low_freq)/log(2)/band_count;
7272
filter_mode == 0 ? (
73+
// Magic equations found through trial and error!
7374
band_gain = pow(10, -filter_db/20);
7475
gain = 1 + (1 - band_gain)*1.2*filter_width_factor*filter_width_factor;
7576
i == band_count ? (
7677
freq = 1/(1.18 + band_gain)*low_freq*exp(log(high_freq/low_freq)*(band_count - 0.4)/band_count);
7778
target_filter.filter_highshelf_gainslope(freq/srate, 1/gain, 1.8 - band_gain);
7879
) : (
7980
freq = (1.18 + band_gain)*low_freq*exp(log(high_freq/low_freq)*(0.4)/band_count);
80-
debug.freq = freq/296.0647;
8181
target_filter.filter_highshelf_gainslope(freq/srate, gain, 1.8 - band_gain);
8282
);
8383
) : (
8484
band_gain = pow(10, -filter_db/20);
85-
gain = pow(10, -filter_db*filter_width_factor*1.5/20);
85+
gain = pow(10, -filter_db*(0.5 + filter_width_factor)*1.5/20);
8686
i == band_count ? (
87-
freq = 1/(1.18 + 0*band_gain)*low_freq*exp(log(high_freq/low_freq)*(band_count - 1)*1/band_count);
87+
freq = 1/(1.18 + 0*band_gain)*low_freq*exp(log(high_freq/low_freq)*(band_count - 1 - min(0.4, filter_width_factor))*1/band_count);
8888
target_filter.filter_highshelf_gainslope(freq/srate, 1/gain, 1);
8989
) : (
90-
freq = (1.18 + 0*band_gain)*low_freq*exp(log(high_freq/low_freq)*(1)/band_count);
91-
debug.freq = freq/296.0647;
90+
freq = (1.18 + 0*band_gain)*low_freq*exp(log(high_freq/low_freq)*(1 + min(0.4, filter_width_factor))/band_count);
9291
target_filter.filter_highshelf_gainslope(freq/srate, gain, 1);
9392
);
9493
);
@@ -122,10 +121,10 @@ function calculate_filters() local(i, freq, gain, band_gain, bw, future_samples,
122121
filters_from_mem();
123122
);
124123

125-
function step_filters() local(i, filter_mem_i) (
124+
function step_filters(filter_mem) local(i, filter_mem_i) (
126125
i = 0;
127126
loop(actual_band_count,
128-
filter_mem_i = filter_mem + 18/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1_L, X1_L, Y2_L, X2_L, Y1_R, X1_R, Y2_R, X2_R*/*i;
127+
filter_mem_i = filter_mem + 14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/*i;
129128
filter_mem_i[0/*FILTER:A1*/] += filter_mem_i[5/*FILTER:A1_STEP*/];
130129
filter_mem_i[1/*FILTER:A2*/] += filter_mem_i[6/*FILTER:A2_STEP*/];
131130
filter_mem_i[2/*FILTER:B0*/] += filter_mem_i[7/*FILTER:B0_STEP*/];
@@ -135,13 +134,11 @@ function step_filters() local(i, filter_mem_i) (
135134
);
136135
);
137136

138-
function shift_filters_down() local(i, filter_mem_i) (
139-
cycle_phase -= 1;
140-
137+
function shift_filters_down(filter_mem) local(i, filter_mem_i) (
141138
// Shunt all filters down
142-
i = band_count*18/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1_L, X1_L, Y2_L, X2_L, Y1_R, X1_R, Y2_R, X2_R*/ - 1;
143-
while (i >= 18/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1_L, X1_L, Y2_L, X2_L, Y1_R, X1_R, Y2_R, X2_R*/) (
144-
filter_mem[i] = filter_mem[i - 18/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1_L, X1_L, Y2_L, X2_L, Y1_R, X1_R, Y2_R, X2_R*/];
139+
i = band_count*14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/ - 1;
140+
while (i >= 14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/) (
141+
filter_mem[i] = filter_mem[i - 14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/];
145142
i -= 1;
146143
);
147144

@@ -158,22 +155,15 @@ function shift_filters_down() local(i, filter_mem_i) (
158155
filter_mem_i[4/*FILTER:B2*/] = target_filter.b2;
159156

160157
// Rewrite output - zero gain, so should be same as input
161-
filter_mem_i[10/*FILTER:Y1_L*/] = filter_mem_i[11/*FILTER:X1_L*/];
162-
filter_mem_i[12/*FILTER:Y2_L*/] = filter_mem_i[13/*FILTER:X2_L*/];
163-
filter_mem_i[14/*FILTER:Y1_R*/] = filter_mem_i[15/*FILTER:X1_R*/];
164-
filter_mem_i[16/*FILTER:Y2_R*/] = filter_mem_i[17/*FILTER:X2_R*/];
165-
166-
// Now calculate_filters will do the correct thing
167-
calculate_filters();
158+
filter_mem_i[10/*FILTER:Y1*/] = filter_mem_i[11/*FILTER:X1*/];
159+
filter_mem_i[12/*FILTER:Y2*/] = filter_mem_i[13/*FILTER:X2*/];
168160
);
169161

170-
function shift_filters_up() local(i, bw, filter_mem_i) (
171-
cycle_phase += 1;
172-
162+
function shift_filters_up(filter_mem) local(i, bw, filter_mem_i) (
173163
// Shunt all filters up
174164
i = 0;
175-
while (i < (band_count - 1)*18/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1_L, X1_L, Y2_L, X2_L, Y1_R, X1_R, Y2_R, X2_R*/) (
176-
filter_mem[i] = filter_mem[i + 18/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1_L, X1_L, Y2_L, X2_L, Y1_R, X1_R, Y2_R, X2_R*/];
165+
while (i < (band_count - 1)*14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/) (
166+
filter_mem[i] = filter_mem[i + 14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/];
177167
i += 1;
178168
);
179169

@@ -182,24 +172,19 @@ function shift_filters_up() local(i, bw, filter_mem_i) (
182172
target_filter.filter_band(high_freq, 1, bw);
183173
shift_up_new_filter.filter_band(high_freq, 1, bw);
184174
// Copy coefficients
185-
filter_mem_i = filter_mem + (band_count - 1)*18/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1_L, X1_L, Y2_L, X2_L, Y1_R, X1_R, Y2_R, X2_R*/;
175+
filter_mem_i = filter_mem + (band_count - 1)*14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/;
186176
filter_mem_i[0/*FILTER:A1*/] = target_filter.a1;
187177
filter_mem_i[1/*FILTER:A2*/] = target_filter.a2;
188178
filter_mem_i[2/*FILTER:B0*/] = target_filter.b0;
189179
filter_mem_i[3/*FILTER:B1*/] = target_filter.b1;
190180
filter_mem_i[4/*FILTER:B2*/] = target_filter.b2;
191181

192182
// Rewrite output - zero gain, so should be same as input
193-
filter_mem_i[10/*FILTER:Y1_L*/] = filter_mem_i[11/*FILTER:X1_L*/];
194-
filter_mem_i[12/*FILTER:Y2_L*/] = filter_mem_i[13/*FILTER:X2_L*/];
195-
filter_mem_i[14/*FILTER:Y1_R*/] = filter_mem_i[15/*FILTER:X1_R*/];
196-
filter_mem_i[16/*FILTER:Y2_R*/] = filter_mem_i[17/*FILTER:X2_R*/];
197-
198-
// Now calculate_filters will do the correct thing
199-
calculate_filters();
183+
filter_mem_i[10/*FILTER:Y1*/] = filter_mem_i[11/*FILTER:X1*/];
184+
filter_mem_i[12/*FILTER:Y2*/] = filter_mem_i[13/*FILTER:X2*/];
200185
);
201186

202-
function correction_amp(freq) local(wi, wr, hi, hr, pr, pi, pm2, zr, zi, tr, ti, i, filter_mem_i) (
187+
function correction_amp(filter_mem, freq) local(wi, wr, hi, hr, pr, pi, pm2, zr, zi, tr, ti, i, filter_mem_i) (
203188
hr = 1;
204189
hi = 0;
205190
wr = cos(2*$pi*freq/srate);
@@ -209,7 +194,7 @@ function correction_amp(freq) local(wi, wr, hi, hr, pr, pi, pm2, zr, zi, tr, ti,
209194

210195
i = 0;
211196
while (i < actual_band_count) (
212-
filter_mem_i = filter_mem + 18/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1_L, X1_L, Y2_L, X2_L, Y1_R, X1_R, Y2_R, X2_R*/*i;
197+
filter_mem_i = filter_mem + 14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/*i;
213198
// Numerator (B)
214199
zr = filter_mem_i[2/*FILTER:B0*/] + filter_mem_i[3/*FILTER:B1*/]*wr + filter_mem_i[4/*FILTER:B2*/]*w2r;
215200
zi = filter_mem_i[3/*FILTER:B1*/]*wi + filter_mem_i[4/*FILTER:B2*/]*w2i;
@@ -236,46 +221,22 @@ function correction_amp(freq) local(wi, wr, hi, hr, pr, pi, pm2, zr, zi, tr, ti,
236221
sqrt(hr*hr + hi*hi);
237222
);
238223

239-
/*
240-
function correction_phase(freq) local(wi, wr, hi, hr, pr, pi, pm2, zr, zi, tr, ti, i) (
241-
hr = 1;
242-
hi = 0;
243-
wr = cos(2*$pi*freq/srate);
244-
wi = sin(2*$pi*freq/srate);
245-
w2r = cos(4*$pi*freq/srate);
246-
w2i = sin(4*$pi*freq/srate);
247-
248-
i = 0;
249-
while (i < correction_N) (
250-
zr = correction_b0[i] + correction_b1[i]*wr + correction_b2[i]*w2r;
251-
zi = correction_b1[i]*wi + correction_b2[i]*w2i;
252-
pr = 1 + correction_a1[i]*wr + correction_a2[i]*w2r;
253-
pi = correction_a1[i]*wi + correction_a2[i]*w2i;
254-
pm2 = pr*pr + pi*pi;
255-
256-
tr = hr;
257-
ti = hi;
258-
hr = tr*zr - ti*zi;
259-
hi = tr*zi + ti*zr;
260-
261-
tr = hr;
262-
ti = hi;
263-
hr = tr*pr + ti*pi;
264-
hi = ti*pr - tr*pi;
265-
hr /= pm2;
266-
hi /= pm2;
267-
i += 1;
268-
);
269-
atan2(hi, hr);
270-
);
271-
*/
272-
273224
cycle_phase = play_position*cycle_phase_lfo_hz + beat_position*cycle_phase_invbeat + cycle_phase_offset;
274225
cycle_phase -= floor(cycle_phase);
275226
cycle_phase_offset_prev = cycle_phase_offset;
276227

277-
samples_to_next_block = 1000;
278-
calculate_filters();
228+
samples_to_next_block = 0;
229+
cycle_phase_step = 0;
230+
231+
function calculate_filters_stereo() (
232+
cycle_phase_left = cycle_phase - cycle_phase_stereo_offset*0.5;
233+
cycle_phase_left -= floor(cycle_phase_left);
234+
calculate_filters(filter_mem_l, cycle_phase_left);
235+
cycle_phase_right = cycle_phase + cycle_phase_stereo_offset*0.5;
236+
cycle_phase_right -= floor(cycle_phase_right);
237+
calculate_filters(filter_mem_r, cycle_phase_right);
238+
);
239+
calculate_filters_stereo();
279240

280241
@block
281242

@@ -311,64 +272,69 @@ cycle_phase_blockdelta += cycle_phase_adjustment;
311272

312273
samples_to_next_block = samplesblock;
313274
cycle_phase_step = cycle_phase_blockdelta/samplesblock;
275+
calculate_filters_stereo(samplesblock);
314276

315-
// Get ready for the next block
316-
beat_position_next_block = beat_position + beat_blockdelta;
317-
cycle_phase_offset_prev = cycle_phase_offset;
318-
319-
calculate_filters();
320-
277+
// Phase logging
321278
phase_logger_buffer[phase_logger_index] = cycle_phase;
322279
phase_logger_index += 1;
323280
phase_logger_index >= phase_logger_length ? (
324281
phase_logger_index = 0;
325282
);
326283

284+
// Get ready for the next block
285+
beat_position_next_block = beat_position + beat_blockdelta;
286+
cycle_phase_offset_prev = cycle_phase_offset;
287+
cycle_phase += cycle_phase_blockdelta;
288+
327289
@sample
328290

329-
x0_l = spl0;
330-
x0_r = spl1;
331-
332-
i = 0;
333-
loop(actual_band_count,
334-
filter_mem_i = filter_mem + i*18/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1_L, X1_L, Y2_L, X2_L, Y1_R, X1_R, Y2_R, X2_R*/;
335-
336-
y0_l = x0_l*filter_mem_i[2/*FILTER:B0*/]
337-
+ filter_mem_i[11/*FILTER:X1_L*/]*filter_mem_i[3/*FILTER:B1*/]
338-
+ filter_mem_i[13/*FILTER:X2_L*/]*filter_mem_i[4/*FILTER:B2*/]
339-
- filter_mem_i[10/*FILTER:Y1_L*/]*filter_mem_i[0/*FILTER:A1*/]
340-
- filter_mem_i[12/*FILTER:Y2_L*/]*filter_mem_i[1/*FILTER:A2*/];
341-
filter_mem_i[13/*FILTER:X2_L*/] = filter_mem_i[11/*FILTER:X1_L*/];
342-
filter_mem_i[11/*FILTER:X1_L*/] = x0_l;
343-
filter_mem_i[12/*FILTER:Y2_L*/] = filter_mem_i[10/*FILTER:Y1_L*/];
344-
filter_mem_i[10/*FILTER:Y1_L*/] = y0_l;
345-
x0_l = y0_l;
346-
347-
y0_r = x0_r*filter_mem_i[2/*FILTER:B0*/]
348-
+ filter_mem_i[15/*FILTER:X1_R*/]*filter_mem_i[3/*FILTER:B1*/]
349-
+ filter_mem_i[17/*FILTER:X2_R*/]*filter_mem_i[4/*FILTER:B2*/]
350-
- filter_mem_i[14/*FILTER:Y1_R*/]*filter_mem_i[0/*FILTER:A1*/]
351-
- filter_mem_i[16/*FILTER:Y2_R*/]*filter_mem_i[1/*FILTER:A2*/];
352-
filter_mem_i[17/*FILTER:X2_R*/] = filter_mem_i[15/*FILTER:X1_R*/];
353-
filter_mem_i[15/*FILTER:X1_R*/] = x0_r;
354-
filter_mem_i[16/*FILTER:Y2_R*/] = filter_mem_i[14/*FILTER:Y1_R*/];
355-
filter_mem_i[14/*FILTER:Y1_R*/] = y0_r;
356-
x0_r = y0_r;
357-
358-
i += 1;
291+
function filter(x0, filter_mem) local(i, y0, filter_mem_i) (
292+
i = 0;
293+
loop(actual_band_count,
294+
filter_mem_i = filter_mem + i*14/*FILTER: A1, A2, B0, B1, B2, A1_STEP, A2_STEP, B0_STEP, B1_STEP, B2_STEP, Y1, X1, Y2, X2*/;
295+
296+
y0 = x0*filter_mem_i[2/*FILTER:B0*/]
297+
+ filter_mem_i[11/*FILTER:X1*/]*filter_mem_i[3/*FILTER:B1*/]
298+
+ filter_mem_i[13/*FILTER:X2*/]*filter_mem_i[4/*FILTER:B2*/]
299+
- filter_mem_i[10/*FILTER:Y1*/]*filter_mem_i[0/*FILTER:A1*/]
300+
- filter_mem_i[12/*FILTER:Y2*/]*filter_mem_i[1/*FILTER:A2*/];
301+
filter_mem_i[13/*FILTER:X2*/] = filter_mem_i[11/*FILTER:X1*/];
302+
filter_mem_i[11/*FILTER:X1*/] = x0;
303+
filter_mem_i[12/*FILTER:Y2*/] = filter_mem_i[10/*FILTER:Y1*/];
304+
filter_mem_i[10/*FILTER:Y1*/] = y0;
305+
x0 = y0;
306+
i += 1;
307+
);
308+
x0;
359309
);
360310

361-
spl0 = x0_l;
362-
spl1 = x0_r;
311+
spl0 = filter(spl0, filter_mem_l);
312+
spl1 = filter(spl1, filter_mem_r);
363313

364-
step_filters();
314+
step_filters(filter_mem_l);
315+
step_filters(filter_mem_r);
365316

366-
cycle_phase += cycle_phase_step;
367-
while (cycle_phase >= 1) (
368-
shift_filters_down();
317+
cycle_phase_left += cycle_phase_step;
318+
while (cycle_phase_left >= 1) (
319+
cycle_phase_left -= 1;
320+
shift_filters_down(filter_mem_l);
321+
calculate_filters(filter_mem_l, cycle_phase_left);
322+
);
323+
while (cycle_phase_left < 0) (
324+
cycle_phase_left += 1;
325+
shift_filters_up(filter_mem_l);
326+
calculate_filters(filter_mem_l, cycle_phase_left);
327+
);
328+
cycle_phase_right += cycle_phase_step;
329+
while (cycle_phase_right >= 1) (
330+
cycle_phase_right -= 1;
331+
shift_filters_down(filter_mem_r);
332+
calculate_filters(filter_mem_r, cycle_phase_right);
369333
);
370-
while (cycle_phase < 0) (
371-
shift_filters_up();
334+
while (cycle_phase_right < 0) (
335+
cycle_phase_right += 1;
336+
shift_filters_up(filter_mem_r);
337+
calculate_filters(filter_mem_r, cycle_phase_right);
372338
);
373339

374340
samples_to_next_block -= 1;
@@ -406,13 +372,24 @@ ui_screen() == "main" ? (
406372
ui_pop();
407373

408374
control_background_technical();
375+
409376
g_i = 0;
410377
loop(g_buffer_length,
411378
g_freq = 20*exp(log(18000/20)*g_i/g_buffer_length);
412-
g_buffer[g_i] = log(correction_amp(g_freq))*20/log(10);
379+
g_buffer[g_i] = log(correction_amp(filter_mem_l, g_freq))*20/log(10);
413380
g_i += 1;
414381
);
415382
ui_graph(g_buffer, g_buffer_length, -20, 20);
383+
384+
ui_color(96, 192, 256, 0.6);
385+
g_i = 0;
386+
loop(g_buffer_length,
387+
g_freq = 20*exp(log(18000/20)*g_i/g_buffer_length);
388+
g_buffer[g_i] = log(correction_amp(filter_mem_r, g_freq))*20/log(10);
389+
g_i += 1;
390+
);
391+
ui_graph(g_buffer, g_buffer_length, -20, 20);
392+
416393
control_finish_technical();
417394
) : control_system();
418395

0 commit comments

Comments
 (0)