forked from Yoshimi/yoshimi
/
SUBnoteUI.fl
846 lines (790 loc) · 26.6 KB
/
SUBnoteUI.fl
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
# data file for the Fltk User Interface Designer (fluid)
version 1.0303
header_name {.h}
code_name {.cc}
comment {SubNoteUI.h} {not_in_source in_header
}
comment {SubNoteUI.cc} {in_source not_in_header
}
comment {Original ZynAddSubFX author Nasca Octavian Paul
Copyright (C) 2002-2005 Nasca Octavian Paul
Copyright 2009-2011, Alan Calvert
Copyright 2015-2016, Will Godfrey
This file is part of yoshimi, which is free software: you can redistribute
it and/or modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
yoshimi is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License (version 2 or
later) for more details.
You should have received a copy of the GNU General Public License along with
yoshimi; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.
This file is derivative of ZynAddSubFX original code, modified November 2016
} {in_source in_header
}
decl {\#include "UI/MiscGui.h"} {public local
}
decl {\#include "WidgetPDialUI.h"} {public local
}
decl {\#include "WidgetMWSliderUI.h"} {public local
}
decl {\#include "EnvelopeUI.h"} {public local
}
decl {\#include "FilterUI.h"} {public local
}
decl {\#include "PresetsUI.h"} {public local
}
decl {\#include "Misc/SynthHelper.h"} {public local
}
decl {\#include "Params/SUBnoteParameters.h"} {public local
}
decl {\#include "Misc/SynthEngine.h"} {public global
}
decl {\#include "MasterUI.h"} {private global
}
class SUBnoteharmonic {: {public Fl_Group}
} {
Function {make_window()} {private
} {
Fl_Window harmonic {
xywh {558 534 90 310} type Double hide
class Fl_Group
} {
Fl_Slider mag {
callback {int x=0;
if (Fl::event_button() != 3)
x=127-(int)o->value();
else
{
if (n == 0)
x = 127;
o->value(127-x);
}
pars->Phmag[n]=x;
send_data(6, n, x, 0xc8);
if (pars->Phmag[n]==0)
o->selection_color(0);
else
o->selection_color(222);}
tooltip {harmonic's magnitude} xywh {0 15 10 131} type {Vert Knob} box FLAT_BOX selection_color 222 maximum 127 step 1 value 127
code0 {o->value(127-pars->Phmag[n]);}
code1 {if (pars->Phmag[n]==0) o->selection_color(0);}
class mwheel_slider
}
Fl_Slider bw {
callback {int x=64;
if (Fl::event_button() != 3)
x=127-(int)o->value();
else
o->value(x);
pars->Phrelbw[n]=x;
send_data(7, n, x, 0xc8);
if (pars->Phrelbw[n]==64)
o->selection_color(0);
else
o->selection_color(222);}
tooltip {harmonic's bandwidth} xywh {0 156 10 126} type {Vert Knob} box FLAT_BOX selection_color 222 maximum 127 step 1 value 64
code0 {o->value(127-pars->Phrelbw[n]);}
code1 {if (pars->Phrelbw[n]==64) o->selection_color(0);}
class mwheel_slider
}
Fl_Box {} {
xywh {10 216 5 5} box FLAT_BOX color 39
code0 {if (n+1==MAX_SUB_HARMONICS) o->hide();}
}
Fl_Box {} {
label 01
xywh {0 285 10 15} labelfont 1 labelsize 9 align 20
code0 {char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));}
}
Fl_Box {} {
label 01
xywh {0 0 10 15} labelfont 1 labelsize 9 align 20
code0 {char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));}
}
}
}
Function {SUBnoteharmonic(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
code {n=0;} {}
}
Function {send_data(int insert, int control, float value, int type)} {} {
code {//
collect_data(synth, value, (Fl::event_button() | type), control, npart, kititem, 1, insert);} {}
}
Function {init(SUBnoteParameters *pars_, int n_, int npart_, int kititem_)} {} {
code {pars=pars_;
synth = pars->getSynthEngine();
n=n_;
npart = npart_;
kititem = kititem_;
make_window();
harmonic->show();
end();} {}
}
Function {refresh()} {} {
code {mag->value(127-pars->Phmag[n]);
if (pars->Phmag[n]==0) mag->selection_color(0);
bw->value(127-pars->Phrelbw[n]);} {}
}
Function {~SUBnoteharmonic()} {} {
code {harmonic->hide();
hide();
//delete(harmonic);} {}
}
decl {SUBnoteParameters *pars;} {private local
}
decl {SynthEngine *synth;} {private local
}
decl {int n;} {private local
}
decl {int npart;} {private local
}
decl {int kititem;} {private local
}
}
class SUBnoteUI {selected : {public PresetsUI_, SynthHelper}
} {
Function {make_window()} {} {
Fl_Window SUBparameters {
label {SUBsynth Parameters}
xywh {19 114 735 475} type Double hide
code0 {o->copy_label(synth->getGuiMaster()->setPartWindowTitle("SubSynth").c_str());}
code1 {o->position(synth->getGuiMaster()->subNoteX, synth->getGuiMaster()->subNoteY);}
} {
Fl_Scroll {} {
xywh {5 140 434 330} type HORIZONTAL box THIN_UP_BOX
} {
Fl_Pack harmonics {
xywh {10 145 425 325} type HORIZONTAL
code0 {for (int i=0;i<MAX_SUB_HARMONICS;i++){h[i]=new SUBnoteharmonic(0,0,15,o->h(),"");h[i]->init(pars, i, npart, kititem);}}
} {}
}
Fl_Button {} {
label Close
callback {synth->getGuiMaster()->subNoteX = SUBparameters->x();
synth->getGuiMaster()->subNoteY = SUBparameters->y();
SUBparameters->hide();
if ((Fl::event_button() == 3))
{
if (synth->getGuiMaster()->partui->partKitOn)
synth->getGuiMaster()->partui->instrumentkitlist->show();
else
synth->getGuiMaster()->partui->instrumenteditwindow->show();
}}
xywh {625 446 105 20} box THIN_UP_BOX labelfont 1 labelsize 11
}
Fl_Group {} {
label AMPLITUDE
xywh {5 5 215 135} box THIN_UP_FRAME labelfont 1 labelsize 12 align 17
} {
Fl_Dial vol {
label Volume
callback {pars->PVolume = (int)o->value();
o->show_custom_value_units(-60.0f*(1.0f-(int)o->value()/96.0f),"dB",1);
send_data (0, o->value(), 0xc8);}
tooltip Volume xywh {40 20 29 29} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
code0 {o->value(pars->PVolume);}
code1 {o->init(96);}
class WidgetPDial
}
Fl_Dial vsns {
label {Veloc Sens}
callback {pars->PAmpVelocityScaleFunction = (int) o->value();
send_data (1, o->value(), 0xc8);}
tooltip {Velocity sensing} xywh {101 20 29 29} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
code0 {o->value(pars->PAmpVelocityScaleFunction);}
code1 {o->init(90);}
class WidgetPDial
}
Fl_Dial pan {
label Pan
callback {//
pars->setPan((char)o->value());
randompan->value(pars->randomPan());
o->show_panning_value();
send_data (2, o->value(), 0xc8);}
tooltip {Panning - zero/leftmost is Random} xywh {160 20 29 29} box ROUND_UP_BOX labelsize 10 align 6 maximum 127 step 1
code0 {o->value(pars->PPanning);}
code1 {o->init(64);}
class WidgetPDial
}
Fl_Light_Button randompan {
label Rand
callback {//
if (pars->randomPan()) // set to full left
{
pars->setPan(1);
pan->value(1);
}
o->value(pars->randomPan());}
xywh {182 49 13 13} box NO_BOX color 35 selection_color 88 labelsize 10
code0 {o->value(pars->randomPan());}
}
Fl_Group ampenv {
label {SUBsynth - Amplitude Envelope}
xywh {10 65 205 70} box FLAT_BOX color 51 align 144
code0 {o->init(pars->AmpEnvelope, npart, kititem, 1, 0);}
class EnvelopeUI
} {}
}
Fl_Group {} {
xywh {495 406 235 35} box THIN_UP_FRAME
} {
Fl_Counter filterstages {
label {Filter Stages}
callback {pars->Pnumstages = (int) o->value();
send_data (80, o->value(), 0xc0);}
tooltip {How many times the noise is filtered} xywh {515 421 45 15} type Simple labelfont 1 labelsize 10 align 1 minimum 1 maximum 5 step 1 textsize 10
code0 {o->value(pars->Pnumstages);}
}
Fl_Choice magtype {
label {Mag.Type}
callback {pars->Phmagtype = (int) o->value();
send_data (81, o->value(), 0xc0);}
xywh {585 421 65 15} down_box BORDER_BOX labelfont 1 labelsize 10 align 1 textsize 11
code0 {o->value(pars->Phmagtype);}
} {
MenuItem {} {
label Linear
xywh {20 20 100 20} labelfont 1 labelsize 11
}
MenuItem {} {
label {-40dB}
xywh {30 30 100 20} labelfont 1 labelsize 11
}
MenuItem {} {
label {-60dB}
xywh {40 40 100 20} labelfont 1 labelsize 11
}
MenuItem {} {
label {-80dB}
xywh {50 50 100 20} labelfont 1 labelsize 11
}
MenuItem {} {
label {-100dB}
xywh {60 60 100 20} labelfont 1 labelsize 11
}
}
Fl_Choice start {
label Start
callback {pars->Pstart = (int) o->value();
send_data (82, o->value(), 0xc0);}
xywh {670 421 50 15} down_box BORDER_BOX labelfont 1 labelsize 10 align 1 textsize 11
code0 {o->value(pars->Pstart);}
} {
MenuItem {} {
label Zero
xywh {30 30 100 20} labelfont 1 labelsize 11
}
MenuItem {} {
label RND
xywh {40 40 100 20} labelfont 1 labelsize 11
}
MenuItem {} {
label {Max.}
xywh {50 50 100 20} labelfont 1 labelsize 11
}
}
}
Fl_Group freqsettingsui {
label FREQUENCY
xywh {440 5 290 135} box THIN_UP_FRAME labelfont 1 labelsize 12 align 17
} {
Fl_Group freqenvelopegroup {
label {SUBsynth - Frequency Envelope}
xywh {445 65 205 70} box FLAT_BOX color 51 align 144
code0 {o->init(pars->FreqEnvelope, npart, kititem, 1, 1);}
code1 {if (pars->PFreqEnvelopeEnabled == 0) o->deactivate();}
class EnvelopeUI
} {}
Fl_Check_Button freqee {
label Enabled
callback {//
pars->PFreqEnvelopeEnabled = o->value();
if (o->value() == 0)
freqenvelopegroup->deactivate();
else
freqenvelopegroup->activate();
o->show();
freqsettingsui->redraw();
send_data (40, o->value(), 0xc0);}
xywh {445 68 55 15} down_box DOWN_BOX labelfont 1 labelsize 10
code0 {o->value(pars->PFreqEnvelopeEnabled);}
}
Fl_Counter octave {
label Octave
callback {//
int k = (int) o->value();
if (k < 0)
k += 16;
pars->PCoarseDetune = k * 1024 + pars->PCoarseDetune % 1024;
send_data (35, o->value(), 0xc0);}
tooltip Octave xywh {445 18 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
code0 {int k=pars->PCoarseDetune/1024;if (k>=8) k-=16;}
code2 {o->value(k);}
}
Fl_Counter coarsedet {
label {Coarse Det.}
callback {//
int k = (int) o->value();
if (k < 0)
k += 1024;
pars->PCoarseDetune = k + (pars->PCoarseDetune / 1024) * 1024;
send_data (37, k, 0xc0);}
tooltip {Coarse Detune} xywh {658 111 60 20} labelsize 10 align 1 minimum -64 maximum 63 step 1 textfont 1 textsize 11
code0 {int k=pars->PCoarseDetune%1024;if (k>=512) k-=1024;}
code2 {o->value(k);}
code3 {o->lstep(10);}
}
Fl_Slider detune {
callback {//
if (Fl::event_button() == 3)
o->value(0);
pars->PDetune = (int)o->value() + 8192;
detunevalueoutput->do_callback();
send_data (32, o->value(), 0xc0);}
tooltip {Fine Detune (cents)} xywh {491 47 234 15} type {Horz Knob} box THIN_DOWN_BOX minimum -8192 maximum 8191 step 1
code0 {o->value(pars->PDetune-8192);}
class mwheel_slider_rev
}
Fl_Value_Output detunevalueoutput {
label Detune
callback {o->value(getDetune(pars->PDetuneType,0,pars->PDetune));}
xywh {444 47 45 15} labelsize 10 align 5 minimum -5000 maximum 5000 textfont 1 textsize 10
code0 {o->step(0.01, 1);}
code1 {o->value(getDetune(pars->PDetuneType,0,pars->PDetune));}
}
Fl_Check_Button hz440 {
label 440Hz
callback {//
int x = (int) o->value();
pars->Pfixedfreq = x;
if (x == 0)
fixedfreqetdial->deactivate();
else
fixedfreqetdial->activate();
send_data (34, x, 0xc0);}
tooltip {set the base frequency to 440Hz} xywh {620 24 48 15} down_box DOWN_BOX labelfont 1 labelsize 10 align 24
code0 {o->value(pars->Pfixedfreq);}
}
Fl_Dial fixedfreqetdial {
label {Eq.T.}
callback {pars->PfixedfreqET=(int) o->value();
send_data (33, o->value(), 0xc8);}
tooltip {How the frequency varies according to the keyboard (leftmost for fixed frequency)} xywh {675 21 20 20} box ROUND_UP_BOX labelsize 10 align 8 maximum 127 step 1
code0 {o->value(pars->PfixedfreqET);}
code1 {if (pars->Pfixedfreq==0) o->deactivate();}
code2 {o->init(0);}
class WidgetPDial
}
Fl_Choice detunetype {
label {Detune Type}
callback {//
pars->PDetuneType = (int) o->value() + 1;
detunevalueoutput->do_callback();
send_data (36, o->value() + 1, 0xc0);}
xywh {655 78 70 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
code0 {o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
code1 {o->value(pars->PDetuneType-1);}
} {}
Fl_Dial bend {
label Bend
callback {pars->PBendAdjust = lrint(o->value());
send_data(38, o->value(), 0xc8);}
tooltip {How the frequency varies according to the pitch wheel} xywh {500 21 20 20} box ROUND_UP_BOX labelsize 10 align 8 maximum 127 step 1
code0 {o->value(pars->PBendAdjust);}
code1 {o->init(88);}
class WidgetPDial
}
Fl_Dial offset {
label Offset
callback {pars->POffsetHz = lrint(o->value());
send_data(39, o->value(), 0xc8);}
tooltip {Offset of the frequency in Hz.} xywh {558 21 20 20} box ROUND_UP_BOX labelsize 10 align 8 maximum 127 step 1
code0 {o->value(pars->POffsetHz);}
code1 {o->init(64);}
class WidgetPDial
}
}
Fl_Check_Button stereo {
label Stereo
callback {pars->Pstereo=(int) o->value();
send_data (112, o->value(), 0xc0);}
xywh {440 406 55 35} box THIN_UP_BOX down_box DOWN_BOX labelfont 1 labelsize 10
code0 {o->value(pars->Pstereo);}
}
Fl_Button {} {
label Clear
callback {//
for (int i = 0; i < MAX_SUB_HARMONICS; i++)
{
h[i]->mag->value(127);
h[i]->mag->selection_color(0);
pars->Phmag[i] = 0;
h[i]->bw->value(64);
h[i]->bw->selection_color(0);
pars->Phrelbw[i] = 64;
}
pars->Phmag[0] = 127;
h[0]->mag->selection_color(222);
h[0]->mag->value(0);
SUBparameters->redraw();
send_data (96, o->value(), 0xc0);}
tooltip {Clear the harmonics} xywh {445 446 70 20} box THIN_UP_BOX labelfont 1 labelsize 11
}
Fl_Group bandwidthsettingsui {
label BANDWIDTH open
xywh {220 5 220 135} box THIN_UP_FRAME labelfont 1 labelsize 12 align 17
} {
Fl_Group bandwidthenvelopegroup {
label {SUBsynth - BandWidth Envelope}
xywh {225 65 205 70} box FLAT_BOX color 51 align 144
code0 {o->init(pars->BandWidthEnvelope, npart, kititem, 1, 3);}
code1 {if (pars->PBandWidthEnvelopeEnabled==0) o->deactivate();}
class EnvelopeUI
} {}
Fl_Check_Button bwee {
label Enabled
callback {//
pars->PBandWidthEnvelopeEnabled = o->value();
if (o->value() == 0)
bandwidthenvelopegroup->deactivate();
else
bandwidthenvelopegroup->activate();
o->show();
bandwidthsettingsui->redraw();
send_data (18, o->value(), 0xc0);}
xywh {225 67 55 15} down_box DOWN_BOX labelfont 1 labelsize 10
code0 {o->value(pars->PBandWidthEnvelopeEnabled);}
}
Fl_Value_Slider bandwidth {
label {Band Width}
callback {if (Fl::event_button() == 3)
o->value(40);
pars->Pbandwidth=(int) o->value();
send_data (16, o->value(), 0xc8);}
xywh {225 40 115 15} type {Horz Knob} box THIN_DOWN_BOX labelsize 10 align 1 maximum 127 step 1
code0 {o->value(pars->Pbandwidth);}
class mwheel_val_slider_rev
}
Fl_Value_Slider bwidthscale {
label {B.Width Scale}
callback {if (Fl::event_button() == 3)
o->value(0);
pars->Pbwscale=(int) o->value() + 64;
send_data (17, o->value() + 64, 0xc8);}
tooltip {How much I increase the BandWidth according to lower/higher harmonics} xywh {345 40 90 15} type {Horz Knob} box THIN_DOWN_BOX labelsize 10 align 1 minimum -64 maximum 63 step 1
code0 {o->value(pars->Pbwscale-64);}
class mwheel_val_slider_rev
}
}
Fl_Group globalfiltergroup {
label FILTER
xywh {440 221 290 185} box THIN_UP_FRAME labelfont 1 labelsize 12 align 17
code0 {if (pars->PGlobalFilterEnabled==0) o->deactivate();}
} {
Fl_Group filterenv {
label {SUBsynth - Filter Envelope}
xywh {445 331 275 70} box FLAT_BOX color 51 align 144
code0 {o->init(pars->GlobalFilterEnvelope, npart, kititem, 1, 2);}
class EnvelopeUI
} {}
Fl_Group filterui {
label {SUBsynthl - Filter}
xywh {445 246 275 75} box FLAT_BOX color 50 align 144
code0 {o->init(pars->GlobalFilter,&pars->PGlobalFilterVelocityScale,&pars->PGlobalFilterVelocityScaleFunction, npart, kititem, 1);}
class FilterUI
} {}
}
Fl_Check_Button filtere {
label Enabled
callback {//
pars->PGlobalFilterEnabled = o->value();
if (o->value() == 0)
globalfiltergroup->deactivate();
else
globalfiltergroup->activate();
o->show();
globalfiltergroup->redraw();
send_data (64, o->value(), 0xc0);}
xywh {445 226 85 20} down_box DOWN_BOX labelfont 1 labelsize 11
code0 {o->value(pars->PGlobalFilterEnabled);}
}
Fl_Button {} {
label C
callback {synth->getGuiMaster()->getPresetsUi()->copy(pars);}
xywh {540 449 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
}
Fl_Button {} {
label P
callback {synth->getGuiMaster()->getPresetsUi()->paste(pars,this);}
xywh {576 449 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
}
Fl_Group {} {
label OVERTONES
xywh {440 140 290 81} box THIN_UP_FRAME labelfont 1 labelsize 12 align 17
} {
Fl_Choice spreadtype {
label {Overtones Position}
callback {pars->POvertoneSpread.type = (int)o->value();
pars->updateFrequencyMultipliers();
send_data (51, o->value(), 0xc0);}
xywh {460 171 87 20} down_box BORDER_BOX labelsize 10 align 2 textsize 10
code0 {o->value(pars->POvertoneSpread.type);}
} {
MenuItem {} {
label Harmonic
xywh {5 5 34 20} labelfont 1 labelsize 11
}
MenuItem {} {
label ShiftU
xywh {15 15 34 20} labelfont 1 labelsize 11
}
MenuItem {} {
label ShiftL
xywh {25 25 34 20} labelfont 1 labelsize 11
}
MenuItem {} {
label PowerU
xywh {25 25 34 20} labelfont 1 labelsize 11
}
MenuItem {} {
label PowerL
xywh {35 35 34 20} labelfont 1 labelsize 11
}
MenuItem {} {
label Sine
xywh {45 45 34 20} labelfont 1 labelsize 11
}
MenuItem {} {
label Power
xywh {55 55 34 20} labelfont 1 labelsize 11
}
MenuItem {} {
label Shift
xywh {25 25 34 20} labelfont 1 labelsize 11
}
}
Fl_Dial spreadpar1 {
label Par1
callback {pars->POvertoneSpread.par1 = o->value();
pars->updateFrequencyMultipliers();
send_data (48, o->value(), 0xc0);}
xywh {572 166 30 30} box ROUND_UP_BOX labelsize 10 maximum 255 step 1
code0 {o->value(pars->POvertoneSpread.par1);}
code1 {o->init(0);}
class WidgetPDial
}
Fl_Dial spreadpar2 {
label Par2
callback {pars->POvertoneSpread.par2 = o->value();
pars->updateFrequencyMultipliers();
send_data (49, o->value(), 0xc0);}
xywh {626 166 30 30} box ROUND_UP_BOX labelsize 10 maximum 255 step 1
code0 {o->value(pars->POvertoneSpread.par2);}
code1 {o->init(0);}
class WidgetPDial
}
Fl_Dial spreadpar3 {
label ForceH
callback {pars->POvertoneSpread.par3 = o->value();
pars->updateFrequencyMultipliers();
send_data (50, o->value(), 0xc0);}
xywh {680 166 30 30} box ROUND_UP_BOX labelsize 10 maximum 255 step 1
code0 {o->value(pars->POvertoneSpread.par3);}
code1 {o->init(0);}
class WidgetPDial
}
}
}
}
Function {refresh()} {} {
code {//
for (int i = 0; i < MAX_SUB_HARMONICS; ++i)
h[i]->refresh();
vol->value(pars->PVolume);
vsns->value(pars->PAmpVelocityScaleFunction);
pan->value(pars->PPanning);
bandwidth->value(pars->Pbandwidth);
bwidthscale->value(pars->Pbwscale-64);
bwee->value(pars->PBandWidthEnvelopeEnabled);
if (pars->PBandWidthEnvelopeEnabled == 0)
bandwidthenvelopegroup->deactivate();
else
bandwidthenvelopegroup->activate();
bwee->show();
bandwidthsettingsui->redraw();
detunevalueoutput->value(getDetune(pars->PDetuneType,0,pars->PDetune));
freqee->value(pars->PFreqEnvelopeEnabled);
if (pars->PFreqEnvelopeEnabled == 0)
freqenvelopegroup->deactivate();
else
freqenvelopegroup->activate();
freqee->show();
freqsettingsui->redraw();
detune->value(pars->PDetune - 8192);
hz440->value(pars->Pfixedfreq);
fixedfreqetdial->value(pars->PfixedfreqET);
int k = pars->PCoarseDetune / 1024;
if (k >= 8)
k -= 16;
octave->value(k);
detunetype->value(pars->PDetuneType - 1);
k = pars->PCoarseDetune % 1024;
if (k >= 512)
k -= 1024;
coarsedet->value(k);
filtere->value(pars->PGlobalFilterEnabled);
if (pars->PGlobalFilterEnabled == 0)
globalfiltergroup->deactivate();
else
globalfiltergroup->activate();
filtere->show();
globalfiltergroup->redraw();
stereo->value(pars->Pstereo);
filterstages->value(pars->Pnumstages);
magtype->value(pars->Phmagtype);
start->value(pars->Pstart);
ampenv->refresh();
bandwidthenvelopegroup->refresh();
freqenvelopegroup->refresh();
filterui->refresh();
filterenv->refresh();} {}
}
Function {send_data(int control, float value, int type)} {} {
code {//
collect_data(synth, value, (Fl::event_button() | type), control, npart, kititem, 1);} {}
}
Function {returns_update(CommandBlock *getData)} {} {
code {//
float value = getData->data.value;
//unsigned char type = getData->data.type;
unsigned char control = getData->data.control;
//unsigned char npart = getData->data.part;
unsigned char insert = getData->data.insert;
if (insert == 6)
{
h[control]->mag->value(127 - (int) value);
Fl::check();
return;
}
if (insert == 7)
{
h[control]->bw->value(127 - (int) value);
Fl::check();
return;
}
switch(control)
{
case 0:
vol->value(value);
break;
case 1:
vsns->value(value);
break;
case 2:
pan->value(value);
randompan->value(value == 0);
break;
case 16:
bandwidth->value(value);
break;
case 17:
bwidthscale->value(value);
break;
case 18:
bwee->value(value != 0);
break;
case 32:
detune->value(value);
detunevalueoutput->do_callback();
break;
case 33:
fixedfreqetdial->value(value);
break;
case 34:
hz440->value(value != 0);
if (value == 0)
fixedfreqetdial->deactivate();
else
fixedfreqetdial->activate();
break;
case 35:
octave->value(value);
break;
case 36:
detunetype->value(value);
break;
case 37:
coarsedet->value(value);
break;
case 40:
freqee->value(value);
break;
case 48:
spreadpar1->value((unsigned int) value);
break;
case 49:
spreadpar2->value((unsigned int) value);
break;
case 50:
spreadpar3->value((unsigned int) value);
break;
case 51:
spreadtype->value((int) value);
break;
case 64:
filtere->value(value != 0);
break;
case 80:
filterstages->value((int) value);
break;
case 81:
magtype->value((int) value);
break;
case 82:
start->value((int) value);
break;
case 96:
for (int i = 0; i < MAX_SUB_HARMONICS; i++)
{
h[i]->mag->value(127);
h[i]->mag->selection_color(0);
h[i]->bw->value(64);
h[i]->bw->selection_color(0);
}
h[0]->mag->selection_color(222);
h[0]->mag->value(0);
break;
case 112:
stereo->value(value != 0);
break;
}
Fl::check();} {}
}
Function {SUBnoteUI(SUBnoteParameters *parameters, int npart_, int kititem_)} {} {
code {pars = parameters;
synth = pars->getSynthEngine();
npart = npart_;
kititem = kititem_;
make_window();} {}
}
Function {~SUBnoteUI()} {return_type virtual
} {
code {//
SUBparameters->hide();
delete(SUBparameters);} {}
}
decl {SUBnoteParameters *pars;} {private local
}
decl {SUBnoteharmonic *h[MAX_SUB_HARMONICS];} {private local
}
decl {SynthEngine *synth;} {private local
}
decl {int npart;} {private local
}
decl {int kititem;} {private local
}
}