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.

OscilGenUI.fl 30KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  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=127-(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();}
  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 {//oscil->useasbase();
  461. if (autoclearbutton->value()){
  462. for (int i=0;i<MAX_AD_HARMONICS;i++){
  463. h[i]->mag->value(64);
  464. h[i]->phase->value(64);
  465. };
  466. harmonicshiftcounter->value(0);
  467. h[0]->mag->value(0);
  468. wshbutton->value(0);
  469. wshbutton->do_callback();
  470. fltbutton->value(0);
  471. fltbutton->do_callback();
  472. sabutton->value(0);
  473. sabutton->do_callback();
  474. };
  475. osc->requestValue(loc+"prepare");
  476. basefuncdisplaygroup->redraw();
  477. redrawoscil();}
  478. tooltip {Use this Oscillator as base function} xywh {10 318 85 20} box THIN_UP_BOX labelfont 1 labelsize 11
  479. }
  480. Fl_Button {} {
  481. label Close
  482. callback {osceditUI->hide();}
  483. xywh {673 570 62 25} box THIN_UP_BOX
  484. }
  485. Fl_Button {} {
  486. label Clear
  487. callback {if (!fl_choice("Clear the harmonics settings?","No","Yes",NULL)) return;
  488. for (int i=0;i<MAX_AD_HARMONICS;i++){
  489. h[i]->mag->value(64);
  490. h[i]->phase->value(64);
  491. };
  492. h[0]->mag->value(0);
  493. //for (int i=0;i<MAX_AD_HARMONICS;i++){
  494. // if (oscil->Phmag[i]==64) h[i]->mag->selection_color(0);
  495. // else h[i]->mag->selection_color(222);
  496. //};
  497. //harmonics->redraw();
  498. osc->requestValue(loc+"prepare");
  499. redrawoscil();}
  500. xywh {675 510 55 15} box THIN_UP_BOX labelfont 1 labelsize 11
  501. }
  502. Fl_Group {} {
  503. xywh {140 313 150 30} box UP_FRAME
  504. } {
  505. Fl_Choice wshbutton {
  506. label {Wsh.}
  507. callback {basefuncdisplaygroup->redraw();
  508. redrawoscil();}
  509. tooltip {Waveshaping function} xywh {170 320 55 20} down_box BORDER_BOX labelsize 10 when 1 textsize 10
  510. code0 {o->init("Pwaveshapingfunction");}
  511. class Fl_Osc_Choice
  512. } {
  513. MenuItem {} {
  514. label None
  515. xywh {30 30 100 20} labelfont 1 labelsize 10
  516. }
  517. MenuItem {} {
  518. label Atan
  519. xywh {40 40 100 20} labelfont 1 labelsize 10
  520. }
  521. MenuItem {} {
  522. label Asym1
  523. xywh {50 50 100 20} labelfont 1 labelsize 10
  524. }
  525. MenuItem {} {
  526. label Pow
  527. xywh {60 60 100 20} labelfont 1 labelsize 10
  528. }
  529. MenuItem {} {
  530. label Sine
  531. xywh {70 70 100 20} labelfont 1 labelsize 10
  532. }
  533. MenuItem {} {
  534. label Qnts
  535. xywh {80 80 100 20} labelfont 1 labelsize 10
  536. }
  537. MenuItem {} {
  538. label Zigzg
  539. xywh {90 90 100 20} labelfont 1 labelsize 10
  540. }
  541. MenuItem {} {
  542. label Lmt
  543. xywh {100 100 100 20} labelfont 1 labelsize 10
  544. }
  545. MenuItem {} {
  546. label LmtU
  547. xywh {110 110 100 20} labelfont 1 labelsize 10
  548. }
  549. MenuItem {} {
  550. label LmtL
  551. xywh {120 120 100 20} labelfont 1 labelsize 10
  552. }
  553. MenuItem {} {
  554. label ILmt
  555. xywh {132 132 100 20} labelfont 1 labelsize 10
  556. }
  557. MenuItem {} {
  558. label Clip
  559. xywh {142 142 100 20} labelfont 1 labelsize 10
  560. }
  561. MenuItem {} {
  562. label Asym2
  563. xywh {90 90 100 20} labelfont 1 labelsize 10
  564. }
  565. MenuItem {} {
  566. label Pow2
  567. xywh {100 100 100 20} labelfont 1 labelsize 10
  568. }
  569. MenuItem {} {
  570. label Sgm
  571. xywh {95 95 100 20} labelfont 1 labelsize 10
  572. }
  573. }
  574. Fl_Dial wshpar {
  575. callback {redrawoscil();}
  576. tooltip {Waveshaping Parameter} xywh {265 318 20 20} minimum -64 maximum 63 step 1
  577. code0 {o->init("Pwaveshaping");}
  578. class Fl_Osc_Dial
  579. }
  580. Fl_Value_Output wsparval {
  581. xywh {233 321 25 15} labelsize 12 minimum -63 maximum 63 step 1
  582. }
  583. }
  584. Fl_Light_Button autoclearbutton {
  585. label {Clr.}
  586. 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
  587. }
  588. Fl_Group {} {
  589. xywh {290 313 155 30} box UP_FRAME
  590. } {
  591. Fl_Choice fltbutton {
  592. label Filter
  593. callback {redrawoscil();}
  594. tooltip {Oscillator's filter type} xywh {320 318 50 20} down_box BORDER_BOX labelsize 10 when 1 textsize 10
  595. code0 {o->init("Pfiltertype");}
  596. class Fl_Osc_Choice
  597. } {
  598. MenuItem {} {
  599. label None
  600. xywh {40 40 100 20} labelfont 1 labelsize 10
  601. }
  602. MenuItem {} {
  603. label LP1
  604. xywh {50 50 100 20} labelfont 1 labelsize 10
  605. }
  606. MenuItem {} {
  607. label HP1a
  608. xywh {60 60 100 20} labelfont 1 labelsize 10
  609. }
  610. MenuItem {} {
  611. label HP1b
  612. xywh {70 70 100 20} labelfont 1 labelsize 10
  613. }
  614. MenuItem {} {
  615. label BP1
  616. xywh {80 80 100 20} labelfont 1 labelsize 10
  617. }
  618. MenuItem {} {
  619. label BS1
  620. xywh {90 90 100 20} labelfont 1 labelsize 10
  621. }
  622. MenuItem {} {
  623. label LP2
  624. xywh {60 60 100 20} labelfont 1 labelsize 10
  625. }
  626. MenuItem {} {
  627. label HP2
  628. xywh {70 70 100 20} labelfont 1 labelsize 10
  629. }
  630. MenuItem {} {
  631. label BP2
  632. xywh {70 70 100 20} labelfont 1 labelsize 10
  633. }
  634. MenuItem {} {
  635. label BS2
  636. xywh {80 80 100 20} labelfont 1 labelsize 10
  637. }
  638. MenuItem {} {
  639. label Cos
  640. xywh {80 80 100 20} labelfont 1 labelsize 10
  641. }
  642. MenuItem {} {
  643. label Sin
  644. xywh {90 90 100 20} labelfont 1 labelsize 10
  645. }
  646. MenuItem {} {
  647. label LSh
  648. xywh {100 100 100 20} labelfont 1 labelsize 10
  649. }
  650. MenuItem {} {
  651. label S
  652. xywh {110 110 100 20} labelfont 1 labelsize 10
  653. }
  654. }
  655. Fl_Dial filtervalue1 {
  656. callback {redrawoscil();}
  657. tooltip {Oscillator's filter parameter1} xywh {372 318 20 20} maximum 127 step 1
  658. code0 {o->init("Pfilterpar1");}
  659. class Fl_Osc_Dial
  660. }
  661. Fl_Check_Button filterpref {
  662. label p
  663. callback {redrawoscil();}
  664. tooltip {Apply the filter before the waveshaping} xywh {420 318 20 20} down_box DOWN_BOX labelsize 10 align 24
  665. }
  666. Fl_Dial filtervalue2 {
  667. callback {redrawoscil();}
  668. tooltip {Oscillator's filter parameter2} xywh {395 318 20 20} maximum 127 step 1
  669. code0 {o->init("Pfilterpar2");}
  670. class Fl_Osc_Dial
  671. }
  672. }
  673. Fl_Group {} {
  674. xywh {595 313 135 30} box UP_FRAME
  675. } {
  676. Fl_Choice sabutton {
  677. label {Sp.adj.}
  678. callback {redrawoscil();}
  679. tooltip {Oscillator's spectrum adjust} xywh {635 318 60 20} down_box BORDER_BOX labelsize 10 when 1 textsize 10
  680. code0 {o->init("Psatype");}
  681. class Fl_Osc_Choice
  682. } {
  683. MenuItem {} {
  684. label None
  685. xywh {60 60 100 20} labelfont 1 labelsize 10
  686. }
  687. MenuItem {} {
  688. label Pow
  689. xywh {70 70 100 20} labelfont 1 labelsize 10
  690. }
  691. MenuItem {} {
  692. label ThrsD
  693. xywh {80 80 100 20} labelfont 1 labelsize 10
  694. }
  695. MenuItem {} {
  696. label ThrsU
  697. xywh {90 90 100 20} labelfont 1 labelsize 10
  698. }
  699. }
  700. Fl_Dial sadjpar {
  701. callback {redrawoscil();}
  702. tooltip {Oscillator's spectrum adjust parameter} xywh {700 318 20 20} maximum 127 step 1
  703. code0 {o->init("Psapar");}
  704. class Fl_Osc_Dial
  705. }
  706. }
  707. Fl_Group {} {
  708. xywh {670 345 65 65} box UP_FRAME
  709. } {
  710. Fl_Counter harmonicshiftcounter {
  711. label {Harmonic Shift}
  712. callback {redrawoscil();}
  713. code0 {o->init("Pharmonicshift");}
  714. xywh {675 370 55 15} type Simple labelsize 10 align 129 minimum -64 maximum 64 step 1 textfont 1 textsize 10
  715. class Fl_Osc_Counter
  716. }
  717. Fl_Check_Button harmonicshiftpre {
  718. label preH
  719. callback {redrawoscil();}
  720. code0 {o->init("Pharmonicshiftfirst");}
  721. tooltip {Apply the harmonic shift before the waveshaping and filtering} xywh {695 390 34 15} down_box DOWN_BOX labelsize 10 align 24
  722. class Fl_Osc_Check
  723. }
  724. Fl_Button {} {
  725. label R
  726. callback {//oscil->Pharmonicshift=0;
  727. harmonicshiftcounter->value(0);
  728. redrawoscil();}
  729. xywh {675 390 20 15} box THIN_UP_BOX labelfont 1 labelsize 10
  730. }
  731. }
  732. Fl_Group {} {
  733. xywh {670 415 65 90} box UP_FRAME
  734. } {
  735. Fl_Choice adhrtype {
  736. label {Adpt.Harm.}
  737. callback {redrawoscil();}
  738. tooltip {The type of the addaptive harmonics} xywh {675 430 55 15} down_box BORDER_BOX labelsize 10 align 129 when 3 textsize 10
  739. code0 {o->init("Padaptiveharmonics");}
  740. class Fl_Osc_Choice
  741. } {
  742. MenuItem {} {
  743. label OFF
  744. xywh {85 85 100 20} labelfont 1 labelsize 10
  745. }
  746. MenuItem {} {
  747. label ON
  748. xywh {95 95 100 20} labelfont 1 labelsize 10
  749. }
  750. MenuItem {} {
  751. label Square
  752. xywh {105 105 100 20} labelfont 1 labelsize 10
  753. }
  754. MenuItem {} {
  755. label 2xSub
  756. xywh {115 115 100 20} labelfont 1 labelsize 10
  757. }
  758. MenuItem {} {
  759. label 2xAdd
  760. xywh {125 125 100 20} labelfont 1 labelsize 10
  761. }
  762. MenuItem {} {
  763. label 3xSub
  764. xywh {125 125 100 20} labelfont 1 labelsize 10
  765. }
  766. MenuItem {} {
  767. label 3xAdd
  768. xywh {135 135 100 20} labelfont 1 labelsize 10
  769. }
  770. MenuItem {} {
  771. label 4xSub
  772. xywh {135 135 100 20} labelfont 1 labelsize 10
  773. }
  774. MenuItem {} {
  775. label 4xAdd
  776. xywh {145 145 100 20} labelfont 1 labelsize 10
  777. }
  778. }
  779. Fl_Dial adhrpow {
  780. label pow
  781. callback {redrawoscil();}
  782. tooltip {Adaptive harmonics power} xywh {705 465 25 25} labelsize 10 maximum 200 step 1
  783. code0 {o->init("Padaptiveharmonicspower");}
  784. class Fl_Osc_Dial
  785. }
  786. Fl_Dial adhrbf {
  787. label baseF
  788. callback {redrawoscil();}
  789. tooltip {Adaptive harmonics base frequency} xywh {675 465 25 25} labelsize 10 maximum 255 step 1
  790. code0 {o->init("Padaptiveharmonicsbasefreq");}
  791. class Fl_Osc_Dial
  792. }
  793. Fl_Slider adhrpar {
  794. code0 {o->init("Padaptiveharmonicspar");}
  795. callback {redrawoscil();}
  796. xywh {675 450 55 10} type {Horz Knob} box NO_BOX maximum 100 step 1 value 50
  797. class Fl_Osc_Slider
  798. }
  799. }
  800. Fl_Group {} {
  801. xywh {445 313 150 30} box UP_FRAME
  802. } {
  803. Fl_Choice modtype {
  804. label {Mod.}
  805. callback {redrawoscil();}
  806. tooltip modulation xywh {475 320 50 15} down_box BORDER_BOX labelsize 10 when 1 textsize 10
  807. code0 {o->init("Pmodulation");}
  808. class Fl_Osc_Choice
  809. } {
  810. MenuItem {} {
  811. label None
  812. xywh {65 65 100 20} labelfont 1 labelsize 10
  813. }
  814. MenuItem {} {
  815. label Rev
  816. xywh {75 75 100 20} labelfont 1 labelsize 10
  817. }
  818. MenuItem {} {
  819. label Sine
  820. xywh {85 85 100 20} labelfont 1 labelsize 10
  821. }
  822. MenuItem {} {
  823. label Pow
  824. xywh {95 95 100 20} labelfont 1 labelsize 10
  825. }
  826. }
  827. Fl_Dial modpar1 {
  828. callback {redrawoscil();}
  829. tooltip {Oscillator's modulation parameter 1} xywh {535 320 15 15} maximum 127 step 1
  830. code0 {o->init("Pmodulationpar1");}
  831. class Fl_Osc_Dial
  832. }
  833. Fl_Dial modpar2 {
  834. callback {redrawoscil();}
  835. tooltip {Oscillator's modulation parameter 2} xywh {555 320 15 15} maximum 127 step 1
  836. code0 {o->init("Pmodulationpar2");}
  837. class Fl_Osc_Dial
  838. }
  839. Fl_Dial modpar3 {
  840. callback {redrawoscil();}
  841. tooltip {Oscillator's modulation parameter 3} xywh {575 320 15 15} maximum 127 step 1
  842. code0 {o->init("Pmodulationpar3");}
  843. class Fl_Osc_Dial
  844. }
  845. }
  846. Fl_Button {} {
  847. label Sine
  848. callback {if (!fl_choice("Convert to SINE?","No","Yes",NULL)) return;
  849. osc->requestValue(loc+"convert2sine");
  850. redrawoscil();
  851. refresh();}
  852. xywh {675 530 55 15} box THIN_UP_BOX labelfont 1 labelsize 11
  853. }
  854. Fl_Button {} {
  855. label C
  856. callback {presetsui->copy(dummy->loc());}
  857. xywh {675 550 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  858. }
  859. Fl_Button {} {
  860. label P
  861. callback {presetsui->paste(dummy->loc(), this);}
  862. xywh {705 550 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  863. }
  864. Fl_Scroll _this_has_to_be_the_last {
  865. xywh {10 345 660 250} type HORIZONTAL box FLAT_BOX
  866. } {
  867. Fl_Pack harmonics {open
  868. xywh {15 350 650 225} type HORIZONTAL
  869. code0 {for (int i=0;i<MAX_AD_HARMONICS;i++){h[i]=new Oscilharmonic(0,0,20,o->h(),"");h[i]->init(i,oscildisplaygroup,loc,osc);}}
  870. } {}
  871. }
  872. }
  873. }
  874. }
  875. Function {OscilEditor(bool adnotep_, std::string loc_, Fl_Osc_Interface *osc_)} {open
  876. } {
  877. code { assert(osc_);
  878. assert(!loc_.empty());
  879. initialized = false;
  880. adnotep = adnotep_;
  881. osc = osc_;
  882. loc = loc_;
  883. oscilo = NULL;
  884. oscilo_base = NULL;
  885. oscils = NULL;
  886. oscils_base = NULL;
  887. osceditUI = NULL;
  888. dummy = NULL;
  889. applybutton = NULL;
  890. oscildisplaygroup = NULL;
  891. rndslider = NULL;
  892. hrndtype = NULL;
  893. magtype = NULL;
  894. basefuncdisplaygroup = NULL;
  895. bfslider = NULL;
  896. bftype = NULL;
  897. make_window();
  898. bftype->init("Pcurrentbasefunc");
  899. initialized = true;
  900. refresh();
  901. osceditUI->show();} {}
  902. }
  903. Function {~OscilEditor()} {open
  904. } {
  905. code {osceditUI->hide();
  906. for (int i=0; i<MAX_AD_HARMONICS; ++i)
  907. delete h[i];
  908. delete oscilo;
  909. delete oscilo_base;
  910. delete oscils;
  911. delete oscils_base;
  912. delete osceditUI;} {}
  913. }
  914. Function {refresh()} {} {
  915. code {magtype->update();
  916. for (int i=0;i<MAX_AD_HARMONICS;i++) h[i]->refresh();
  917. osc->requestValue(loc+"prepare");
  918. basefuncdisplaygroup->redraw();
  919. redrawoscil();} {}
  920. }
  921. Function {redrawoscil()} {open
  922. } {
  923. code {
  924. if(!initialized) //Must have been called during initialization
  925. return;
  926. //get data from backend
  927. osc->requestValue(loc+"prepare");
  928. oscilo->update();
  929. oscils->update();
  930. oscilo_base->update();
  931. oscils_base->update();} {}
  932. }
  933. decl {Oscilharmonic *h[MAX_AD_HARMONICS];} {private local
  934. }
  935. decl {std::string loc;} {private local
  936. }
  937. decl {Fl_Osc_Interface *osc;} {private local
  938. }
  939. decl {Fl_Oscilloscope *oscilo, *oscilo_base;} {private local
  940. }
  941. decl {Fl_OscilSpectrum *oscils, *oscils_base;} {private local
  942. }
  943. decl {bool adnotep;} {private local
  944. }
  945. decl {bool initialized;} {private local
  946. }
  947. }