-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathGreen Dynamic EQ S2 (Tukan)
8081 lines (6455 loc) · 280 KB
/
Green Dynamic EQ S2 (Tukan)
1
2
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
desc: Green Dynamic EQ S2 (Tukan)
tags filters
version: 1.2.0 //<--- Make sure you change VERSION below if this changes!!
author: Justin Johnson
license: MIT
//slider1:Node1_Enabled=2<0,2,1{Off,Disabled,Enabled}>-LS ON
//slider2:Node1_Gain=0<-24.0,24.0,0.01>-LS Gain
//slider3:Node1_Frequency=29.91<9,92.2,0.01>-LS Frequency
//slider4:Node1_Q=30.5<21,40.0,0.01>-LS Q
//slider24:Node1_Slope=0<0,15,1>Filter1 Slope
//slider5:Node2_Enabled=2<0,2,1{Off,Disabled,Enabled}>-P1 ON
//slider6:Node2_Gain=0<-24.0,24.0,0.01>-P1 Gain
//slider7:Node2_Frequency=36.456<9,92.2,0.01>-P1 Frequency
//slider8:Node2_Q=32.647<0,100.0,0.01>-P1 Q
//slider24:Node1_Slope=0<0,15,1>Filter1 Slope
//slider9:Node3_Enabled=2<0,2,1{Off,Disabled,Enabled}>-P2 ON
//slider10:Node3_Gain=0<-24.0,24.0,0.01>-P2 Gain
//slider11:Node3_Frequency=50.81<9,92.2,0.01>-P2 Frequency
//slider12:Node3_Q=32.647<0,100.0,0.01>-P2 Q
//slider24:Node1_Slope=0<0,15,1>Filter1 Slope
//slider13:Node4_Enabled=2<0,2,1{Off,Disabled,Enabled}>-P3 ON
//slider14:Node4_Gain=0<-24.0,24.0,0.01>-P3 Gain
//slider15:Node4_Frequency=65.298<9,92.2,0.01>-P3 Frequency
//slider16:Node4_Q=32.647<0,100.0,0.01>-P3 Q
//slider24:Node1_Slope=0<0,15,1>Filter1 Slope
//slider17:Node5_Enabled=2<0,2,1{Off,Disabled,Enabled}>-HS ON
//slider18:Node5_Gain=0<-24.0,24.0,0.01>-HS Gain
//slider19:Node5_Frequency=89.981<9,92.2,0.01>-HS Frequency
//slider20:Node5_Q=30.563<21,40.0,0.01>-HS Q
//slider24:Node1_Slope=0<0,15,1>Filter1 Slope
//slider21:Node6_Enabled=0<0,2,1{Off,Disabled,Enabled}>-HP ON
//slider22:Node6_Frequency=27.026<9,92.2,0.01>-HP Frequency
//slider23:Node6_Slope=2<0,15,1>-HP Slope
slider1:Node1_Enabled=2<0,2,1{Off,Disabled,Enabled}>-LS ON
slider2:0<-24.0,24.0,0.01>-LS Gain
slider3:Node1_Frequency=29.91<9,92.2,0.01>-LS Frequency
slider4:Node1_Q=30.5<21,40.0,0.01>-LS Q
//slider24:Node1_Slope=0<0,15,1>Filter1 Slope
slider5:Node2_Enabled=2<0,2,1{Off,Disabled,Enabled}>-P1 ON
slider6:0<-24.0,24.0,0.01>-P1 Gain
slider7:Node2_Frequency=36.456<9,92.2,0.01>-P1 Frequency
slider8:Node2_Q=32.647<0,100.0,0.01>-P1 Q
//slider24:Node1_Slope=0<0,15,1>Filter1 Slope
slider9:Node3_Enabled=2<0,2,1{Off,Disabled,Enabled}>-P2 ON
slider10:0<-24.0,24.0,0.01>-P2 Gain
slider11:Node3_Frequency=50.81<9,92.2,0.01>-P2 Frequency
slider12:Node3_Q=32.647<0,100.0,0.01>-P2 Q
//slider24:Node1_Slope=0<0,15,1>Filter1 Slope
slider13:Node4_Enabled=2<0,2,1{Off,Disabled,Enabled}>-P3 ON
slider14:0<-24.0,24.0,0.01>-P3 Gain
slider15:Node4_Frequency=65.298<9,92.2,0.01>-P3 Frequency
slider16:Node4_Q=32.647<0,100.0,0.01>-P3 Q
//slider24:Node1_Slope=0<0,15,1>Filter1 Slope
slider17:Node5_Enabled=2<0,2,1{Off,Disabled,Enabled}>-HS ON
slider18:0<-24.0,24.0,0.01>-HS Gain
slider19:Node5_Frequency=89.981<9,92.2,0.01>-HS Frequency
slider20:Node5_Q=30.563<21,40.0,0.01>-HS Q
//slider24:Node1_Slope=0<0,15,1>Filter1 Slope
slider21:Node6_Enabled=0<0,2,1{Off,Disabled,Enabled}>-HP ON
slider22:Node6_Frequency=27.026<9,92.2,0.01>-HP Frequency
slider23:Node6_Slope=2<0,15,1>-HP Slope
slider24:Gain=0<-24,24,0.01>-Trim
slider25:0<0,1,1>-Bypass
slider26:SC_Listen=0<0,5,1>-SC_Listen
slider27:SC1_Thresh=-20<-60,0,0.1> -Band1 Thresh
slider28:SC1_Sensivity=5<0,10,0.01> -Band1 Sensivity
slider29:SC1_Attack=10<0.1,100,0.1> -Band1 Attack
slider30:SC1_Release=50<10,400,1> -Band1 Release
slider31:<-24,24,.1> -Band1 Range
slider32:SC1_On=1<0,1,1{Off, On}> -Band1 On
slider33:SC2_Thresh=-20<-60,0,0.1> -Band2 Thresh
slider34:SC2_Sensivity=5<0,10,0.01> -Band2 Sensivity
slider35:SC2_Attack=10<0.1,100,0.1> -Band2 Attack
slider36:SC2_Release=50<10,400,1> -Band2 Release
slider37:<-24,24,.1> -Band2 Range
slider38:SC2_On=1<0,1,1{Off, On}> -Band2 On
slider39:SC3_Thresh=-20<-60,0,0.1> -Band3 Thresh
slider40:SC3_Sensivity=5<0,10,0.01> -Band3 Sensivity
slider41:SC3_Attack=10<0.1,100,0.1> -Band3 Attack
slider42:SC3_Release=50<10,400,1> -Band3 Release
slider43:<-24,24,.1> -Band3 Range
slider44:SC3_On=1<0,1,1{Off, On}> -Band3 On
slider45:SC4_Thresh=-20<-60,0,0.1> -Band4 Thresh
slider46:SC4_Sensivity=5<0,10,0.01> -Band4 Sensivity
slider47:SC4_Attack=10<0.1,100,0.1> -Band4 Attack
slider48:SC4_Release=50<10,400,1> -Band4 Release
slider49:<-24,24,.1> -Band4 Range
slider50:SC4_On=1<0,1,1{Off, On}> -Band4 On
slider51:SC5_Thresh=-20<-60,0,0.1> -Band5 Thresh
slider52:SC5_Sensivity=5<0,10,0.01> -Band5 Sensivity
slider53:SC5_Attack=10<0.1,100,0.1> -Band5 Attack
slider54:SC5_Release=50<10,400,1> -Band5 Release
slider55:<-24,24,.1> -Band5 Range
slider56:SC5_On=1<0,1,1{Off, On}> -Band5 On
slider57:SC1_Input=0<0,5,1{Internal, SC1, SC2, SC3, SC4, SC5}>- Input 1
slider58:SC2_Input=0<0,5,1{Internal, SC1, SC2, SC3, SC4, SC5}>- Input 2
slider59:SC3_Input=0<0,5,1{Internal, SC1, SC2, SC3, SC4, SC5}>- Input 3
slider60:SC4_Input=0<0,5,1{Internal, SC1, SC2, SC3, SC4, SC5}>- Input 4
slider61:SC5_Input=0<0,5,1{Internal, SC1, SC2, SC3, SC4, SC5}>- Input 5
import S2GFX/spectrum.jsfx-inc
import S2GFX/svf_filter.jsfx-inc
import S2GFX/firhalfband.jsfx-inc
import S2GFX/tk_lib.jsfx-inc
in_pin:left input
in_pin:right input
in_pin:sc1 input left
in_pin:sc1 input right
in_pin:sc2 input left
in_pin:sc2 input right
in_pin:sc3 input left
in_pin:sc3 input right
in_pin:sc4 input left
in_pin:sc4 input right
in_pin:sc5 input left
in_pin:sc5 input right
out_pin:left output
out_pin:right output
filename:0,S2GFX/HD_Back.png
filename:1,S2GFX/BlueKnob.png
filename:2,S2GFX/RedKnob.png
filename:3,S2GFX/SmallKnob.png
filename:4,S2GFX/button.png
filename:5,S2GFX/switch.png
filename:6,S2GFX/gled.png
filename:7,S2GFX/rled.png
filename:8,S2GFX/yled.png
filename:9,S2GFX/oled.png
filename:10,S2GFX/bled.png
filename:11,S2GFX/menu.png
filename:12,S2GFX/S2_logo.png
options:No_meter
options:gfx_hz=60
options:gmem=TukanGreenEQS2
//options:gfx_idle
@init
GEQ_VERSION = 1.16;
//0.99 removed options:gfx_idle
//0935 Removed filters_to_sliders() ind @serialize
//093 Sensitivity!! +SC support, fixed threshold zoom issue
//09 added auto bypass support
/*
0.8 keine changes
changes 0.6:
Changed TCP/MCP graphics
degub: Lowshelf in MCP/TCP now dragging
*/
Stereo_Mode=1; //<0,1,1{Mid/Side,Left/Right}>-Stereo Mode
Quality=0; //<0,1,1{Eco,HQ}>-Quality
MLGain=0;//<-136,30,0.01>-Mid/Left Gain
SRGain=0;//<-136,30,0.01>-Side/Right Gain
Scale=100;//<0,200,0.01>-Scale
Spectrum_Mode=0;//<0,5,1{Full,Mid,Side,Mid / Side,Left,Right,Left / Right}>-Spectrum
//Display_Mode=0;//<0,2,1{Fill,Line,None}>-Display
//Ceiling_Value=0;//<0,2,1{0dB,20dB,40dB}>-Ceiling
//Floor_Value=0;//<0,2,1{-90dB,-140dB,-200dB}>-Floor
//Tilt_Value=3;//<0,5,1{0dB/oct,1.5dB/oct,3dB/oct,4.5dB/oct,6dB/oct}>-Tilt
//Type_Value=1;//<0,3,1{Hamming,Blackman-Harris,Blackman,Rectangular}>-Type
//Block_Value=3;//<0,3,1{2048,4096,8192,16384}>-Block Size
Show_Piano=0;//<0,1,1{Off,On}>-Show Piano
Show_Peaks=0;//<0,1,1{Off,On}>-Show Peaks
Show_PreEQ=0;//<0,1,1{Off,On}>-Show Pre-EQ
Db_Range=3;//<0,4,1{6dB,12dB,18dB,24dB,30dB}>-dB Range
MidPolarity=0;//<0,1,1>-Mid Polarity
SidePolarity=0;//<0,1,1>-Side Polarity
LimitOutput=0;//<0,1,1>-Limit Output
AGCEnabled=0;//<0,1,1>-AGC Enabled
PanelEnabled=0;//<0,1,1>-Panel Enabled
Node1_Group=0;//<0,2,1{Stereo,Mid,Side,Left,gfx_blitRight}>Filter1 Group
Node1_Type=3;//<0,10,1{Peak,Low Cut,Low Cut (Butterworth),Low Shelf,High Shelf,High Cut,High Cut (Butterworth),Notch,Band Pass,Tilt Shelf,Pultec Low Shelf,All Pass,Low Cut Analog,High Cut Analog}>Filter1 Type
Node2_Group=0;//<0,2,1{Stereo,Mid,Side,Left,Right}>Filter1 Group
Node2_Type=0;//<0,10,1{Peak,Low Cut,Low Cut (Butterworth),Low Shelf,High Shelf,High Cut,High Cut (Butterworth),Notch,Band Pass,Tilt Shelf,Pultec Low Shelf,All Pass,Low Cut Analog,High Cut Analog}>Filter1 Type
Node3_Group=0;//<0,2,1{Stereo,Mid,Side,Left,Right}>Filter1 Group
Node3_Type=0;//<0,10,1{Peak,Low Cut,Low Cut (Butterworth),Low Shelf,High Shelf,High Cut,High Cut (Butterworth),Notch,Band Pass,Tilt Shelf,Pultec Low Shelf,All Pass,Low Cut Analog,High Cut Analog}>Filter1 Type
Node4_Group=0;//<0,2,1{Stereo,Mid,Side,Left,Right}>Filter1 Group
Node4_Type=0;//<0,10,1{Peak,Low Cut,Low Cut (Butterworth),Low Shelf,High Shelf,High Cut,High Cut (Butterworth),Notch,Band Pass,Tilt Shelf,Pultec Low Shelf,All Pass,Low Cut Analog,High Cut Analog}>Filter1 Type
Node5_Group=0;//<0,2,1{Stereo,Mid,Side,Left,Right}>Filter1 Group
Node5_Type=4;//<0,10,1{Peak,Low Cut,Low Cut (Butterworth),Low Shelf,High Shelf,High Cut,High Cut (Butterworth),Notch,Band Pass,Tilt Shelf,Pultec Low Shelf,All Pass,Low Cut Analog,High Cut Analog}>Filter1 Type
Node6_Group=0;//<0,2,1{Stereo,Mid,Side,Left,Right}>Filter1 Group
Node6_Type=2;//<0,10,1{Peak,Low Cut,Low Cut (Butterworth),Low Shelf,High Shelf,High Cut,High Cut (Butterworth),Notch,Band Pass,Tilt Shelf,Pultec Low Shelf,All Pass,Low Cut Analog,High Cut Analog}>Filter1 Type
// This should be the same as in the comment header
#VERSION = "1.2.0";
ext_tail_size = 64;
ext_nodenorm = 1;
gfx_ext_retina = 1;
gfx_clear=0;
ext_noinit=1;
lastCap=1;
mouse_wheel=1;
is_recording = 0; is_playing = 0; is_stopped = 1;
while_playing = 1; while_recording = 1; while_stopped = 1;
Number_input = 0;
number_input_raw = 0;
number_input_use = 0;
komma = 0;
in_key = 0;
number_input_x = 0;
number_input_y=0;
number_input_slider = 0;
number_input_min=0;
number_input_max=0;
number_input_invalid = 0;
number_input_sign=1;
s2_numbers_of_sliders = 61;
s2_numbers_of_generics = 8;
group_generics =1057910; // fuer group_generics[bis zu 200]
sliders_old = group_generics + 16*200;
generics_old = sliders_old + 16*64;
//link_group = 0;
//link_group_master = 0;
blueknob = 1;
redknob = 2;
smallknob = 3;
button = 4;
switch = 5;
gled = 6; rled = 7; yled = 8; oled = 9; bled = 10;
menu = 11;
logo = 12;
Mouse_Sensivity ();
//Q = 76.87 = 10Q
OEQ_knobs_y = 270;
OEQ_knobs_x = 60;
OEQ_knobs_step = 160;
OEQ_knobs_x_plus = 110;
//Parameter_config (slider_ default_ minVal_ maxVal_ xIn_ yIn_ wIn frames_ scaling_ file_)
N1_on.button_config(1, OEQ_knobs_x + 15, 530);
N1_Gain.parameter_config (2, 0, -24, 24, OEQ_knobs_x, 230, 150, 200, 1, blueknob);
N1_Freq.parameter_config (3, 29.91, 9, 92.2, OEQ_knobs_x+7, 350, 120, 200, 1, smallknob);
N1_Q.parameter_config (4, 30.5, 21, 40, OEQ_knobs_x+7, OEQ_knobs_y + 180, 120, 200, 1, smallknob);
N2_on.button_config(5, 60+OEQ_knobs_x_plus+OEQ_knobs_x, OEQ_knobs_y + 180);
N2_Gain.parameter_config (6, 0, -24, 24, OEQ_knobs_x_plus+OEQ_knobs_x+35, OEQ_knobs_y, 150, 200, 1, blueknob);
N2_Freq.parameter_config (7, 36.456, 9, 92.2, OEQ_knobs_x_plus+OEQ_knobs_x, OEQ_knobs_y + 100, 120, 200, 1, smallknob);
N2_Q.parameter_config (8, 32.647, 0, 100, OEQ_knobs_x_plus+OEQ_knobs_x+80, OEQ_knobs_y + 100, 120, 200, 1, smallknob);
N3_on.button_config(9, 60+OEQ_knobs_x_plus+OEQ_knobs_x+OEQ_knobs_step, OEQ_knobs_y + 180);
N3_Gain.parameter_config (10, 0, -24, 24, OEQ_knobs_x_plus+OEQ_knobs_step+OEQ_knobs_x+35, OEQ_knobs_y, 150, 200, 1, blueknob);
N3_Freq.parameter_config (11, 50.81, 9, 92.2, OEQ_knobs_x_plus+OEQ_knobs_step+OEQ_knobs_x, OEQ_knobs_y + 100, 120, 200, 1, smallknob);
N3_Q.parameter_config (12, 32.647, 0, 100, OEQ_knobs_x_plus+OEQ_knobs_step+OEQ_knobs_x+80, OEQ_knobs_y + 100, 120, 200, 1, smallknob);
N4_on.button_config(13, 60+OEQ_knobs_x_plus+OEQ_knobs_x+OEQ_knobs_step*2, OEQ_knobs_y + 180);
N4_Gain.parameter_config (14, 0, -24, 24, OEQ_knobs_x_plus+2*OEQ_knobs_step+OEQ_knobs_x+35, OEQ_knobs_y, 150, 200, 1, blueknob);
N4_Freq.parameter_config (15, 65.298, 9, 92.2, OEQ_knobs_x_plus+2*OEQ_knobs_step+OEQ_knobs_x, OEQ_knobs_y + 100, 120, 200, 1, smallknob);
N4_Q.parameter_config (16, 32.647, 0, 100, OEQ_knobs_x_plus+2*OEQ_knobs_step+OEQ_knobs_x+80, OEQ_knobs_y + 100, 120, 200, 1, smallknob);
N5_Gain.parameter_config (18, 0, -24, 24, 2*OEQ_knobs_x_plus+2*OEQ_knobs_step+2*OEQ_knobs_x+3, 230, 150, 200, 1, blueknob);
N5_Freq.parameter_config (19, 89.981, 9, 92.2, 7+2*OEQ_knobs_x_plus+2*OEQ_knobs_step+2*OEQ_knobs_x+3, 350, 120, 200, 1, smallknob);
N5_Q.parameter_config (20, 30.563, 21, 40, 7+2*OEQ_knobs_x_plus+2*OEQ_knobs_step+2*OEQ_knobs_x+3, OEQ_knobs_y + 180, 120, 200, 1, smallknob);
N5_on.button_config(17, 2*OEQ_knobs_x_plus+2*OEQ_knobs_step+2*OEQ_knobs_x + 18, 530);
//N6_Gain.parameter_config (22, 0, -24, 24, 2*OEQ_knobs_x_plus+2*OEQ_knobs_step+2*OEQ_knobs_x+3, 230, 150, 200, 1, blueknob);
N6_Freq.parameter_config (22, 27.026, 9, 92.2, OEQ_knobs_x_plus+OEQ_knobs_x+12, OEQ_knobs_y + 260, 120, 200, 1, smallknob);
N6_Q.parameter_config (23, 2, 0, 6, OEQ_knobs_x_plus+OEQ_knobs_x+92, OEQ_knobs_y + 260, 120, 200, 1, smallknob);
N6_on.button_config(21, OEQ_knobs_x_plus+OEQ_knobs_x+220, OEQ_knobs_y + 273);
OutGain.parameter_config (24, 0, -24, 24, OEQ_knobs_x_plus+OEQ_knobs_x+360, OEQ_knobs_y + 260, 120, 200, 1, smallknob);
BBypass.button_config(25,740,0);
/*
slider27:SC1_Thresh=-20<-60,0,0.1> SC1 Thresh
slider28:SC1_Ratio=4<0.1,10,0.01> SC1 Ratio
slider29:SC1_Attack=10<0.1,100,0.1> SC1 Attack
slider30:SC1_Release=50<10,400,1> SC1 Release
slider31:SC1_Target=0<-24,24,.1> SC1 Target
slider32:SC1_On=1<0,1,1{Off, On}> SC1 On
*/
SC1_Threshold.parameter_config (27, -20, -60, 0, 290, 335, 150, 200, 1, blueknob);
SC1_Sensivity.parameter_config (28, 5, 0, 10, 290, 335, 150, 200, 1, blueknob);
SC1_Attack.parameter_config (29, 10, 0.1, 100, 320, 445, 120, 200, 1, smallknob);
SC1_Release.parameter_config (30, 50, 10, 400, 420, 445, 120, 200, 1, smallknob);
SC1_Range.parameter_config (31, 0, -24, 24, 290 + 140, 335, 150, 200, 1, blueknob);
Sc1_On.button_config (32, 570, 490);
SC2_Threshold.parameter_config (33, -20, -60, 0, 290, 335, 150, 200, 1, blueknob);
SC2_Sensivity.parameter_config (34, 5, 0, 10, 290, 335, 150, 200, 1, blueknob);
SC2_Attack.parameter_config (35, 10, 0.1, 100, 320, 445, 120, 200, 1, smallknob);
SC2_Release.parameter_config (36, 50, 10, 400, 420, 445, 120, 200, 1, smallknob);
SC2_Range.parameter_config (37, 0, -24, 24, 290 + 140, 335, 150, 200, 1, blueknob);
Sc2_On.button_config (38, 570, 490);
SC3_Threshold.parameter_config (39, -20, -60, 0, 290, 335, 150, 200, 1, blueknob);
SC3_Sensivity.parameter_config (40, 5, 0, 10, 290, 335, 150, 200, 1, blueknob);
SC3_Attack.parameter_config (41, 10, 0.1, 100, 320, 445, 120, 200, 1, smallknob);
SC3_Release.parameter_config (42, 50, 10, 400, 420, 445, 120, 200, 1, smallknob);
SC3_Range.parameter_config (43, 0, -24, 24, 290 + 140, 335, 150, 200, 1, blueknob);
Sc3_On.button_config (44, 570, 490);
SC4_Threshold.parameter_config (45, -20, -60, 0, 290, 335, 150, 200, 1, blueknob);
SC4_Sensivity.parameter_config (46, 5, 0, 10, 290, 335, 150, 200, 1, blueknob);
SC4_Attack.parameter_config (47, 10, 0.1, 100, 320, 445, 120, 200, 1, smallknob);
SC4_Release.parameter_config (48, 50, 10, 400, 420, 445, 120, 200, 1, smallknob);
SC4_Range.parameter_config (49, 0, -24, 24, 290 + 140, 335, 150, 200, 1, blueknob);
Sc4_On.button_config (50, 570, 490);
SC5_Threshold.parameter_config (51, -20, -60, 0, 290, 335, 150, 200, 1, blueknob);
SC5_Sensivity.parameter_config (52, 5, 0, 10, 290, 335, 150, 200, 1, blueknob);
SC5_Attack.parameter_config (53, 10, 0.1, 100, 320, 445, 120, 200, 1, smallknob);
SC5_Release.parameter_config (54, 50, 10, 400, 420, 445, 120, 200, 1, smallknob);
SC5_Range.parameter_config (55, 0, -24, 24, 290 + 140, 335, 150, 200, 1, blueknob);
Sc5_On.button_config (56, 570, 490);
Sc1_Input.button_config (57, 570, 490);
Sc2_Input.button_config (58, 570, 490);
Sc3_Input.button_config (59, 570, 490);
Sc4_Input.button_config (60, 570, 490);
Sc5_Input.button_config (61, 570, 490);
function computeGainReduction(x)
(
(x < this.Tlo) ? x = 0 :
(x > this.Thi) ? x = this.slope * (x - this.Threshold) :
(this.delta = x - this.Tlo;
x = this.delta * this.delta * this.knee_factor;);
this.eps = 0.0000000001;
this.yR = min(x, this.aplhaER * this.yR + (1 - this.aplhaER) * x + this.eps - this.eps);
this.yA = this.aplhaA * this.yA + (1 - this.aplhaA) * this.yR + this.eps - this.eps;
x = this.yA;
);
function compressor_sliders(threshold_ ratio_ attack_ release_ knee_ ) (
this.Threshold = threshold_;
//this.knee_width = abs(threshold_*2*knee_*0.01);
this.Knee = knee_;
this.ratio = ratio_;
this.slope = ((1 - this.ratio) / this.ratio);
this.attack = attack_/1000;
this.release = release_/1000;
this.aplhaA = this.attack>0 ? exp(-1 / (this.attack * srate)) : 0;
this.aplhaER = this.release>0 ? exp(-1 / (this.release * srate)) : 0;
this.Tlo = (this.Threshold - this.knee_width / 2);
this.Thi = (this.Threshold + this.knee_width / 2);
this.knee_factor = (this.slope / (this.knee_width * 2));
);
last_gfx_ext_retina = -1;
/*
* Initialise memory allocator
*/
function init_memory() instance(index) (
index = 0;
);
/*
* Allocate memory
*/
function alloc_memory(amount) instance(index) local(i) (
i = index;
index += amount;
i;
);
/*
* Round number up or down
*/
function round(in) (
floor(in + 0.5 * sign(in));
);
/*
* Standard log2
*/
function log2(x) (
log(x) / log(2);
);
/*
* Return string of integer
*/
function int2str(intIn) local (outStr) (
strcpy(outStr=#,"");
sprintf(outStr,"%d",intIn);
outStr;
);
/*
* Get note from frequency
*/
function freq2note(f) (
round(12*(log(f/440)/log(2))+69);
);
/*
* Get gain (for filters) from dB
*/
function db_to_gain(db) (
10^(db / 40);
);
function RMS_init(buffer_index, buffer_size)
instance(rms_sum, rms_buffer, rms_bufIdx, rms_prev_val, rms_max_count)
(
rms_sum = 0;
rms_buffer = buffer_index;
rms_bufIdx = 0;
rms_prev_val = 0;
rms_max_count = buffer_size;
memset(rms_buffer , 0, rms_max_count);
);
function RMS_reset()
instance(rms_sum, rms_buffer, rms_bufIdx, rms_prev_val, rms_max_count)
(
rms_sum = 0;
rms_bufIdx = 0;
rms_prev_val = 0;
memset(rms_buffer , 0, rms_max_count);
);
function RMS_process(s0, s1)
instance(rms_sum, rms_buffer, rms_bufIdx, rms_prev_val, rms_max_count)
local(rms_ampL, rms_ampR, rms_amp)
(
rms_ampL = abs(s0);
rms_ampR = abs(s1);
// Epsilon clamp required
rms_ampL < 0.0000001 ? rms_ampL = 0.0000001;
rms_ampR < 0.0000001 ? rms_ampR = 0.0000001;
rms_amp = (rms_ampL * rms_ampL + rms_ampR * rms_ampR) * 0.5;
rms_sum += rms_amp;
rms_prev_val = rms_buffer[rms_bufIdx];
rms_buffer[rms_bufIdx] = rms_amp;
rms_bufIdx += 1;
rms_bufIdx == rms_max_count ? (
rms_bufIdx = 0;
);
rms_sum -= rms_prev_val;
rms_sum < 0 ? rms_sum = 0.0;
);
function RMS_getDB()
instance(rms_sum, rms_max_count)
local(rms_delta, rms_db)
(
rms_delta = rms_sum / rms_max_count;
rms_db = 20 * log10(sqrt(rms_delta));
rms_db;
);
/*
* Color object
*/
function create_color(r, g, b)
instance(red, green, blue) (
red = r / 255;
green = g / 255;
blue = b / 255;
);
/*
* Set oversampling rate including PDC
*/
function set_oversample(os) (
// We'll only switch to oversampling if the sample rate
// is low enough to benefit.
srate < 88200 && os ? (
DO_OVERSAMPLE = 1;
SAMPLE_RATE = srate * 2;
ONE_OVER_SAMPLE_RATE = 1.0 / SAMPLE_RATE;
// Choose right FIR window for sample rate
srate == 44100 ? (
firL.init_FIR_filter_44100();
firR.init_FIR_filter_44100();
SC1_firL.init_FIR_filter_44100();
SC1_firR.init_FIR_filter_44100();
SC2_firL.init_FIR_filter_44100();
SC2_firR.init_FIR_filter_44100();
SC3_firL.init_FIR_filter_44100();
SC3_firR.init_FIR_filter_44100();
SC4_firL.init_FIR_filter_44100();
SC4_firR.init_FIR_filter_44100();
SC5_firL.init_FIR_filter_44100();
SC5_firR.init_FIR_filter_44100();
) : srate == 48000 ? (
firL.init_FIR_filter_48000();
firR.init_FIR_filter_48000();
SC1_firL.init_FIR_filter_48000();
SC1_firR.init_FIR_filter_48000();
SC2_firL.init_FIR_filter_48000();
SC2_firR.init_FIR_filter_48000();
SC3_firL.init_FIR_filter_48000();
SC3_firR.init_FIR_filter_48000();
SC4_firL.init_FIR_filter_48000();
SC4_firR.init_FIR_filter_48000();
SC5_firL.init_FIR_filter_48000();
SC5_firR.init_FIR_filter_48000();
);
pdc_delay = get_FIR_pdc();
pdc_bot_ch = 0;
pdc_top_ch = 2;
) : (
DO_OVERSAMPLE = 0;
SAMPLE_RATE = srate;
ONE_OVER_SAMPLE_RATE = 1.0 / srate;
pdc_delay = 0;
pdc_bot_ch = 0;
pdc_top_ch = 2;
);
);
/*
* Update the state of any changes
*/
function update_state() local (blocks, fade, fill_r, fill_g, fill_b, fill_a, line_r, line_g, line_b, line_a) (
spectrum.ceiling = Ceiling_Value == 0 ? 0 : Ceiling_Value == 1 ? 20 : Ceiling_Value == 2 ? 40;
spectrum.noise_floor = Floor_Value == 0 ? -90 : Floor_Value == 1 ? -140 : Floor_Value == 2 ? -200;
spectrum.noise_floor = Floor_Value == 0 ? -90 : Floor_Value == 1 ? -140 : Floor_Value == 2 ? -200;
spectrum.tilt = Tilt_Value == 0 ? 0 : Tilt_Value == 1 ? 1.5 : Tilt_Value == 2 ? 3 : Tilt_Value == 3 ? 4.5 :
Tilt_Value == 4 ? 6;
spectrum.windowtype != Type_Value+1 ? spectrum.set_type(Type_Value+1);
blocks = (2 ^ (Block_Value+1)) * 1024;
spectrum.windowsize != blocks ? spectrum.set_block_size(blocks);
fade = do_listen ? 0.5 : 1.0;
// Listen spectrum colours
listline_r = (240 / 255) * 0.80;
listline_g = (101 / 255) * 0.80;
listline_b = (76 / 255) * 0.80;
Display_Mode == 0 ? (
fill_r = 46 / 255;
fill_g = 71 / 255;
fill_b = 83 / 255;
fill_a = 1.0;
spectrum.set_fill(0, 1);
spectrum.set_color(0, fill_r*fade, fill_g*fade, fill_b*fade, fill_a);
spectrum.set_fill(2, 0);
spectrum.set_color(2, 0.5, 0.5, 0.5, 1);
fill_r = 96 / 255;
fill_g = 223 / 255;
fill_b = 255 / 255;
fill_a = 0.5;
spectrum.set_fill(1, 1);
spectrum.set_color(1, fill_r*fade, fill_g*fade, fill_b*fade, fill_a);
spectrum.set_fill(3, 0);
spectrum.set_color(3, 0.5, 0.5, 0.5, 1);
spectrum.set_fill(4, 0);
spectrum.set_color(4, listline_r, listline_g, listline_b, 1);
spectrum.set_fill(5, 0);
spectrum.set_color(5, listline_r*0.80, listline_g*0.80, listline_b*0.80, 1);
) : Display_Mode == 1 ? (
line_a=1.0;
line_r = 114 / 255; line_g = 215 / 255; line_b = 253 / 255;;
spectrum.set_fill(0, 0);
spectrum.set_color(0, line_r*fade, line_g*fade, line_b*fade, line_a);
spectrum.set_fill(2, 0);
spectrum.set_color(2, 0.5, 0.5, 0.5, 1);
line_r = 253 / 255; line_g = 185 / 255; line_b = 21 / 255;;
spectrum.set_fill(1, 0);
spectrum.set_color(1, line_r*fade, line_g*fade, line_b*fade, line_a);
spectrum.set_fill(3, 0);
spectrum.set_color(3, 0.5, 0.5, 0.5, 1);
spectrum.set_fill(4, 0);
spectrum.set_color(4, listline_r, listline_g, listline_b, 1);
spectrum.set_fill(5, 0);
spectrum.set_color(5, listline_r*0.80, listline_g*0.80, listline_b*0.80, 1);
);
Db_Range == 0 ? (DB_EQ_RANGE = 6; DB_EQ_RANGE_STEPS = 1;) :
Db_Range == 1 ? (DB_EQ_RANGE = 12; DB_EQ_RANGE_STEPS = 3;) :
Db_Range == 2 ? (DB_EQ_RANGE = 18; DB_EQ_RANGE_STEPS = 6;) :
Db_Range == 3 ? (DB_EQ_RANGE = 24; DB_EQ_RANGE_STEPS = 8;) :
Db_Range == 4 ? (DB_EQ_RANGE = 30; DB_EQ_RANGE_STEPS = 10;);
// spectrum.reset_buffers();
);
/*
* Notify Reaper that frequency has been touched
*/
function notify_touched_frequency(node) (
// Notify Reaper that a parameter change has happened
node == 0 ? slider_automate(Node1_Frequency) :
node == 1 ? slider_automate(Node2_Frequency) :
node == 2 ? slider_automate(Node3_Frequency) :
node == 3 ? slider_automate(Node4_Frequency) :
node == 4 ? slider_automate(Node5_Frequency);
node == 5 ? slider_automate(Node6_Frequency);
);
/*
* Notify Reaper that gain has been touched
*/
function notify_touched_gain(node) (
// Notify Reaper that a parameter change has happened
node == 0 ? slider_automate(Node1_Gain) :
node == 1 ? slider_automate(Node2_Gain) :
node == 2 ? slider_automate(Node3_Gain) :
node == 3 ? slider_automate(Node4_Gain) :
node == 4 ? slider_automate(Node5_Gain);
node == 5 ? slider_automate(Node6_Gain);
);
/*
* Notify Reaper that Q has been touched
*/
function notify_touched_Q(node) (
// Notify Reaper that a parameter change has happened
node == 0 ? slider_automate(Node1_Q) :
node == 1 ? slider_automate(Node2_Q) :
node == 2 ? slider_automate(Node3_Q) :
node == 3 ? slider_automate(Node4_Q) :
node == 4 ? slider_automate(Node5_Q);
node == 5 ? slider_automate(Node6_Q);
);
function band_init()
instance (enabled, type, frequency, gain, q, filter, color) (
filter.svf_set_sample_rate(SAMPLE_RATE);
filter.svf_bypass();
color.create_color(0,0,0);
filter.a1 = filter.t_a1;
filter.a2 = filter.t_a2;
filter.a3 = filter.t_a3;
filter.m0 = filter.t_m0;
filter.m1 = filter.t_m1;
filter.m2 = filter.t_m2;
filter.iter_t = 1.0;
);
/*
* Set enabled state for a band
*/
function band_set_enabled(e)
instance (enabled, type, frequency, gain, q, filter, color) (
enabled = e;
);
/*
* Set the filter
*/
function band_set_filter(t, f, g, qval, slope)
instance (enabled, type, frequency, gain, q, filter, color) (
type = t; frequency = f; gain = g; q = qval;
type == 0 ? filter.svf_eq(frequency, q, db_to_gain(gain)) :
type == 1 ? filter.svf_hp(frequency, q, slope) :
type == 2 ? filter.svf_hpb(frequency, slope) :
type == 3 ? filter.svf_ls(frequency, q, db_to_gain(gain)) :
type == 4 ? filter.svf_hs(frequency, q, db_to_gain(gain)) :
type == 5 ? filter.svf_lp(frequency, q, slope) :
type == 6 ? filter.svf_lpb(frequency, slope) :
type == 7 ? filter.svf_bs(frequency, q) :
type == 8 ? filter.svf_bp2(frequency, q) :
type == 9 ? filter.svf_st(frequency, q, gain) :
type == 10 ? filter.svf_pultecls(frequency, q, gain) :
type == 11 ? filter.svf_ap(frequency, q) :
type == 12 ? filter.svf_analog_lowcut(frequency, q, gain) :
type == 13 ? filter.svf_analog_highcut(frequency, q, gain);
);
/*
* Convert slider % to frequency
*/
function per_to_freq(x, range) (
MIN_FREQ * exp(FREQ_LOG_MAX * x / range);
);
/*
* Convert frequency to slider %
*/
function freq_to_per(freq, range) (
range * log(freq / MIN_FREQ) / FREQ_LOG_MAX;
);
function per_to_q(x, range) (
MIN_Q * exp(Q_LOG_MAX * x / range);
);
/*
* Convert frequency to slider %
*/
function q_to_per(q, range) (
range * log(q / MIN_Q) / Q_LOG_MAX;
);
/*
* Update sliders with filter data
*/
function filters_to_sliders() (
caller = 1;
mouse_cap | mouse_wheel ? (
Node1_Enabled = Band_Enabled[0];
Node1_Group = Band_Group[0];
Node1_Type = Band_Type[0];
Node1_Frequency = freq_to_per(Band_Frequency[0], 100);
Node1_Gain = Band_Gain[0] - SC1_GR;
filter_dragging == 1 ? slider2 = node1_Gain;
Node1_Q = q_to_per(Band_Q[0], 100);
Node1_Slope = Band_Slope[0];
Node2_Enabled = Band_Enabled[1];
Node2_Group = Band_Group[1];
Node2_Type = Band_Type[1];
Node2_Frequency = freq_to_per(Band_Frequency[1], 100);
Node2_Gain = Band_Gain[1] - SC2_GR;
filter_dragging == 1 ? slider6 = node2_Gain;
Node2_Q = q_to_per(Band_Q[1], 100);
Node2_Slope = Band_Slope[1];
Node3_Enabled = Band_Enabled[2];
Node3_Group = Band_Group[2];
Node3_Type = Band_Type[2];
Node3_Frequency = freq_to_per(Band_Frequency[2], 100);
Node3_Gain = Band_Gain[2] - SC3_GR;
filter_dragging == 1 ? slider10 = node3_Gain;
Node3_Q = q_to_per(Band_Q[2], 100);
Node3_Slope = Band_Slope[2];
Node4_Enabled = Band_Enabled[3];
Node4_Group = Band_Group[3];
Node4_Type = Band_Type[3];
Node4_Frequency = freq_to_per(Band_Frequency[3], 100);
Node4_Gain = Band_Gain[3] - SC4_GR;
filter_dragging == 1 ? slider14 = node4_Gain;
Node4_Q = q_to_per(Band_Q[3], 100);
Node4_Slope = Band_Slope[3];
Node5_Enabled = Band_Enabled[4];
Node5_Group = Band_Group[4];
Node5_Type = Band_Type[4];
Node5_Frequency = freq_to_per(Band_Frequency[4], 100);
Node5_Gain = Band_Gain[4] - SC5_GR;
filter_dragging == 1 ? slider18 = node5_Gain;
Node5_Q = q_to_per(Band_Q[4], 100);
Node5_Slope = Band_Slope[4];
Node6_Enabled = Band_Enabled[5];
Node6_Group = Band_Group[5];
Node6_Type = Band_Type[5];
Node6_Frequency = freq_to_per(Band_Frequency[5], 100);
Node6_Gain = Band_Gain[5];
Node6_Q = q_to_per(Band_Q[5], 100);
Node6_Slope = Band_Slope[5];
);
filter_dragging = 0;
);
/*
* Update filter data with sliders
*/
function sliders_to_filters() (
Band_Enabled[0] = Node1_Enabled;
Band_Group[0] = Node1_Group;
Band_Type[0] = Node1_Type;
Band_Frequency[0] = per_to_freq(Node1_Frequency, 100);
Band_Gain[0] = Node1_Gain;
Band_Q[0] = per_to_q(Node1_Q, 100);
Band_Slope[0] = Node1_Slope;
Band_Enabled[1] = Node2_Enabled;
Band_Group[1] = Node2_Group;
Band_Type[1] = Node2_Type;
Band_Frequency[1] = per_to_freq(Node2_Frequency, 100);
Band_Gain[1] = Node2_Gain;
Band_Q[1] = per_to_q(Node2_Q, 100);
Band_Slope[1] = Node2_Slope;
Band_Enabled[2] = Node3_Enabled;
Band_Group[2] = Node3_Group;
Band_Type[2] = Node3_Type;
Band_Frequency[2] = per_to_freq(Node3_Frequency, 100);;
Band_Gain[2] = Node3_Gain;
Band_Q[2] = per_to_q(Node3_Q, 100);
Band_Slope[2] = Node3_Slope;
Band_Enabled[3] = Node4_Enabled;
Band_Group[3] = Node4_Group;
Band_Type[3] = Node4_Type;
Band_Frequency[3] = per_to_freq(Node4_Frequency, 100);;
Band_Gain[3] = Node4_Gain;
Band_Q[3] = per_to_q(Node4_Q, 100);
Band_Slope[3] = Node4_Slope;
Band_Enabled[4] = Node5_Enabled;
Band_Group[4] = Node5_Group;
Band_Type[4] = Node5_Type;
Band_Frequency[4] = per_to_freq(Node5_Frequency, 100);;
Band_Gain[4] = Node5_Gain;
Band_Q[4] = per_to_q(Node5_Q, 100);
Band_Slope[4] = Node5_Slope;
Band_Enabled[5] = Node6_Enabled;
Band_Group[5] = Node6_Group;
Band_Type[5] = Node6_Type;
Band_Frequency[5] = per_to_freq(Node6_Frequency, 100);;
Band_Gain[5] = Node6_Gain;
Band_Q[5] = per_to_q(Node6_Q, 100);
Band_Slope[5] = Node6_Slope;
);
/*
* Flag filter to update for both audio and graphics
*/
function flag_filter_update(band) (
Band_Update[band] = 1;
Band_GfxUpdate[band] = 1;
);
function flag_filter_update_all() (
Band_Update[0] = 1; Band_GfxUpdate[0] = 1;
Band_Update[1] = 1; Band_GfxUpdate[1] = 1;
Band_Update[2] = 1; Band_GfxUpdate[2] = 1;
Band_Update[3] = 1; Band_GfxUpdate[3] = 1;
Band_Update[4] = 1; Band_GfxUpdate[4] = 1;
Band_Update[5] = 1; Band_GfxUpdate[5] = 1;
Band_Update[6] = 1; Band_GfxUpdate[6] = 1;
Band_Update[7] = 1; Band_GfxUpdate[7] = 1;
Band_Update[8] = 1; Band_GfxUpdate[8] = 1;
Band_Update[9] = 1; Band_GfxUpdate[9] = 1;
Band_Update[10] = 1; Band_GfxUpdate[10] = 1;
Band_Update[11] = 1; Band_GfxUpdate[11] = 1;
Band_Update[12] = 1; Band_GfxUpdate[12] = 1;
Band_Update[13] = 1; Band_GfxUpdate[13] = 1;
Band_Update[14] = 1; Band_GfxUpdate[14] = 1;
Band_Update[15] = 1; Band_GfxUpdate[15] = 1;
);
/*
* Update the filter parameters
*/
function update_visual_filters() local (band_scalar) (
band_scalar = Scale / 100.0;
Band_GfxUpdate[0] ? (Band_GfxUpdate[0] = 0; gfx_band1.band_set_filter(Band_Type[0], Band_Frequency[0], Band_Gain[0] * band_scalar, Band_Q[0], Band_Slope[0]); gfx_band1.filter.svf_set_to_target(); );
Band_GfxUpdate[1] ? (Band_GfxUpdate[1] = 0; gfx_band2.band_set_filter(Band_Type[1], Band_Frequency[1], Band_Gain[1] * band_scalar, Band_Q[1], Band_Slope[1]); gfx_band2.filter.svf_set_to_target(); );
Band_GfxUpdate[2] ? (Band_GfxUpdate[2] = 0; gfx_band3.band_set_filter(Band_Type[2], Band_Frequency[2], Band_Gain[2] * band_scalar, Band_Q[2], Band_Slope[2]); gfx_band3.filter.svf_set_to_target(); );
Band_GfxUpdate[3] ? (Band_GfxUpdate[3] = 0; gfx_band4.band_set_filter(Band_Type[3], Band_Frequency[3], Band_Gain[3] * band_scalar, Band_Q[3], Band_Slope[3]); gfx_band4.filter.svf_set_to_target(); );
Band_GfxUpdate[4] ? (Band_GfxUpdate[4] = 0; gfx_band5.band_set_filter(Band_Type[4], Band_Frequency[4], Band_Gain[4] * band_scalar, Band_Q[4], Band_Slope[4]); gfx_band5.filter.svf_set_to_target(); );
Band_GfxUpdate[5] ? (Band_GfxUpdate[5] = 0; gfx_band6.band_set_filter(Band_Type[5], Band_Frequency[5], Band_Gain[5] * band_scalar, Band_Q[5], Band_Slope[5]); gfx_band6.filter.svf_set_to_target(); );
Band_GfxUpdate[6] ? (Band_GfxUpdate[6] = 0; gfx_band7.band_set_filter(Band_Type[0], Band_Frequency[0], Node1_Gain+SC1_Target * band_scalar, Band_Q[0], Band_Slope[0]); gfx_band7.filter.svf_set_to_target(); );
Band_GfxUpdate[7] ? (Band_GfxUpdate[7] = 0; gfx_band8.band_set_filter(Band_Type[1], Band_Frequency[1], Node2_Gain+SC2_Target * band_scalar, Band_Q[1], Band_Slope[1]); gfx_band8.filter.svf_set_to_target(); );
Band_GfxUpdate[8] ? (Band_GfxUpdate[8] = 0; gfx_band9.band_set_filter(Band_Type[2], Band_Frequency[2], Node3_Gain+SC3_Target * band_scalar, Band_Q[2], Band_Slope[2]); gfx_band9.filter.svf_set_to_target(); );
Band_GfxUpdate[9] ? (Band_GfxUpdate[9] = 0; gfx_band10.band_set_filter(Band_Type[3], Band_Frequency[3], Node4_Gain+SC4_Target * band_scalar, Band_Q[3], Band_Slope[3]); gfx_band10.filter.svf_set_to_target(); );
Band_GfxUpdate[10] ? (Band_GfxUpdate[10] = 0; gfx_band11.band_set_filter(Band_Type[4], Band_Frequency[4], Node5_Gain+SC5_Target * band_scalar, Band_Q[4], Band_Slope[4]); gfx_band11.filter.svf_set_to_target(); );
Band_GfxUpdate[11] ? (Band_GfxUpdate[11] = 0; gfx_band12.band_set_filter(Band_Type[11], Band_Frequency[11], Band_Gain[11] * band_scalar, Band_Q[11], Band_Slope[11]); gfx_band12.filter.svf_set_to_target(); );
Band_GfxUpdate[12] ? (Band_GfxUpdate[12] = 0; gfx_band13.band_set_filter(Band_Type[12], Band_Frequency[12], Band_Gain[12] * band_scalar, Band_Q[12], Band_Slope[12]); gfx_band13.filter.svf_set_to_target(); );
Band_GfxUpdate[13] ? (Band_GfxUpdate[13] = 0; gfx_band14.band_set_filter(Band_Type[13], Band_Frequency[13], Band_Gain[13] * band_scalar, Band_Q[13], Band_Slope[13]); gfx_band14.filter.svf_set_to_target(); );
Band_GfxUpdate[14] ? (Band_GfxUpdate[14] = 0; gfx_band15.band_set_filter(Band_Type[14], Band_Frequency[14], Band_Gain[14] * band_scalar, Band_Q[14], Band_Slope[14]); gfx_band15.filter.svf_set_to_target(); );
Band_GfxUpdate[15] ? (Band_GfxUpdate[15] = 0; gfx_band16.band_set_filter(Band_Type[15], Band_Frequency[15], Band_Gain[15] * band_scalar, Band_Q[15], Band_Slope[15]); gfx_band16.filter.svf_set_to_target(); );
);
function update_audio_filters() local (band_scalar) (
band_scalar = Scale / 100.0;
SC_Listen == 1 ? (Band_Enabled[6] = BAND_STATE_ENABLED; Band_update[6]=1);
SC_Listen == 2 ? (Band_Enabled[7] = BAND_STATE_ENABLED; Band_update[7]=1);
SC_Listen == 3 ? (Band_Enabled[8] = BAND_STATE_ENABLED; Band_update[8]=1);
SC_Listen == 4 ? (Band_Enabled[9] = BAND_STATE_ENABLED; Band_update[9]=1);
SC_Listen == 5 ? (Band_Enabled[10] = BAND_STATE_ENABLED; Band_update[10]=1);
Band_Update[0] ? (Band_Update[0] = 0; Band_Enabled[0] != BAND_STATE_ENABLED ? band1.filter.svf_bypass() : band1.band_set_filter(Band_Type[0], Band_Frequency[0], Band_Gain[0] * band_scalar, Band_Q[0], Band_Slope[0]); );
Band_Update[1] ? (Band_Update[1] = 0; Band_Enabled[1] != BAND_STATE_ENABLED ? band2.filter.svf_bypass() : band2.band_set_filter(Band_Type[1], Band_Frequency[1], Band_Gain[1] * band_scalar, Band_Q[1], Band_Slope[1]); );
Band_Update[2] ? (Band_Update[2] = 0; Band_Enabled[2] != BAND_STATE_ENABLED ? band3.filter.svf_bypass() : band3.band_set_filter(Band_Type[2], Band_Frequency[2], Band_Gain[2] * band_scalar, Band_Q[2], Band_Slope[2]); );
Band_Update[3] ? (Band_Update[3] = 0; Band_Enabled[3] != BAND_STATE_ENABLED ? band4.filter.svf_bypass() : band4.band_set_filter(Band_Type[3], Band_Frequency[3], Band_Gain[3] * band_scalar, Band_Q[3], Band_Slope[3]); );
Band_Update[4] ? (Band_Update[4] = 0; Band_Enabled[4] != BAND_STATE_ENABLED ? band5.filter.svf_bypass() : band5.band_set_filter(Band_Type[4], Band_Frequency[4], Band_Gain[4] * band_scalar, Band_Q[4], Band_Slope[4]); );
Band_Update[5] ? (Band_Update[5] = 0; Band_Enabled[5] != BAND_STATE_ENABLED ? band6.filter.svf_bypass() : band6.band_set_filter(Band_Type[5], Band_Frequency[5], Band_Gain[5] * band_scalar, Band_Q[5], Band_Slope[5]); );
Band_Update[6] ? (Band_Update[6] = 0; Band_Enabled[6] != BAND_STATE_ENABLED ? band7.filter.svf_bypass() : band7.band_set_filter(Band_Type[6], Band_Frequency[6], Band_Gain[6] * band_scalar, Band_Q[6], Band_Slope[6]); );
Band_Update[7] ? (Band_Update[7] = 0; Band_Enabled[7] != BAND_STATE_ENABLED ? band8.filter.svf_bypass() : band8.band_set_filter(Band_Type[7], Band_Frequency[7], Band_Gain[7] * band_scalar, Band_Q[7], Band_Slope[7]); );
Band_Update[8] ? (Band_Update[8] = 0; Band_Enabled[8] != BAND_STATE_ENABLED ? band9.filter.svf_bypass() : band9.band_set_filter(Band_Type[8], Band_Frequency[8], Band_Gain[8] * band_scalar, Band_Q[8], Band_Slope[8]); );
Band_Update[9] ? (Band_Update[9] = 0; Band_Enabled[9] != BAND_STATE_ENABLED ? band10.filter.svf_bypass() : band10.band_set_filter(Band_Type[9], Band_Frequency[9], Band_Gain[9] * band_scalar, Band_Q[9], Band_Slope[9]); );
Band_Update[10] ? (Band_Update[10] = 0; Band_Enabled[10] != BAND_STATE_ENABLED ? band11.filter.svf_bypass() : band11.band_set_filter(Band_Type[10], Band_Frequency[10], Band_Gain[10] * band_scalar, Band_Q[10], Band_Slope[10]); );
Band_Update[11] ? (Band_Update[11] = 0; Band_Enabled[11] != BAND_STATE_ENABLED ? band12.filter.svf_bypass() : band12.band_set_filter(Band_Type[11], Band_Frequency[11], Band_Gain[11] * band_scalar, Band_Q[11], Band_Slope[11]); );
Band_Update[12] ? (Band_Update[12] = 0; Band_Enabled[12] != BAND_STATE_ENABLED ? band13.filter.svf_bypass() : band13.band_set_filter(Band_Type[12], Band_Frequency[12], Band_Gain[12] * band_scalar, Band_Q[12], Band_Slope[12]); );
Band_Update[13] ? (Band_Update[13] = 0; Band_Enabled[13] != BAND_STATE_ENABLED ? band14.filter.svf_bypass() : band14.band_set_filter(Band_Type[13], Band_Frequency[13], Band_Gain[13] * band_scalar, Band_Q[13], Band_Slope[13]); );
Band_Update[14] ? (Band_Update[14] = 0; Band_Enabled[14] != BAND_STATE_ENABLED ? band15.filter.svf_bypass() : band15.band_set_filter(Band_Type[14], Band_Frequency[14], Band_Gain[14] * band_scalar, Band_Q[14], Band_Slope[14]); );
Band_Update[15] ? (Band_Update[15] = 0; Band_Enabled[15] != BAND_STATE_ENABLED ? band16.filter.svf_bypass() : band16.band_set_filter(Band_Type[15], Band_Frequency[15], Band_Gain[15] * band_scalar, Band_Q[15], Band_Slope[15]); );
);
init_rate != srate ? (
init_rate = srate;
// Initialise everything
MEMORY.init_memory();
spectrum.init();
MEMORY.index = spectrum.get_memory_index();
BAND_STATE_OFF = 0;
BAND_STATE_DISABLED = 1;
BAND_STATE_ENABLED = 2;
BAND_STATE_INFORM_DISABLE = 3;
// Allocate and init filter bands
NUM_BANDS = 16;
Band_Update = MEMORY.alloc_memory(NUM_BANDS);
Band_GfxUpdate = MEMORY.alloc_memory(NUM_BANDS);
Band_Enabled = MEMORY.alloc_memory(NUM_BANDS);
Band_Group = MEMORY.alloc_memory(NUM_BANDS);
Band_Type = MEMORY.alloc_memory(NUM_BANDS);
Band_Frequency = MEMORY.alloc_memory(NUM_BANDS);
Band_Gain = MEMORY.alloc_memory(NUM_BANDS);
Band_Q = MEMORY.alloc_memory(NUM_BANDS);
Band_Slope = MEMORY.alloc_memory(NUM_BANDS);
Band_Dynamic_Range = MEMORY.alloc_memory(NUM_BANDS);
Band_Red = MEMORY.alloc_memory(NUM_BANDS);
Band_Green = MEMORY.alloc_memory(NUM_BANDS);
Band_Blue = MEMORY.alloc_memory(NUM_BANDS);
Band_Selected = MEMORY.alloc_memory(NUM_BANDS);
Band_Drag_OffsetX = MEMORY.alloc_memory(NUM_BANDS);
Band_Drag_OffsetY = MEMORY.alloc_memory(NUM_BANDS);
Band_Invert_dB = MEMORY.alloc_memory(NUM_BANDS);
Band_Selected_States = MEMORY.alloc_memory(NUM_BANDS);
band = 0;
while (band < NUM_BANDS) (
Band_Selected[band] = 0;
Band_Drag_OffsetX[band] = 0;
Band_Drag_OffsetY[band] = 0;
Band_Invert_dB[band] = 0;