1# data file for the Fltk User Interface Designer (fluid)
2version 1.0302
3header_name {.h}
4code_name {.cc}
5decl {\#include "../Params/PADnoteParameters.h"} {public local
6}
7
8decl {\#include "ResonanceUI.h"} {public local
9}
10
11decl {\#include <FL/Fl_Box.H>} {public local
12}
13
14decl {\#include <FL/Fl_Group.H>} {public local
15}
16
17decl {\#include <FL/Fl_File_Chooser.H>} {public local
18}
19
20decl {\#include <math.h>} {private local
21}
22
23decl {\#include <stdio.h>} {private local
24}
25
26decl {\#include <stdlib.h>} {private local
27}
28
29decl {\#include <string.h>} {private local
30}
31
32decl {\#include <string>} {public local
33}
34
35decl {\#include "Osc_IntModel.h"} {private local
36}
37
38decl {\#include "Fl_Osc_TSlider.H"} {public local
39}
40
41decl {\#include "Fl_Osc_VSlider.H"} {public local
42}
43
44decl {\#include "EnvelopeUI.h"} {public local
45}
46
47decl {\#include "LFOUI.h"} {public local
48}
49
50decl {\#include "FilterUI.h"} {public local
51}
52
53decl {\#include "OscilGenUI.h"} {public local
54}
55
56decl {\#include "Fl_PADnoteOvertonePosition.h"} {public local
57}
58
59decl {\#include "Fl_PADnoteHarmonicProfile.h"} {public local
60}
61
62decl {\#include "PresetsUI.h"} {public local
63}
64
65class PADnoteUI {open : {public PresetsUI_}
66} {
67  Function {PADnoteUI(std::string location_, Fl_Osc_Interface *osc_)} {open
68  } {
69    code {assert(osc_);
70assert(!location_.empty());
71
72location=location_;
73oscui=NULL;
74osc_i = osc_;
75resui=new ResonanceUI(osc_i, location+"resonance/");
76initialized = false;
77applybutton = NULL;
78make_window();
79apply_watcher = new Osc_IntModel(osc_i);
80apply_watcher->callback=[this](int needsPrepare) {
81    if(needsPrepare) {
82        applybutton->color(FL_RED);
83        applybutton->redraw();
84        if(oscui) {
85            oscui->applybutton->color(FL_RED);
86            oscui->applybutton->redraw();
87        }
88        if(resui) {
89            resui->applybutton->color(FL_RED);
90            resui->applybutton->redraw();
91        }
92    } else {
93        applybutton->color(FL_GRAY);
94        applybutton->redraw();
95        if(oscui) {
96            oscui->applybutton->color(FL_GRAY);
97            oscui->applybutton->redraw();
98        }
99        if(resui) {
100            resui->applybutton->color(FL_GRAY);
101            resui->applybutton->redraw();
102        }
103    }
104};
105apply_watcher->doUpdate(location+"needPrepare");
106initialized = true;} {}
107  }
108  Function {make_window()} {open
109  } {
110    Fl_Window padnotewindow {
111      label {PAD synth Parameters} open
112      xywh {52 324 535 430} type Double hide
113      class Fl_Osc_Window
114    } {
115
116      Fl_Box dummy {
117        xywh {25 25 25 25}
118        code0 {padnotewindow->init(osc_i, location);}
119      }
120      Fl_Tabs {} {
121        callback {if (o->value()!=harmonicstructuregroup) applybutton->hide();
122	else applybutton->show();} open
123        xywh {0 0 535 395} box UP_FRAME
124      } {
125        Fl_Group harmonicstructuregroup {
126          label {Harmonic Structure} open
127          xywh {0 20 535 375} box UP_FRAME
128          class Fl_Osc_Group
129        } {
130          Fl_Group bwprofilegroup {open
131            xywh {5 30 90 260} box UP_FRAME
132            class Fl_Osc_Group
133          } {
134            Fl_Dial hpbasepar1 {
135              label Width
136              callback {if(hpui) hpui->update();
137cbwidget->do_callback();}
138              xywh {20 75 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
139              code2 {o->init("Php.base.par1");o->reset_value=80;}
140              class Fl_Osc_Dial
141            }
142            Fl_Choice hpbasetype {
143              label {Base Type}
144              callback {if(initialized) {hprofile->redraw();
145 hpui->update();
146cbwidget->do_callback();}}
147              xywh {15 45 75 15} down_box BORDER_BOX labelsize 10 align 5 textsize 10
148              code0 {o->init("Php.base.type");}
149              class Fl_Osc_Choice
150            } {
151              MenuItem {} {
152                label Gauss
153                xywh {15 15 100 20} labelfont 1 labelsize 10
154              }
155              MenuItem {} {
156                label Square
157                xywh {25 25 100 20} labelfont 1 labelsize 10
158              }
159              MenuItem {} {
160                label DoubleExp
161                xywh {35 35 100 20} labelfont 1 labelsize 10
162              }
163            }
164            Fl_Dial hpfreqmult {
165              label FreqMlt
166              callback {hpui->update();
167cbwidget->do_callback();}
168              xywh {55 75 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
169              code0 {o->init("Php.freqmult");}
170              class Fl_Osc_Dial
171            }
172            Fl_Dial hpmpar1 {
173              label Str
174              callback {hpui->update();
175cbwidget->do_callback();}
176              xywh {15 115 20 20} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
177              code0 {o->init("Php.modulator.par1");}
178              class Fl_Osc_Dial
179            }
180            Fl_Dial hpmfreq {
181              label SFreq
182              callback {hpui->update();
183cbwidget->do_callback();}
184              xywh {40 115 20 20} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
185              code0 {o->init("Php.modulator.freq");o->reset_value=30;}
186              class Fl_Osc_Dial
187            }
188            Fl_Group {} {
189              xywh {10 160 80 105} box BORDER_BOX
190            } {
191              Fl_Choice hpamptype {
192                label AmpMultiplier
193                callback {if(initialized) {hprofile->redraw();
194                hpui->update();
195cbwidget->do_callback();}}
196                xywh {15 175 70 15} down_box BORDER_BOX labelsize 10 align 5 textsize 10
197                code0 {o->init("Php.amp.type");}
198                class Fl_Osc_Choice
199              } {
200                MenuItem {} {
201                  label OFF
202                  xywh {45 45 100 20} labelfont 1 labelsize 10
203                }
204                MenuItem {} {
205                  label Gauss
206                  xywh {55 55 100 20} labelfont 1 labelsize 10
207                }
208                MenuItem {} {
209                  label Sine
210                  xywh {65 65 100 20} labelfont 1 labelsize 10
211                }
212                MenuItem {} {
213                  label Flat
214                  xywh {75 75 100 20} labelfont 1 labelsize 10
215                }
216              }
217              Fl_Choice hpampmode {
218                label AmpMode
219                callback {if(initialized) {hpui->update();
220cbwidget->do_callback();}}
221                xywh {15 205 70 15} down_box BORDER_BOX labelsize 10 align 5 textsize 10
222                code0 {o->init("Php.amp.mode");}
223                class Fl_Osc_Choice
224              } {
225                MenuItem {} {
226                  label Sum
227                  xywh {60 60 100 20} labelfont 1 labelsize 10
228                }
229                MenuItem {} {
230                  label Mult
231                  xywh {70 70 100 20} labelfont 1 labelsize 10
232                }
233                MenuItem {} {
234                  label Div1
235                  xywh {80 80 100 20} labelfont 1 labelsize 10
236                }
237                MenuItem {} {
238                  label Div2
239                  xywh {90 90 100 20} labelfont 1 labelsize 10
240                }
241              }
242              Fl_Dial hpamppar1 {
243                label Par1
244                callback {hpui->update();
245cbwidget->do_callback();}
246                xywh {15 235 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
247                code0 {o->init("Php.amp.par1");o->reset_value=80;}
248                class Fl_Osc_Dial
249              }
250              Fl_Dial hpamppar2 {
251                label Par2
252                callback {hpui->update();
253cbwidget->do_callback();}
254                xywh {55 235 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
255                code0 {o->init("Php.amp.par2");o->reset_value=64;}
256                class Fl_Osc_Dial
257              }
258            }
259            Fl_Check_Button hpautoscale {
260              label autoscale
261              callback {
262              if(initialized) {
263                  hpui->update();
264                  hprofile->redraw();
265              cbwidget->do_callback();}}
266              xywh {10 270 60 15} down_box DOWN_BOX labelsize 10
267              code0 {o->init("Php.autoscale");}
268              class Fl_Osc_Check
269            }
270            Fl_Choice hponehalf {
271              callback {if(initialized) {hprofile->redraw();
272hpui->update();
273cbwidget->do_callback();}}
274              xywh {10 143 80 15} down_box BORDER_BOX labelsize 10 align 5 textsize 10
275              code0 {o->init("Php.onehalf");}
276              class Fl_Osc_Choice
277            } {
278              MenuItem {} {
279                label Full
280                xywh {25 25 100 20} labelfont 1 labelsize 10
281              }
282              MenuItem {} {
283                label {Upper Half}
284                xywh {45 45 100 20} labelfont 1 labelsize 10
285              }
286              MenuItem {} {
287                label {Lower Half}
288                xywh {35 35 100 20} labelfont 1 labelsize 10
289              }
290            }
291            Fl_Dial hpwidth {
292              label Size
293              callback {hpui->update();
294cbwidget->do_callback();}
295              xywh {65 115 20 20} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
296              code0 {o->init("Php.width");o->reset_value=127;}
297              class Fl_Osc_Dial
298            }
299          }
300          Fl_Group oscilgroup {open
301            xywh {100 155 270 135} box THIN_DOWN_BOX color 32 selection_color 71 labelcolor 179 align 6
302            code0 {oscilgroup->base = location; oscilgroup->ext="oscilgen/"; oscilgroup->osc = osc_i;}
303            code1 {osc=new Fl_Oscilloscope(o->x(),o->y(),o->w(),o->h(),"");osc->init(false);}
304            class Fl_Osc_Group
305          } {}
306          Fl_Button {} {
307            label Change
308            callback {if (oscui!=NULL) delete (oscui);
309oscui=new OscilEditor(false, location+"oscilgen/",osc_i);}
310            xywh {375 270 60 20} box THIN_UP_BOX labelfont 1 labelsize 11
311          }
312          Fl_Box cbwidget {
313            label {Harmonic Content}
314            callback {opui->update();
315            if(applybutton) {
316                applybutton->color(FL_RED);
317                applybutton->redraw();}}
318            xywh {125 135 205 20} align 16
319          }
320          Fl_Button {} {
321            label Resonance
322            callback {resui->resonancewindow->redraw();
323resui->resonancewindow->show();
324resui->setcbwidget(cbwidget,applybutton);}
325            xywh {375 225 80 20} box THIN_UP_BOX
326          }
327          Fl_Dial bwdial {
328            label BandWidth
329            callback {o->oscWrite("bandwidthvalue");cbwidget->do_callback();}
330            xywh {15 295 35 35} box ROUND_UP_BOX labelsize 10 maximum 1000 step 1
331            code0 {o->init("Pbandwidth");o->reset_value=500;}
332            class Fl_Osc_Dial
333          }
334          Fl_Value_Output bwcents {
335            label cents
336            xywh {55 305 55 15} labelsize 10 align 6 maximum 10000 step 0.1
337            code0 {o->init("bandwidthvalue");}
338            class Fl_Osc_Output
339          }
340          Fl_Group {} {open
341            xywh {315 295 215 45} box UP_FRAME
342          } {
343            Fl_Choice hrpostype {
344              label OvertonesPosition
345              callback {if(initialized) {opui->update();
346cbwidget->do_callback();}}
347              xywh {325 310 80 20} down_box BORDER_BOX labelsize 10 align 5 textsize 11
348              code0 {o->init("Phrpos.type");}
349              class Fl_Osc_Choice
350            } {
351              MenuItem {} {
352                label Harmonic
353                xywh {70 70 100 20} labelfont 1 labelsize 11
354              }
355              MenuItem {} {
356                label ShiftU
357                xywh {80 80 100 20} labelfont 1 labelsize 11
358              }
359              MenuItem {} {
360                label ShiftL
361                xywh {90 90 100 20} labelfont 1 labelsize 11
362              }
363              MenuItem {} {
364                label PowerU
365                xywh {90 90 100 20} labelfont 1 labelsize 11
366              }
367              MenuItem {} {
368                label PowerL
369                xywh {100 100 100 20} labelfont 1 labelsize 11
370              }
371              MenuItem {} {
372                label Sine
373                xywh {110 110 100 20} labelfont 1 labelsize 11
374              }
375              MenuItem {} {
376                label Power
377                xywh {120 120 100 20} labelfont 1 labelsize 11
378              }
379              MenuItem {} {
380                label Shift selected
381                xywh {130 130 100 20} labelfont 1 labelsize 11
382              }
383            }
384            Fl_Dial hrpospar1 {
385              label Par1
386              callback {opui->update();
387                  hpui->update();
388cbwidget->do_callback();}
389              xywh {425 310 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 255 step 1
390              code0 {o->init("Phrpos.par1");o->reset_value=64;}
391              class Fl_Osc_Dial
392            }
393            Fl_Dial hrpospar2 {
394              label Par2
395              callback {opui->update();
396cbwidget->do_callback();}
397              xywh {460 310 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 255 step 1
398              code0 {o->init("Phrpos.par2");o->reset_value=64;}
399              class Fl_Osc_Dial
400            }
401            Fl_Dial hrpospar3 {
402              label ForceH
403              callback {opui->update();
404cbwidget->do_callback();}
405              xywh {495 310 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 255 step 1
406              code0 {o->init("Phrpos.par3");}
407              class Fl_Osc_Dial
408            }
409          }
410          Fl_Choice bwscale {
411            label {Bandwidth Scale}
412            callback {if(initialized) {cbwidget->do_callback();}}
413            xywh {120 305 80 20} down_box BORDER_BOX labelsize 10 align 5 textsize 11
414            code0 {o->init("Pbwscale");}
415            class Fl_Osc_Choice
416          } {
417            MenuItem {} {
418              label Normal
419              xywh {95 95 100 20} labelfont 1 labelsize 11
420            }
421            MenuItem {} {
422              label EqualHz
423              xywh {105 105 100 20} labelfont 1 labelsize 11
424            }
425            MenuItem {} {
426              label Quarter
427              xywh {115 115 100 20} labelfont 1 labelsize 11
428            }
429            MenuItem {} {
430              label Half
431              xywh {125 125 100 20} labelfont 1 labelsize 11
432            }
433            MenuItem {} {
434              label {75%}
435              xywh {135 135 100 20} labelfont 1 labelsize 11
436            }
437            MenuItem {} {
438              label {150%}
439              xywh {145 145 100 20} labelfont 1 labelsize 11
440            }
441            MenuItem {} {
442              label Double
443              xywh {145 145 100 20} labelfont 1 labelsize 11
444            }
445            MenuItem {} {
446              label {Inv.Half}
447              xywh {155 155 100 20} labelfont 1 labelsize 11
448            }
449          }
450          Fl_Group overtonepos {
451            xywh {5 345 525 45} box FLAT_BOX color 51 selection_color 218 labelcolor 63
452            code0 {opui=new PADnoteOvertonePosition(o->x(),o->y(),o->w(),o->h(),"");}
453            code1 {opui->init();}
454          } {}
455          Fl_Choice qsamplesize {
456            label {Sample Size}
457            callback {if(initialized) {cbwidget->do_callback();}}
458            xywh {375 190 115 20} down_box BORDER_BOX labelsize 10 align 5 textsize 11
459            code0 {o->init("Pquality.samplesize");}
460            class Fl_Osc_Choice
461          } {
462            MenuItem {} {
463              label {16k (Tiny)}
464              xywh {155 155 100 20} labelfont 1 labelsize 11
465            }
466            MenuItem {} {
467              label 32k
468              xywh {165 165 100 20} labelfont 1 labelsize 11
469            }
470            MenuItem {} {
471              label {64k (Small)}
472              xywh {175 175 100 20} labelfont 1 labelsize 11
473            }
474            MenuItem {} {
475              label 128k
476              xywh {185 185 100 20} labelfont 1 labelsize 11
477            }
478            MenuItem {} {
479              label {256k (Normal)}
480              xywh {205 205 100 20} labelfont 1 labelsize 11
481            }
482            MenuItem {} {
483              label 512k
484              xywh {200 200 100 20} labelfont 1 labelsize 11
485            }
486            MenuItem {} {
487              label {1M (Big)}
488              xywh {205 205 100 20} labelfont 1 labelsize 11
489            }
490          }
491          Fl_Choice qsmpoct {
492            label {smp/oct}
493            callback {if(initialized) cbwidget->do_callback();}
494            xywh {430 155 45 20} down_box BORDER_BOX labelsize 11 align 5 textsize 11
495            code0 {o->init("Pquality.smpoct");}
496            class Fl_Osc_Choice
497          } {
498            MenuItem {} {
499              label {0.5}
500              xywh {10 10 100 20} labelfont 1 labelsize 11
501            }
502            MenuItem {} {
503              label 1
504              xywh {0 0 100 20} labelfont 1 labelsize 11
505            }
506            MenuItem {} {
507              label 2
508              xywh {10 10 100 20} labelfont 1 labelsize 11
509            }
510            MenuItem {} {
511              label 3
512              xywh {20 20 100 20} labelfont 1 labelsize 11
513            }
514            MenuItem {} {
515              label 4
516              xywh {30 30 100 20} labelfont 1 labelsize 11
517            }
518            MenuItem {} {
519              label 6
520              xywh {40 40 100 20} labelfont 1 labelsize 11
521            }
522            MenuItem {} {
523              label 12
524              xywh {50 50 100 20} labelfont 1 labelsize 11
525            }
526          }
527          Fl_Choice qoct {
528            label {no.oct}
529            callback {if(initialized) cbwidget->do_callback();}
530            xywh {480 155 45 20} down_box BORDER_BOX labelsize 11 align 5 textsize 11
531            code0 {o->init("Pquality.oct");}
532            class Fl_Osc_Choice
533          } {
534            MenuItem {} {
535              label 1
536              xywh {10 10 100 20} labelfont 1 labelsize 11
537            }
538            MenuItem {} {
539              label 2
540              xywh {20 20 100 20} labelfont 1 labelsize 11
541            }
542            MenuItem {} {
543              label 3
544              xywh {30 30 100 20} labelfont 1 labelsize 11
545            }
546            MenuItem {} {
547              label 4
548              xywh {40 40 100 20} labelfont 1 labelsize 11
549            }
550            MenuItem {} {
551              label 5
552              xywh {50 50 100 20} labelfont 1 labelsize 11
553            }
554            MenuItem {} {
555              label 6
556              xywh {60 60 100 20} labelfont 1 labelsize 11
557            }
558            MenuItem {} {
559              label 7
560              xywh {70 70 100 20} labelfont 1 labelsize 11
561            }
562            MenuItem {} {
563              label 8
564              xywh {80 80 100 20} labelfont 1 labelsize 11
565            }
566          }
567          Fl_Choice qbasenote {
568            label base
569            callback {if(initialized) cbwidget->do_callback();}
570            xywh {375 155 50 20} down_box BORDER_BOX labelsize 11 align 5 textsize 11
571            code0 {o->init("Pquality.basenote");}
572            class Fl_Osc_Choice
573          } {
574            MenuItem {} {
575              label {C-2}
576              xywh {10 10 100 20} labelfont 1
577            }
578            MenuItem {} {
579              label {G-2}
580              xywh {20 20 100 20} labelfont 1
581            }
582            MenuItem {} {
583              label {C-3}
584              xywh {20 20 100 20} labelfont 1
585            }
586            MenuItem {} {
587              label {G-3}
588              xywh {30 30 100 20} labelfont 1
589            }
590            MenuItem {} {
591              label {C-4}
592              xywh {30 30 100 20} labelfont 1
593            }
594            MenuItem {} {
595              label {G-4}
596              xywh {40 40 100 20} labelfont 1
597            }
598            MenuItem {} {
599              label {C-5}
600              xywh {40 40 100 20} labelfont 1
601            }
602            MenuItem {} {
603              label {G-5}
604              xywh {50 50 100 20} labelfont 1
605            }
606            MenuItem {} {
607              label {G-6}
608              xywh {60 60 100 20} labelfont 1
609            }
610          }
611          Fl_Group hprofile {
612            xywh {100 45 430 90} box FLAT_BOX color 51 selection_color 218 labelcolor 63
613            code0 {hpui=new PADnoteHarmonicProfile(o->x(),o->y(),o->w(),o->h(),"");}
614            code1 {hpui->init();}
615          } {}
616          Fl_Box {} {
617            label {Profile of One Harmonic (Frequency Distribution)}
618            xywh {160 25 315 20}
619          }
620          Fl_Choice spectrummode {
621            label {Spectrum Mode}
622            callback {
623if (o->value()==0){
624   bwprofilegroup->activate();
625   bwdial->activate();
626   bwcents->activate();
627   hprofile->activate();
628   hprofile->color(51);
629   bwscale->activate();
630} else {
631   bwprofilegroup->deactivate();
632   bwdial->deactivate();
633   bwcents->deactivate();
634   hprofile->deactivate();
635   hprofile->color(48);
636   bwscale->deactivate();
637};
638
639hpui->update();
640cbwidget->do_callback();}
641            xywh {220 305 90 20} down_box BORDER_BOX labelfont 1 labelsize 10 align 5 textsize 11
642            code0 {o->init("Pmode");}
643            class Fl_Osc_Choice
644          } {
645            MenuItem {} {
646              label Bandwidth
647              xywh {105 105 100 20} labelfont 1 labelsize 11
648            }
649            MenuItem {} {
650              label Discrete
651              xywh {125 125 100 20} labelfont 1 labelsize 11
652            }
653            MenuItem {} {
654              label Continuous
655              xywh {115 115 100 20} labelfont 1 labelsize 11
656            }
657          }
658        }
659        Fl_Group {} {
660          label {Envelopes&LFOs} open
661          xywh {0 20 535 375} box UP_FRAME hide
662        } {
663          Fl_Group {} {
664            label FREQUENCY open
665            xywh {5 275 525 115} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
666          } {
667            Fl_Group freqenv {
668              label {PADSynth - Frequency Envelope} open
669              xywh {10 315 205 70} box FLAT_BOX color 51 align 144
670              code0 {o->init(ENV_ASR, osc_i, location, "FreqEnvelope/");}
671              class EnvelopeUI
672            } {}
673            Fl_Counter octave {
674              label Octave
675              tooltip Octave xywh {470 295 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
676              code0 {o->init("octave");}
677              class Fl_Osc_Counter
678            }
679            Fl_Counter coarsedet {
680              label {Coarse det.}
681              tooltip {Coarse Detune} xywh {455 365 70 20} type Simple labelsize 10 align 5 minimum -64 maximum 63 step 1 textfont 1 textsize 11
682              code0 {o->init("coarsedetune");}
683              code3 {o->lstep(10);}
684              class Fl_Osc_Counter
685            }
686            Fl_Group freqlfo {
687              label {Frequency LFO     } open
688              xywh {215 315 230 70} box FLAT_BOX color 47 align 144
689              code0 {o->init(osc_i, location, "FreqLfo/");}
690              class LFOUI
691            } {}
692            Fl_Slider detune {
693              callback {o->oscWrite("detunevalue");}
694              tooltip {Fine Detune (cents)} xywh {60 296 295 15} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
695              code0 {o->init("PDetune", 'i');}
696              class Fl_Osc_Slider
697            }
698            Fl_Value_Output detunevalueoutput {
699              label Detune
700              xywh {12 296 45 15} labelsize 10 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 10
701              code0 {o->init("detunevalue");}
702              class Fl_Osc_Output
703            }
704            Fl_Choice detunetype {
705              label {Detune Type}
706              callback {o->oscWrite("detunevalue");} open
707              xywh {450 330 75 20} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
708              code0 {o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
709              code1 {o->init("PDetuneType",1);}
710              class Fl_Osc_Choice
711            } {}
712            Fl_Dial bendadjustdial {
713              label Bend
714              tooltip {How the frequency varies according to the pitch wheel} xywh {60 278 15 15} box ROUND_UP_BOX labelsize 10 align 8 minimum -64 maximum 63 step 1
715              code0 {o->init("PBendAdjust");o->reset_value=24;o->set_transform([](float x){return x/24.0f;});o->set_rounding(2);}
716              class Fl_Osc_Dial
717            }
718            Fl_Dial offsethzdial {
719              label Offset
720              tooltip {Offset of frequency in Hz} xywh {110 278 15 15} box ROUND_UP_BOX labelsize 10 align 8 minimum -64 maximum 63 step 1
721              code0 {o->init("POffsetHz"); o->set_rounding(2); o->set_transform([](float x){x/=64; return 15*(x*sqrtf(fabsf(x)));});}
722              class Fl_Osc_Dial
723            }
724            Fl_Check_Button hz440 {
725              label 440Hz
726              callback {if (o->value()==0) fixedfreqetdial->deactivate();
727   else fixedfreqetdial->activate();}
728              tooltip {set the base frequency to 440Hz} xywh {365 295 50 15} down_box DOWN_BOX labelfont 1 labelsize 10
729              code0 {o->init("Pfixedfreq");}
730              class Fl_Osc_Check
731            }
732            Fl_Dial fixedfreqetdial {
733              label {Eq.T.}
734              tooltip {How the frequency varies according to the keyboard (leftmost for fixed frequency)} xywh {420 295 15 15} box ROUND_UP_BOX labelsize 10 align 8 maximum 127 step 1
735              code0 {o->init("PfixedfreqET");}
736              class Fl_Osc_Dial
737            }
738          }
739          Fl_Group {} {
740            label AMPLITUDE open
741            xywh {5 25 240 250} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
742          } {
743            Fl_Value_Slider volume {
744              label Vol
745              tooltip Volume xywh {10 50 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
746              code0 {o->init("PVolume", 'i');o->reset_value=90;}
747              class Fl_Osc_VSlider
748            }
749            Fl_Value_Slider vsns {
750              label {V.Sns}
751              tooltip {Velocity Sensing Function (rightmost to disable)} xywh {10 70 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
752              code0 {o->init("PAmpVelocityScaleFunction");o->reset_value=64;}
753              class Fl_Osc_VSlider
754            }
755            Fl_Dial pan {
756              label Pan
757              tooltip {Panning (leftmost is Random)} xywh {210 45 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
758              code0 {o->init("PPanning");o->reset_value=64;}
759              class Fl_Osc_Dial
760            }
761            Fl_Dial {} {
762              label De-pop selected
763              tooltip {Pop suppression} xywh {208 238 20 20} type Float labelsize 10 maximum 127 step 1 textfont 1 textsize 11
764              code0 {o->init("Fadein_adjustment");o->reset_value=20;}
765              class Fl_Osc_Dial
766            }
767            Fl_Dial pstr {
768              label {P.Str.}
769              tooltip {Punch Strength} xywh {78 247 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
770              code0 {o->init("PPunchStrength");}
771              class Fl_Osc_Dial
772            }
773            Fl_Dial pt {
774              label {P.t.}
775              tooltip {Punch Time (duration)} xywh {108 247 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
776              code0 {o->init("PPunchTime");o->reset_value=60;}
777              class Fl_Osc_Dial
778            }
779            Fl_Dial pstc {
780              label {P.Stc.}
781              tooltip {Punch Stretch} xywh {138 247 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
782              code0 {o->init("PPunchStretch");o->reset_value=64;}
783              class Fl_Osc_Dial
784            }
785            Fl_Dial pvel {
786              label {P.Vel.}
787              tooltip {Punch Velocity Sensing} xywh {168 247 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
788              code0 {o->init("PPunchVelocitySensing");o->reset_value=72;}
789              class Fl_Osc_Dial
790            }
791            Fl_Group ampenv {
792              label {PADSynth - Amplitude Envelope} open
793              xywh {10 95 205 70} box FLAT_BOX color 51 align 144
794              code0 {o->init(ENV_ADSR, osc_i, location, "AmpEnvelope/");}
795              class EnvelopeUI
796            } {}
797            Fl_Group amplfo {
798              label {Amplitude LFO     } open
799              xywh {10 165 230 70} box FLAT_BOX color 47 align 144
800              code0 {o->init(osc_i, location, "AmpLfo/");}
801              class LFOUI
802            } {}
803            Fl_Check_Button stereo {
804              label Stereo
805              callback {hprofile->redraw();}
806              xywh {10 245 70 25} down_box DOWN_BOX labelsize 12
807              code0 {o->init("PStereo");}
808              class Fl_Osc_Check
809            }
810          }
811          Fl_Group {} {
812            label FILTER open
813            xywh {245 25 285 250} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
814          } {
815            Fl_Group filterenv {
816              label {PADSynth - Filter Envelope} open
817              xywh {250 130 275 70} box FLAT_BOX color 51 align 144
818              code0 {o->init(ENV_ADSR_FILTER, osc_i, location, "FilterEnvelope/");}
819              class EnvelopeUI
820            } {}
821            Fl_Group filterlfo {
822              label {Filter LFO     } open
823              xywh {250 200 230 70} box FLAT_BOX color 47 align 144
824              code0 {o->init(osc_i, location, "FilterLfo/");}
825              class LFOUI
826            } {}
827            Fl_Group filterui {
828              label {PADsynth - Filter} open
829              xywh {250 50 275 75} box FLAT_BOX color 50 align 144
830              code0 {o->init(location + "PFilter",
831              osc_i, location, "GlobalFilter/");}
832              class FilterUI
833            } {}
834          }
835        }
836      }
837      Fl_Button applybutton {
838        label {Apply Changes}
839        callback {osc_i->requestValue(location+"prepare");
840//MiddleWare::preparePadSynth(location.c_str(), pars);
841o->color(FL_GRAY);
842if (oscui!=NULL) {
843	oscui->applybutton->color(FL_GRAY);
844	oscui->applybutton->redraw();
845};
846if (resui!=NULL) {
847	resui->applybutton->color(FL_GRAY);
848	resui->applybutton->redraw();
849};}
850        xywh {200 400 135 25} box THIN_UP_BOX
851        code0 {o->color(FL_RED);}
852      }
853      Fl_Button {} {
854        label Close
855        callback {padnotewindow->hide();}
856        xywh {470 400 60 25} box THIN_UP_BOX
857      }
858      Fl_Button {} {
859        label C
860        callback {presetsui->copy(padnotewindow->loc());}
861        xywh {400 405 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
862      }
863      Fl_Button {} {
864        label P
865        callback {presetsui->paste(padnotewindow->loc(),this);}
866        xywh {430 405 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
867      }
868      Fl_Button {} {
869        label export
870        callback {char *filename;
871filename=fl_file_chooser("Export samples:","(*.wav)",NULL,0);
872if (filename==NULL) return;
873fl_filename_setext(filename,"");
874o->oscWrite("export2wav", "s", filename);}
875        tooltip {export samples as wav file} xywh {5 400 55 25} box THIN_UP_BOX color 51 labelsize 11 align 128
876        class Fl_Osc_Button
877      }
878    }
879  }
880  Function {refresh()} {open
881  } {
882    code {amplfo->refresh();
883freqlfo->refresh();
884filterlfo->refresh();
885
886ampenv->refresh();
887freqenv->refresh();
888filterenv->refresh();
889filterui->refresh();
890
891
892/* harmonic structure parametrs */
893
894resui->refresh();
895if (oscui) oscui->refresh();
896
897if (spectrummode->value()==0){
898   bwprofilegroup->activate();
899   bwdial->activate();
900   bwcents->activate();
901   hprofile->activate();
902   hprofile->color(51);
903   bwscale->activate();
904} else {
905   bwprofilegroup->deactivate();
906   bwdial->deactivate();
907   bwcents->deactivate();
908   hprofile->deactivate();
909   hprofile->color(48);
910   bwscale->activate();
911};
912
913hprofile->redraw();
914opui->update();
915
916osc->redraw();
917//MiddleWare::preparePadSynth(location.c_str(), pars);
918applybutton->color(FL_GRAY);
919applybutton->parent()->redraw();} {}
920  }
921  Function {~PADnoteUI()} {} {
922    code {
923delete apply_watcher;
924delete(oscui);
925delete(resui);
926
927
928padnotewindow->hide();
929delete padnotewindow;} {}
930  }
931  decl {OscilEditor *oscui;} {public local
932  }
933  decl {bool initialized;}{private local
934  }
935  decl {Fl_Oscilloscope *osc;} {public local
936  }
937  decl {ResonanceUI *resui;} {public local
938  }
939  decl {std::string location;} {private local
940  }
941  decl {Fl_Osc_Interface *osc_i;} {private local
942  }
943  decl {PADnoteHarmonicProfile *hpui;} {private local
944  }
945  decl {PADnoteOvertonePosition *opui;} {private local
946  }
947  decl {class Osc_IntModel *apply_watcher;} {private local
948  }
949}
950