Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1007 lines
31KB

  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0300
  3. header_name {.h}
  4. code_name {.cc}
  5. decl {//Copyright (c) 2002-2005 Nasca Octavian Paul} {private local
  6. }
  7. decl {//License: GNU GPL version 2 or later} {private local
  8. }
  9. decl {\#include "../Synth/OscilGen.h"} {public local
  10. }
  11. decl {\#include "../Misc/Util.h"} {public local
  12. }
  13. decl {\#include "ResonanceUI.h"} {public local
  14. }
  15. decl {\#include "Fl_Oscilloscope.h"} {public local
  16. }
  17. decl {\#include "Fl_OscilSpectrum.h"} {public local
  18. }
  19. decl {\#include "Fl_Osc_Interface.h"} {public local
  20. }
  21. decl {\#include <FL/Fl_Box.H>} {public local
  22. }
  23. decl {\#include <FL/Fl_Group.H>} {public local
  24. }
  25. decl {\#include <FL/Fl_Slider.H>} {public local
  26. }
  27. decl {\#include <math.h>} {private local
  28. }
  29. decl {\#include <stdio.h>} {private local
  30. }
  31. decl {\#include <stdlib.h>} {private local
  32. }
  33. decl {\#include <string.h>} {private local
  34. }
  35. decl {\#include "Fl_Osc_Pane.H"} {public local
  36. }
  37. decl {\#include "Fl_Osc_Dial.H"} {public local
  38. }
  39. decl {\#include "Fl_Osc_Choice.H"} {public local
  40. }
  41. decl {\#include "Fl_Osc_Counter.H"} {public local
  42. }
  43. decl {\#include "Fl_Osc_Slider.H"} {public local
  44. }
  45. decl {\#include "PresetsUI.h"} {public local
  46. }
  47. decl {\#include <FL/fl_draw.H>} {public local
  48. }
  49. class PSlider {: {public Fl_Slider, public Fl_Osc_Widget}
  50. } {
  51. Function {PSlider(int x,int y, int w, int h, const char *label=0):Fl_Slider(x,y,w,h,label)} {open
  52. } {
  53. code {phase=false;} {}
  54. }
  55. Function {handle(int event)} {open return_type int
  56. } {
  57. code {int X=x(),Y=y(),W=w(),H=h();
  58. if ((!Fl::event_buttons())|| (event==0)||(Fl::event_shift()==0)) return(Fl_Slider::handle(event));
  59. if (!Fl::event_inside(X,Y,W,H)) {
  60. if (event==FL_DRAG){
  61. Fl_Slider::handle(FL_RELEASE);
  62. Fl_Slider::handle(FL_LEAVE);
  63. deactivate();
  64. activate();
  65. return(1);
  66. }else{
  67. return(Fl_Slider::handle(event));
  68. };
  69. } else {
  70. //Fl_Slider::handle(FL_FOCUS);
  71. Fl_Slider::handle(FL_PUSH);
  72. };
  73. return(1);} {}
  74. }
  75. Function {OSC_value(char c)} {open return_type void
  76. } {
  77. code {if(phase)
  78. value(c);
  79. else
  80. value(127-c);} {}
  81. }
  82. decl {bool phase;} {public local
  83. }
  84. }
  85. class Oscilharmonic {: {public Fl_Group}
  86. } {
  87. Function {make_window()} {open private
  88. } {
  89. Fl_Window harmonic {open
  90. private xywh {467 756 100 225} type Double box NO_BOX
  91. class Fl_Osc_Group visible
  92. } {
  93. Fl_Slider mag {
  94. callback {int x=64;
  95. if (Fl::event_button3()) o->value(x);
  96. else x=128-(int)o->value();
  97. if (x==64) o->selection_color(0);
  98. else o->selection_color(222);
  99. o->osc->writeValue(o->loc+"magnitude"+to_s(n), (char)x);
  100. if (x==64) {
  101. o->osc->writeValue(o->loc+"phase"+to_s(n), (char)64);
  102. phase->value(64);
  103. }
  104. o->osc->requestValue(o->loc+"prepare");
  105. o->osc->requestValue(o->loc+"spectrum");
  106. o->osc->requestValue(o->loc+"waveform");
  107. display->redraw();}
  108. xywh {0 15 15 115} type {Vert Knob} box NO_BOX selection_color 222 maximum 127 step 1 value 64
  109. code0 {o->phase=false;//o->value(127-oscil->Phmag[n]);}
  110. code1 {//if (oscil->Phmag[n]==64) o->selection_color(0);}
  111. class PSlider
  112. }
  113. Fl_Slider phase {
  114. callback {int x=64;
  115. if (Fl::event_button3()) o->value(x);
  116. else x=(int)o->value();
  117. o->osc->writeValue(o->loc+"phase"+to_s(n), (char) x);
  118. o->osc->requestValue(o->loc+"prepare");
  119. o->osc->requestValue(o->loc+"spectrum");
  120. o->osc->requestValue(o->loc+"waveform");
  121. display->redraw();}
  122. xywh {0 135 15 75} type {Vert Knob} box NO_BOX selection_color 222 maximum 127 step 1 value 64
  123. code0 {o->phase=true;//o->value(oscil->Phphase[n]);}
  124. class PSlider
  125. }
  126. Fl_Box {} {
  127. xywh {15 70 5 5} box FLAT_BOX color 45
  128. }
  129. Fl_Box {} {
  130. xywh {15 170 5 5} box FLAT_BOX color 45
  131. }
  132. Fl_Box {} {
  133. label 01
  134. xywh {0 210 20 15} labelfont 1 labelsize 9 align 20
  135. code0 {char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));}
  136. }
  137. Fl_Box {} {
  138. label 01
  139. xywh {0 0 20 15} labelfont 1 labelsize 9 align 20
  140. code0 {char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));}
  141. }
  142. }
  143. }
  144. Function {Oscilharmonic(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
  145. code {n=0;
  146. display=NULL;} {}
  147. }
  148. Function {init(int n_,Fl_Group *display_, std::string loc_, Fl_Osc_Interface *osc_)} {open
  149. } {
  150. code {assert(osc_);
  151. assert(!loc_.empty());
  152. n=n_;
  153. display=display_;
  154. osc = osc_;
  155. loc = loc_;
  156. make_window();
  157. mag->osc = osc;
  158. mag->loc = loc;
  159. phase->osc = osc;
  160. phase->loc = loc;
  161. osc->createLink(loc+"magnitude"+to_s(n), mag);
  162. osc->createLink(loc+"phase"+to_s(n), phase);
  163. osc->requestValue(loc+"magnitude"+to_s(n));
  164. osc->requestValue(loc+"phase"+to_s(n));
  165. end();
  166. harmonic->show();} {}
  167. }
  168. Function {refresh()} {open
  169. } {
  170. code {osc->requestValue(loc+"magnitude"+to_s(n));//mag->value(127-oscil->Phmag[n]);
  171. osc->requestValue(loc+"phase"+to_s(n));//phase->value(oscil->Phphase[n]);
  172. if (mag->value()==64)
  173. mag->selection_color(0);
  174. else
  175. mag->selection_color(222);} {}
  176. }
  177. Function {~Oscilharmonic()} {open
  178. } {
  179. code {osc->removeLink(loc+"magnitude"+to_s(n), mag);
  180. osc->removeLink(loc+"phase"+to_s(n), phase);
  181. harmonic->hide();
  182. delete harmonic;} {}
  183. }
  184. decl {Fl_Group *display;} {private local
  185. }
  186. decl {int n;} {private local
  187. }
  188. decl {Fl_Osc_Interface *osc;} {private local
  189. }
  190. decl {std::string loc;} {private local
  191. }
  192. }
  193. class OscilEditor {open : {public PresetsUI_}
  194. } {
  195. Function {make_window()} {open
  196. } {
  197. Fl_Window osceditUI {
  198. label {ADsynth Oscillator Editor} open
  199. xywh {52 100 735 595} type Double
  200. code0 {(void)o;//if (oscil->ADvsPAD) o->label("PADsynth Harmonic Content Editor");} visible
  201. } {
  202. Fl_Group dummy {open
  203. xywh {0 0 735 595} box FLAT_BOX
  204. class Fl_Osc_Group
  205. } {
  206. Fl_Button applybutton {
  207. label Apply
  208. callback {//applybutton->color(FL_GRAY);
  209. //applybutton->redraw();
  210. //if (cbapplywidget!=NULL) {
  211. // cbapplywidget->do_callback();
  212. // cbapplywidget->color(FL_GRAY);
  213. // cbapplywidget->redraw();
  214. //};}
  215. xywh {305 285 60 20} box THIN_UP_BOX labelfont 1
  216. code0 {if(adnotep) o->hide();}
  217. code1 {dummy->base = loc;}
  218. code2 {dummy->osc = osc;}
  219. }
  220. Fl_Group oscildisplaygroup {open
  221. xywh {10 10 360 300} box UP_FRAME
  222. } {
  223. Fl_Group {} {open
  224. xywh {15 90 350 190} box THIN_DOWN_BOX color 32 selection_color 71 labelcolor 179
  225. code0 {oscilo=new Fl_Oscilloscope(o->x(),o->y(),o->w(),o->h(),"");}
  226. code1 {oscilo->parent(o);oscilo->init(false);}
  227. } {}
  228. Fl_Box {} {
  229. label Oscillator
  230. xywh {125 15 110 20} labelfont 1
  231. }
  232. Fl_Value_Slider rndslider {
  233. label rnd
  234. callback {(void)o;//oscil->Prand=(int)o->value()+64;
  235. oscildisplaygroup->redraw();}
  236. tooltip {Oscilator Phase Randomness: smaller than 0 is "group", larger than 0 is for each harmonic} xywh {145 290 100 10} type {Horz Knob} box NO_BOX labelsize 10 align 5 minimum -64 maximum 63 step 1
  237. code0 {(void)o;//if (oscil->ADvsPAD) o->hide();}
  238. }
  239. Fl_Group {} {open
  240. xywh {15 35 350 50} box THIN_DOWN_BOX color 32 selection_color 218 labelcolor 63
  241. code0 {oscils=new Fl_OscilSpectrum(o->x(),o->y(),o->w(),o->h(),"");}
  242. code1 {oscils->parent(o);oscils->init(false);}
  243. } {}
  244. Fl_Group {} {open
  245. xywh {251 282 115 25} box UP_FRAME
  246. code0 {if (!adnotep) o->hide();}
  247. } {
  248. Fl_Choice hrndtype {
  249. label {H.rnd}
  250. tooltip {Harmonic Amplitude Randomness} xywh {286 287 50 15} down_box BORDER_BOX labelsize 10 textsize 10
  251. code0 {o->init("Pamprandtype");}
  252. class Fl_Osc_Choice
  253. } {
  254. MenuItem {} {
  255. label None
  256. xywh {65 65 100 20} labelfont 1 labelsize 10
  257. }
  258. MenuItem {} {
  259. label Pow
  260. xywh {75 75 100 20} labelfont 1 labelsize 10
  261. }
  262. MenuItem {} {
  263. label Sin
  264. xywh {85 85 100 20} labelfont 1 labelsize 10
  265. }
  266. }
  267. Fl_Dial hrnddial {
  268. tooltip {Oscillator's spectrum adjust parameter} xywh {345 285 18 18} maximum 127 step 1
  269. code0 {o->init("Pamprandpower");}
  270. class Fl_Osc_Dial
  271. }
  272. }
  273. Fl_Choice magtype {
  274. label {Mag.Type}
  275. callback {redrawoscil();}
  276. xywh {75 285 65 20} down_box BORDER_BOX labelsize 11 when 1 textsize 11
  277. code0 {o->init("Phmagtype");}
  278. class Fl_Osc_Choice
  279. } {
  280. MenuItem {} {
  281. label Linear
  282. xywh {10 10 100 20} labelfont 1 labelsize 11
  283. }
  284. MenuItem {} {
  285. label {-40dB}
  286. xywh {20 20 100 20} labelfont 1 labelsize 11
  287. }
  288. MenuItem {} {
  289. label {-60dB}
  290. xywh {30 30 100 20} labelfont 1 labelsize 11
  291. }
  292. MenuItem {} {
  293. label {-80dB}
  294. xywh {40 40 100 20} labelfont 1 labelsize 11
  295. }
  296. MenuItem {} {
  297. label {-100dB}
  298. xywh {50 50 100 20} labelfont 1 labelsize 11
  299. }
  300. }
  301. }
  302. Fl_Group basefuncdisplaygroup {open
  303. xywh {370 10 360 300} box UP_FRAME
  304. code0 {o->base = loc;}
  305. code1 {o->osc = osc;}
  306. code2 {assert(osc);}
  307. class Fl_Osc_Group
  308. } {
  309. Fl_Group {} {
  310. xywh {375 90 350 190} box THIN_DOWN_BOX color 32 selection_color 71 labelcolor 179
  311. code0 {oscilo_base=new Fl_Oscilloscope(o->x(),o->y(),o->w(),o->h(),"");}
  312. code1 {oscilo_base->parent(o);oscilo_base->init(true);}
  313. } {}
  314. Fl_Dial bfslider {
  315. callback {redrawoscil(); bfparval->value(o->value());}
  316. tooltip {Base Function Parameter} xywh {525 285 20 20} minimum -64 maximum 63 step 1
  317. code0 {o->init("Pbasefuncpar");}
  318. class Fl_Osc_Dial
  319. }
  320. Fl_Choice bftype {
  321. label {Base.F..}
  322. callback {basefuncdisplaygroup->redraw();
  323. redrawoscil();
  324. if(!basefuncmodulation)
  325. return;
  326. if(o->value()==0||o->value()==127) basefuncmodulation->deactivate();
  327. else basefuncmodulation->activate();}
  328. xywh {375 290 90 15} down_box BORDER_BOX labelsize 10 align 5 when 1 textsize 11
  329. class Fl_Osc_Choice
  330. } {
  331. MenuItem {} {
  332. label Sine
  333. xywh {15 15 100 20} labelfont 1 labelsize 11
  334. }
  335. MenuItem {} {
  336. label Triangle
  337. xywh {25 25 100 20} labelfont 1 labelsize 11
  338. }
  339. MenuItem {} {
  340. label Pulse
  341. xywh {35 35 100 20} labelfont 1 labelsize 11
  342. }
  343. MenuItem {} {
  344. label Saw
  345. xywh {45 45 100 20} labelfont 1 labelsize 11
  346. }
  347. MenuItem {} {
  348. label Power
  349. xywh {55 55 100 20} labelfont 1 labelsize 11
  350. }
  351. MenuItem {} {
  352. label Gauss
  353. xywh {55 55 100 20} labelfont 1 labelsize 11
  354. }
  355. MenuItem {} {
  356. label Diode
  357. xywh {65 65 100 20} labelfont 1 labelsize 11
  358. }
  359. MenuItem {} {
  360. label AbsSine
  361. xywh {75 75 100 20} labelfont 1 labelsize 11
  362. }
  363. MenuItem {} {
  364. label PulseSine
  365. xywh {85 85 100 20} labelfont 1 labelsize 11
  366. }
  367. MenuItem {} {
  368. label StrchSine
  369. xywh {95 95 100 20} labelfont 1 labelsize 11
  370. }
  371. MenuItem {} {
  372. label Chirp
  373. xywh {105 105 100 20} labelfont 1 labelsize 11
  374. }
  375. MenuItem {} {
  376. label AbsStrSine
  377. xywh {107 107 100 20} labelfont 1 labelsize 11
  378. }
  379. MenuItem {} {
  380. label Chebyshev
  381. xywh {117 117 100 20} labelfont 1 labelsize 11
  382. }
  383. MenuItem {} {
  384. label Sqr
  385. xywh {127 127 100 20} labelfont 1 labelsize 11
  386. }
  387. MenuItem {} {
  388. label Spike
  389. xywh {127 127 100 20} labelfont 1 labelsize 11
  390. }
  391. MenuItem {} {
  392. label Circle
  393. xywh {127 127 100 20} labelfont 1 labelsize 11
  394. }
  395. }
  396. Fl_Box {} {
  397. label {Base Func.}
  398. xywh {485 15 110 20} labelfont 1
  399. }
  400. Fl_Group {} {open
  401. xywh {375 35 350 50} box THIN_DOWN_BOX color 32 selection_color 218 labelcolor 63
  402. code0 {oscils_base=new Fl_OscilSpectrum (o->x(),o->y(),o->w(),o->h(),"");}
  403. code1 {oscils_base->parent(o);oscils_base->init(true);}
  404. } {}
  405. Fl_Value_Output bfparval {
  406. label {Par.}
  407. xywh {495 290 25 15} labelsize 12 minimum -63 maximum 63 step 1
  408. }
  409. Fl_Group basefuncmodulation {open
  410. xywh {555 281 169 25} box UP_FRAME
  411. code0 {}
  412. } {
  413. Fl_Choice bfmodtype {
  414. label {B.F.Mod.}
  415. callback {basefuncdisplaygroup->redraw();
  416. redrawoscil();}
  417. tooltip {Base function modulation} xywh {604 286 50 15} down_box BORDER_BOX labelsize 10 when 1 textsize 10
  418. code0 {o->init("Pbasefuncmodulation");}
  419. class Fl_Osc_Choice
  420. } {
  421. MenuItem {} {
  422. label None
  423. xywh {55 55 100 20} labelfont 1 labelsize 10
  424. }
  425. MenuItem {} {
  426. label Rev
  427. xywh {65 65 100 20} labelfont 1 labelsize 10
  428. }
  429. MenuItem {} {
  430. label Sine
  431. xywh {75 75 100 20} labelfont 1 labelsize 10
  432. }
  433. MenuItem {} {
  434. label Pow
  435. xywh {85 85 100 20} labelfont 1 labelsize 10
  436. }
  437. }
  438. Fl_Dial bfmodpar1 {
  439. callback {redrawoscil();}
  440. tooltip {Oscillator's modulation parameter 1} xywh {664 286 15 15} maximum 127 step 1
  441. code0 {o->init("Pbasefuncmodulationpar1");}
  442. class Fl_Osc_Dial
  443. }
  444. Fl_Dial bfmodpar2 {
  445. callback {redrawoscil();}
  446. tooltip {Oscillator's modulation parameter 2} xywh {684 286 15 15} maximum 127 step 1
  447. code0 {o->init("Pbasefuncmodulationpar2");}
  448. class Fl_Osc_Dial
  449. }
  450. Fl_Dial bfmodpar3 {
  451. callback {redrawoscil();} selected
  452. tooltip {Oscillator's modulation parameter 3} xywh {704 286 15 15} maximum 127 step 1
  453. code0 {o->init("Pbasefuncmodulationpar3");}
  454. class Fl_Osc_Dial
  455. }
  456. }
  457. }
  458. Fl_Button {} {
  459. label {Use as base}
  460. callback {osc->requestValue(loc+"use-as-base");
  461. if (autoclearbutton->value()){
  462. for (int i=0;i<(MAX_AD_HARMONICS - 1);i++){
  463. h[i]->mag->value(64);
  464. h[i]->mag->do_callback();
  465. h[i]->phase->value(64);
  466. h[i]->phase->do_callback();
  467. };
  468. harmonicshiftcounter->value(0);
  469. h[0]->mag->value(0);
  470. h[0]->mag->do_callback();
  471. wshbutton->value(0);
  472. wshbutton->do_callback();
  473. fltbutton->value(0);
  474. fltbutton->do_callback();
  475. sabutton->value(0);
  476. sabutton->do_callback();
  477. };
  478. osc->requestValue(loc+"prepare");
  479. basefuncdisplaygroup->redraw();
  480. redrawoscil();}
  481. tooltip {Use this Oscillator as base function} xywh {10 318 85 20} box THIN_UP_BOX labelfont 1 labelsize 11
  482. }
  483. Fl_Button {} {
  484. label Close
  485. callback {osceditUI->hide();}
  486. xywh {673 570 62 25} box THIN_UP_BOX
  487. }
  488. Fl_Button {} {
  489. label Clear
  490. callback {if (!fl_choice("Clear the harmonics settings?","No","Yes",NULL)) return;
  491. for (int i=0;i<(MAX_AD_HARMONICS - 1);i++){
  492. h[i]->mag->value(64);
  493. h[i]->mag->do_callback();
  494. h[i]->phase->value(64);
  495. h[i]->phase->do_callback();
  496. };
  497. h[0]->mag->value(0);
  498. h[0]->mag->do_callback();
  499. //for (int i=0;i<(MAX_AD_HARMONICS - 1);i++){
  500. // if (oscil->Phmag[i]==64) h[i]->mag->selection_color(0);
  501. // else h[i]->mag->selection_color(222);
  502. //};
  503. //harmonics->redraw();
  504. osc->requestValue(loc+"prepare");
  505. redrawoscil();}
  506. xywh {675 510 55 15} box THIN_UP_BOX labelfont 1 labelsize 11
  507. }
  508. Fl_Group {} {
  509. xywh {140 313 150 30} box UP_FRAME
  510. } {
  511. Fl_Choice wshbutton {
  512. label {Wsh.}
  513. callback {basefuncdisplaygroup->redraw();
  514. redrawoscil();}
  515. tooltip {Waveshaping function} xywh {170 320 55 20} down_box BORDER_BOX labelsize 10 when 1 textsize 10
  516. code0 {o->init("Pwaveshapingfunction");}
  517. class Fl_Osc_Choice
  518. } {
  519. MenuItem {} {
  520. label None
  521. xywh {30 30 100 20} labelfont 1 labelsize 10
  522. }
  523. MenuItem {} {
  524. label Atan
  525. xywh {40 40 100 20} labelfont 1 labelsize 10
  526. }
  527. MenuItem {} {
  528. label Asym1
  529. xywh {50 50 100 20} labelfont 1 labelsize 10
  530. }
  531. MenuItem {} {
  532. label Pow
  533. xywh {60 60 100 20} labelfont 1 labelsize 10
  534. }
  535. MenuItem {} {
  536. label Sine
  537. xywh {70 70 100 20} labelfont 1 labelsize 10
  538. }
  539. MenuItem {} {
  540. label Qnts
  541. xywh {80 80 100 20} labelfont 1 labelsize 10
  542. }
  543. MenuItem {} {
  544. label Zigzg
  545. xywh {90 90 100 20} labelfont 1 labelsize 10
  546. }
  547. MenuItem {} {
  548. label Lmt
  549. xywh {100 100 100 20} labelfont 1 labelsize 10
  550. }
  551. MenuItem {} {
  552. label LmtU
  553. xywh {110 110 100 20} labelfont 1 labelsize 10
  554. }
  555. MenuItem {} {
  556. label LmtL
  557. xywh {120 120 100 20} labelfont 1 labelsize 10
  558. }
  559. MenuItem {} {
  560. label ILmt
  561. xywh {132 132 100 20} labelfont 1 labelsize 10
  562. }
  563. MenuItem {} {
  564. label Clip
  565. xywh {142 142 100 20} labelfont 1 labelsize 10
  566. }
  567. MenuItem {} {
  568. label Asym2
  569. xywh {90 90 100 20} labelfont 1 labelsize 10
  570. }
  571. MenuItem {} {
  572. label Pow2
  573. xywh {100 100 100 20} labelfont 1 labelsize 10
  574. }
  575. MenuItem {} {
  576. label Sgm
  577. xywh {95 95 100 20} labelfont 1 labelsize 10
  578. }
  579. }
  580. Fl_Dial wshpar {
  581. callback {redrawoscil(); wsparval->value(o->value());}
  582. tooltip {Waveshaping Parameter} xywh {265 318 20 20} minimum -64 maximum 63 step 1
  583. code0 {o->init("Pwaveshaping");}
  584. class Fl_Osc_Dial
  585. }
  586. Fl_Value_Output wsparval {
  587. xywh {233 321 25 15} labelsize 12 minimum -63 maximum 63 step 1
  588. }
  589. }
  590. Fl_Light_Button autoclearbutton {
  591. label {Clr.}
  592. tooltip {Auto clear when using the oscillator as base function} xywh {100 318 35 20} box THIN_UP_BOX value 1 labelfont 1 labelsize 10
  593. }
  594. Fl_Group {} {
  595. xywh {290 313 155 30} box UP_FRAME
  596. } {
  597. Fl_Choice fltbutton {
  598. label Filter
  599. callback {redrawoscil();}
  600. tooltip {Oscillator's filter type} xywh {320 318 50 20} down_box BORDER_BOX labelsize 10 when 1 textsize 10
  601. code0 {o->init("Pfiltertype");}
  602. class Fl_Osc_Choice
  603. } {
  604. MenuItem {} {
  605. label None
  606. xywh {40 40 100 20} labelfont 1 labelsize 10
  607. }
  608. MenuItem {} {
  609. label LP1
  610. xywh {50 50 100 20} labelfont 1 labelsize 10
  611. }
  612. MenuItem {} {
  613. label HP1a
  614. xywh {60 60 100 20} labelfont 1 labelsize 10
  615. }
  616. MenuItem {} {
  617. label HP1b
  618. xywh {70 70 100 20} labelfont 1 labelsize 10
  619. }
  620. MenuItem {} {
  621. label BP1
  622. xywh {80 80 100 20} labelfont 1 labelsize 10
  623. }
  624. MenuItem {} {
  625. label BS1
  626. xywh {90 90 100 20} labelfont 1 labelsize 10
  627. }
  628. MenuItem {} {
  629. label LP2
  630. xywh {60 60 100 20} labelfont 1 labelsize 10
  631. }
  632. MenuItem {} {
  633. label HP2
  634. xywh {70 70 100 20} labelfont 1 labelsize 10
  635. }
  636. MenuItem {} {
  637. label BP2
  638. xywh {70 70 100 20} labelfont 1 labelsize 10
  639. }
  640. MenuItem {} {
  641. label BS2
  642. xywh {80 80 100 20} labelfont 1 labelsize 10
  643. }
  644. MenuItem {} {
  645. label Cos
  646. xywh {80 80 100 20} labelfont 1 labelsize 10
  647. }
  648. MenuItem {} {
  649. label Sin
  650. xywh {90 90 100 20} labelfont 1 labelsize 10
  651. }
  652. MenuItem {} {
  653. label LSh
  654. xywh {100 100 100 20} labelfont 1 labelsize 10
  655. }
  656. MenuItem {} {
  657. label S
  658. xywh {110 110 100 20} labelfont 1 labelsize 10
  659. }
  660. }
  661. Fl_Dial filtervalue1 {
  662. callback {redrawoscil();}
  663. tooltip {Oscillator's filter parameter1} xywh {372 318 20 20} maximum 127 step 1
  664. code0 {o->init("Pfilterpar1");}
  665. class Fl_Osc_Dial
  666. }
  667. Fl_Check_Button filterpref {
  668. label p
  669. callback {redrawoscil();}
  670. tooltip {Apply the filter before the waveshaping} xywh {420 318 20 20} down_box DOWN_BOX labelsize 10 align 24
  671. }
  672. Fl_Dial filtervalue2 {
  673. callback {redrawoscil();}
  674. tooltip {Oscillator's filter parameter2} xywh {395 318 20 20} maximum 127 step 1
  675. code0 {o->init("Pfilterpar2");}
  676. class Fl_Osc_Dial
  677. }
  678. }
  679. Fl_Group {} {
  680. xywh {595 313 135 30} box UP_FRAME
  681. } {
  682. Fl_Choice sabutton {
  683. label {Sp.adj.}
  684. callback {redrawoscil();}
  685. tooltip {Oscillator's spectrum adjust} xywh {635 318 60 20} down_box BORDER_BOX labelsize 10 when 1 textsize 10
  686. code0 {o->init("Psatype");}
  687. class Fl_Osc_Choice
  688. } {
  689. MenuItem {} {
  690. label None
  691. xywh {60 60 100 20} labelfont 1 labelsize 10
  692. }
  693. MenuItem {} {
  694. label Pow
  695. xywh {70 70 100 20} labelfont 1 labelsize 10
  696. }
  697. MenuItem {} {
  698. label ThrsD
  699. xywh {80 80 100 20} labelfont 1 labelsize 10
  700. }
  701. MenuItem {} {
  702. label ThrsU
  703. xywh {90 90 100 20} labelfont 1 labelsize 10
  704. }
  705. }
  706. Fl_Dial sadjpar {
  707. callback {redrawoscil();}
  708. tooltip {Oscillator's spectrum adjust parameter} xywh {700 318 20 20} maximum 127 step 1
  709. code0 {o->init("Psapar");}
  710. class Fl_Osc_Dial
  711. }
  712. }
  713. Fl_Group {} {
  714. xywh {670 345 65 65} box UP_FRAME
  715. } {
  716. Fl_Counter harmonicshiftcounter {
  717. label {Harmonic Shift}
  718. callback {redrawoscil();}
  719. code0 {o->init("Pharmonicshift");}
  720. xywh {675 370 55 15} type Simple labelsize 10 align 129 minimum -64 maximum 64 step 1 textfont 1 textsize 10
  721. class Fl_Osc_Counter
  722. }
  723. Fl_Check_Button harmonicshiftpre {
  724. label preH
  725. callback {redrawoscil();}
  726. code0 {o->init("Pharmonicshiftfirst");}
  727. tooltip {Apply the harmonic shift before the waveshaping and filtering} xywh {695 390 34 15} down_box DOWN_BOX labelsize 10 align 24
  728. class Fl_Osc_Check
  729. }
  730. Fl_Button {} {
  731. label R
  732. callback {//oscil->Pharmonicshift=0;
  733. harmonicshiftcounter->value(0);
  734. redrawoscil();}
  735. xywh {675 390 20 15} box THIN_UP_BOX labelfont 1 labelsize 10
  736. }
  737. }
  738. Fl_Group {} {
  739. xywh {670 415 65 90} box UP_FRAME
  740. } {
  741. Fl_Choice adhrtype {
  742. label {Adpt.Harm.}
  743. callback {redrawoscil();}
  744. tooltip {The type of the addaptive harmonics} xywh {675 430 55 15} down_box BORDER_BOX labelsize 10 align 129 when 3 textsize 10
  745. code0 {o->init("Padaptiveharmonics");}
  746. class Fl_Osc_Choice
  747. } {
  748. MenuItem {} {
  749. label OFF
  750. xywh {85 85 100 20} labelfont 1 labelsize 10
  751. }
  752. MenuItem {} {
  753. label ON
  754. xywh {95 95 100 20} labelfont 1 labelsize 10
  755. }
  756. MenuItem {} {
  757. label Square
  758. xywh {105 105 100 20} labelfont 1 labelsize 10
  759. }
  760. MenuItem {} {
  761. label 2xSub
  762. xywh {115 115 100 20} labelfont 1 labelsize 10
  763. }
  764. MenuItem {} {
  765. label 2xAdd
  766. xywh {125 125 100 20} labelfont 1 labelsize 10
  767. }
  768. MenuItem {} {
  769. label 3xSub
  770. xywh {125 125 100 20} labelfont 1 labelsize 10
  771. }
  772. MenuItem {} {
  773. label 3xAdd
  774. xywh {135 135 100 20} labelfont 1 labelsize 10
  775. }
  776. MenuItem {} {
  777. label 4xSub
  778. xywh {135 135 100 20} labelfont 1 labelsize 10
  779. }
  780. MenuItem {} {
  781. label 4xAdd
  782. xywh {145 145 100 20} labelfont 1 labelsize 10
  783. }
  784. }
  785. Fl_Dial adhrpow {
  786. label pow
  787. callback {redrawoscil();}
  788. tooltip {Adaptive harmonics power} xywh {705 465 25 25} labelsize 10 maximum 200 step 1
  789. code0 {o->init("Padaptiveharmonicspower");}
  790. class Fl_Osc_Dial
  791. }
  792. Fl_Dial adhrbf {
  793. label baseF
  794. callback {redrawoscil();}
  795. tooltip {Adaptive harmonics base frequency} xywh {675 465 25 25} labelsize 10 maximum 255 step 1
  796. code0 {o->init("Padaptiveharmonicsbasefreq");}
  797. class Fl_Osc_Dial
  798. }
  799. Fl_Slider adhrpar {
  800. code0 {o->init("Padaptiveharmonicspar");}
  801. callback {redrawoscil();}
  802. xywh {675 450 55 10} type {Horz Knob} box NO_BOX maximum 100 step 1 value 50
  803. class Fl_Osc_Slider
  804. }
  805. }
  806. Fl_Group {} {
  807. xywh {445 313 150 30} box UP_FRAME
  808. } {
  809. Fl_Choice modtype {
  810. label {Mod.}
  811. callback {redrawoscil();}
  812. tooltip modulation xywh {475 320 50 15} down_box BORDER_BOX labelsize 10 when 1 textsize 10
  813. code0 {o->init("Pmodulation");}
  814. class Fl_Osc_Choice
  815. } {
  816. MenuItem {} {
  817. label None
  818. xywh {65 65 100 20} labelfont 1 labelsize 10
  819. }
  820. MenuItem {} {
  821. label Rev
  822. xywh {75 75 100 20} labelfont 1 labelsize 10
  823. }
  824. MenuItem {} {
  825. label Sine
  826. xywh {85 85 100 20} labelfont 1 labelsize 10
  827. }
  828. MenuItem {} {
  829. label Pow
  830. xywh {95 95 100 20} labelfont 1 labelsize 10
  831. }
  832. }
  833. Fl_Dial modpar1 {
  834. callback {redrawoscil();}
  835. tooltip {Oscillator's modulation parameter 1} xywh {535 320 15 15} maximum 127 step 1
  836. code0 {o->init("Pmodulationpar1");}
  837. class Fl_Osc_Dial
  838. }
  839. Fl_Dial modpar2 {
  840. callback {redrawoscil();}
  841. tooltip {Oscillator's modulation parameter 2} xywh {555 320 15 15} maximum 127 step 1
  842. code0 {o->init("Pmodulationpar2");}
  843. class Fl_Osc_Dial
  844. }
  845. Fl_Dial modpar3 {
  846. callback {redrawoscil();}
  847. tooltip {Oscillator's modulation parameter 3} xywh {575 320 15 15} maximum 127 step 1
  848. code0 {o->init("Pmodulationpar3");}
  849. class Fl_Osc_Dial
  850. }
  851. }
  852. Fl_Button {} {
  853. label Sine
  854. callback {if (!fl_choice("Convert to SINE?","No","Yes",NULL)) return;
  855. osc->requestValue(loc+"convert2sine");
  856. redrawoscil();
  857. refresh();}
  858. xywh {675 530 55 15} box THIN_UP_BOX labelfont 1 labelsize 11
  859. }
  860. Fl_Button {} {
  861. label C
  862. callback {presetsui->copy(dummy->loc());}
  863. xywh {675 550 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  864. }
  865. Fl_Button {} {
  866. label P
  867. callback {presetsui->paste(dummy->loc(), this);}
  868. xywh {705 550 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  869. }
  870. Fl_Scroll _this_has_to_be_the_last {
  871. xywh {10 345 660 250} type HORIZONTAL box FLAT_BOX
  872. } {
  873. Fl_Pack harmonics {open
  874. xywh {15 350 650 225} type HORIZONTAL
  875. code0 {for (int i=0;i<(MAX_AD_HARMONICS - 1);i++){h[i]=new Oscilharmonic(0,0,20,o->h(),"");h[i]->init(i,oscildisplaygroup,loc,osc);}}
  876. } {}
  877. }
  878. }
  879. }
  880. }
  881. Function {OscilEditor(bool adnotep_, std::string loc_, Fl_Osc_Interface *osc_)} {open
  882. } {
  883. code { assert(osc_);
  884. assert(!loc_.empty());
  885. initialized = false;
  886. adnotep = adnotep_;
  887. osc = osc_;
  888. loc = loc_;
  889. oscilo = NULL;
  890. oscilo_base = NULL;
  891. oscils = NULL;
  892. oscils_base = NULL;
  893. osceditUI = NULL;
  894. dummy = NULL;
  895. applybutton = NULL;
  896. oscildisplaygroup = NULL;
  897. rndslider = NULL;
  898. hrndtype = NULL;
  899. magtype = NULL;
  900. basefuncdisplaygroup = NULL;
  901. bfslider = NULL;
  902. bftype = NULL;
  903. make_window();
  904. bftype->init("Pcurrentbasefunc");
  905. initialized = true;
  906. refresh();
  907. osceditUI->show();} {}
  908. }
  909. Function {~OscilEditor()} {open
  910. } {
  911. code {osceditUI->hide();
  912. for (int i=0; i<(MAX_AD_HARMONICS - 1); ++i)
  913. delete h[i];
  914. delete oscilo;
  915. delete oscilo_base;
  916. delete oscils;
  917. delete oscils_base;
  918. delete osceditUI;} {}
  919. }
  920. Function {refresh()} {} {
  921. code {magtype->update();
  922. for (int i=0;i<(MAX_AD_HARMONICS - 1);i++) h[i]->refresh();
  923. osc->requestValue(loc+"prepare");
  924. basefuncdisplaygroup->redraw();
  925. redrawoscil();} {}
  926. }
  927. Function {redrawoscil()} {open
  928. } {
  929. code {
  930. if(!initialized) //Must have been called during initialization
  931. return;
  932. //get data from backend
  933. osc->requestValue(loc+"prepare");
  934. oscilo->update();
  935. oscils->update();
  936. oscilo_base->update();
  937. oscils_base->update();} {}
  938. }
  939. decl {Oscilharmonic *h[(MAX_AD_HARMONICS - 1)];} {private local
  940. }
  941. decl {std::string loc;} {private local
  942. }
  943. decl {Fl_Osc_Interface *osc;} {private local
  944. }
  945. decl {Fl_Oscilloscope *oscilo, *oscilo_base;} {private local
  946. }
  947. decl {Fl_OscilSpectrum *oscils, *oscils_base;} {private local
  948. }
  949. decl {bool adnotep;} {private local
  950. }
  951. decl {bool initialized;} {private local
  952. }
  953. }