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.

506 lines
17KB

  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0302
  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 <stdlib.h>} {public local
  10. }
  11. decl {\#include <stdio.h>} {public local
  12. }
  13. decl {\#include <string.h>} {public local
  14. }
  15. decl {\#include "../globals.h"} {public local
  16. }
  17. decl {\#include "Fl_Osc_VSlider.H"} {public local
  18. }
  19. decl {\#include "Fl_Osc_TSlider.H"} {public local
  20. }
  21. decl {\#include "Fl_Osc_Dial.H"} {public local
  22. }
  23. decl {\#include "EnvelopeUI.h"} {public local
  24. }
  25. decl {\#include "FilterUI.h"} {public local
  26. }
  27. decl {\#include "../Misc/Util.h"} {public local
  28. }
  29. decl {\#include "../Params/SUBnoteParameters.h"} {public local
  30. }
  31. decl {\#include "PresetsUI.h"} {public local
  32. }
  33. class SUBSlider {: {public Fl_Osc_TSlider}
  34. } {
  35. Function {SUBSlider(int x,int y, int w, int h, const char *label=0)
  36. :Fl_Osc_TSlider(x,y,w,h,label)} {open
  37. } { code {} {}}
  38. Function {OSC_value(char c)} {open return_type void
  39. } { code {
  40. value(127-c);
  41. selection_color(value() == reset_value ? 0 : 222);
  42. } {} }
  43. Function {cb(void)} {open return_type void
  44. } {
  45. code {
  46. selection_color(value() == reset_value ? 0 : 222);
  47. oscWrite(ext, "c", (int)(127-Fl_Slider::value()));
  48. if(cb_data.first)
  49. cb_data.first(this, cb_data.second);
  50. } {}
  51. }
  52. }
  53. class SUBnoteharmonic {: {public Fl_Osc_Group}
  54. } {
  55. Function {make_window()} {private
  56. } {
  57. Fl_Window harmonic {
  58. xywh {329 403 90 305} type Double hide
  59. class Fl_Osc_Group
  60. } {
  61. Fl_Slider mag {
  62. tooltip {harmonic's magnitude} xywh {0 15 10 135} type {Vert Knob} box FLAT_BOX selection_color 0 maximum 127 step 1 value 127
  63. class SUBSlider
  64. }
  65. Fl_Slider bw {
  66. tooltip {harmonic's bandwidth} xywh {0 157 10 130} type {Vert Knob} box FLAT_BOX selection_color 222 maximum 127 step 1 value 64
  67. class SUBSlider
  68. }
  69. Fl_Box {} {
  70. xywh {10 219 5 5} box FLAT_BOX color 45
  71. code0 {if (n+1==MAX_SUB_HARMONICS) o->hide();}
  72. }
  73. Fl_Box {} {
  74. label 01
  75. xywh {0 288 10 15} labelfont 1 labelsize 9 align 20
  76. code0 {char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));}
  77. }
  78. Fl_Box {} {
  79. label 01
  80. xywh {0 0 10 15} labelfont 1 labelsize 9 align 20
  81. code0 {char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));}
  82. }
  83. }
  84. }
  85. Function {SUBnoteharmonic(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h,label)} {} {
  86. code {n=0;} {}
  87. }
  88. Function {init(int n_)} {} {
  89. code {n=n_;
  90. make_window();
  91. harmonic->show();
  92. mag->reset_value=127;
  93. mag->ext = "Phmag" + to_s(n);
  94. mag->oscRegister(mag->ext.c_str());
  95. mag->set_transform([](float x){return 127.0f - x;});
  96. bw->reset_value=63;
  97. bw->ext = "Phrelbw" + to_s(n);
  98. bw->oscRegister(bw->ext.c_str());
  99. bw->set_transform([](float x){return 63.0f - x;});
  100. osc->requestValue(base+"Phrelbw"+to_s(n));
  101. end();} {}
  102. }
  103. Function {refresh()} {} {
  104. code {// request values for the widgets
  105. mag->oscWrite(mag->ext);
  106. bw->oscWrite(bw->ext);} {}
  107. }
  108. Function {~SUBnoteharmonic()} {} {
  109. code {harmonic->hide();
  110. hide();
  111. //delete(harmonic);} {}
  112. }
  113. decl {int n;} {private local
  114. }
  115. }
  116. class SUBnoteUI {open : {public PresetsUI_}
  117. } {
  118. Function {make_window()} {open
  119. } {
  120. Fl_Window SUBparameters {
  121. label {SUBsynth Parameters} open
  122. xywh {542 511 735 475} type Double
  123. class Fl_Osc_Window visible
  124. } {
  125. Fl_Box {} {
  126. xywh {0 0 0 0} box FLAT_BOX color 45
  127. code0 {SUBparameters->init(osc, loc);}
  128. }
  129. Fl_Scroll {} {
  130. label scroll open
  131. xywh {5 140 434 330} type HORIZONTAL box FLAT_BOX labeltype NO_LABEL
  132. } {
  133. Fl_Pack harmonics {open
  134. xywh {5 145 425 325} type HORIZONTAL
  135. code0 {for (int i=0;i<MAX_SUB_HARMONICS;i++){h[i]=new SUBnoteharmonic(0,0,15,o->h(),"");h[i]->init(i);}}
  136. } {}
  137. }
  138. Fl_Button {} {
  139. label Close
  140. callback {SUBparameters->hide();}
  141. xywh {670 446 60 25} box THIN_UP_BOX
  142. }
  143. Fl_Group {} {
  144. label AMPLITUDE open
  145. xywh {5 5 215 135} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 align 17
  146. } {
  147. Fl_Value_Slider vol {
  148. label Vol
  149. tooltip Volume xywh {10 25 140 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  150. code0 {o->init("PVolume");o->reset_value=96;}
  151. class Fl_Osc_VSlider
  152. }
  153. Fl_Value_Slider vsns {
  154. label {V.Sns}
  155. tooltip {Velocity Sensing Function (rightmost to disable)} xywh {10 45 140 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  156. code0 {o->init("PAmpVelocityScaleFunction");o->reset_value=90;}
  157. class Fl_Osc_VSlider
  158. }
  159. Fl_Dial pan {
  160. label Pan
  161. tooltip {Panning (leftmost is Random)} xywh {185 20 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  162. code0 {o->init("PPanning");o->reset_value=64;}
  163. class Fl_Osc_Dial
  164. }
  165. Fl_Group ampenv {
  166. label {SUBsynth - Amplitude Envelope} open
  167. xywh {10 65 205 70} box FLAT_BOX color 51 align 144
  168. code0 {o->init(ENV_ADSR, osc, loc, "AmpEnvelope/");}
  169. class EnvelopeUI
  170. } {}
  171. }
  172. Fl_Group {} {
  173. xywh {495 406 235 35} box UP_FRAME
  174. } {
  175. Fl_Counter filterstages {
  176. label {Filter Stages}
  177. tooltip {How many times the noise is filtered} xywh {515 421 45 15} type Simple labelfont 1 labelsize 10 align 1 minimum 1 maximum 5 step 1 textsize 10
  178. code0 {o->init("Pnumstages");}
  179. class Fl_Osc_Counter
  180. }
  181. Fl_Choice magtype {
  182. label {Mag.Type}
  183. xywh {585 421 65 15} down_box BORDER_BOX labelfont 1 labelsize 10 align 1 textsize 11
  184. code0 {o->init("Phmagtype");}
  185. class Fl_Osc_Choice
  186. } {
  187. MenuItem {} {
  188. label Linear
  189. xywh {20 20 100 20} labelfont 1 labelsize 11
  190. }
  191. MenuItem {} {
  192. label {-40dB}
  193. xywh {30 30 100 20} labelfont 1 labelsize 11
  194. }
  195. MenuItem {} {
  196. label {-60dB}
  197. xywh {40 40 100 20} labelfont 1 labelsize 11
  198. }
  199. MenuItem {} {
  200. label {-80dB}
  201. xywh {50 50 100 20} labelfont 1 labelsize 11
  202. }
  203. MenuItem {} {
  204. label {-100dB}
  205. xywh {60 60 100 20} labelfont 1 labelsize 11
  206. }
  207. }
  208. Fl_Choice start {
  209. label Start selected
  210. xywh {670 420 50 15} down_box BORDER_BOX labelfont 1 labelsize 10 align 1 textsize 11
  211. code0 {o->init("Pstart");}
  212. class Fl_Osc_Choice
  213. } {
  214. MenuItem {} {
  215. label Zero
  216. xywh {30 30 100 20} labelfont 1 labelsize 11
  217. }
  218. MenuItem {} {
  219. label RND
  220. xywh {40 40 100 20} labelfont 1 labelsize 11
  221. }
  222. MenuItem {} {
  223. label {Max.}
  224. xywh {50 50 100 20} labelfont 1 labelsize 11
  225. }
  226. }
  227. }
  228. Fl_Group freqsettingsui {
  229. label FREQUENCY open
  230. xywh {440 5 295 146} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 align 17
  231. } {
  232. Fl_Group freqenvelopegroup {
  233. label {SUBsynth - Frequency Envelope} open
  234. xywh {445 75 205 70} box FLAT_BOX color 51 align 144
  235. code0 {o->init(ENV_ASR, osc, loc, "FreqEnvelope/");}
  236. class EnvelopeUI
  237. } {}
  238. Fl_Check_Button freqee {
  239. label Enabled
  240. callback {if (o->value()==0) freqenvelopegroup->deactivate();
  241. else freqenvelopegroup->activate();
  242. o->show();
  243. freqsettingsui->redraw();}
  244. xywh {445 77 55 15} down_box DOWN_BOX labelfont 1 labelsize 10
  245. code0 {o->init("PFreqEnvelopeEnabled");}
  246. class Fl_Osc_Check
  247. }
  248. Fl_Counter octave {
  249. label Octave
  250. tooltip Octave xywh {670 58 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
  251. code0 {o->init("octave");}
  252. class Fl_Osc_Counter
  253. }
  254. Fl_Counter coarsedet {
  255. label {Coarse Det.}
  256. tooltip {Coarse Detune} xywh {655 125 60 20} labelsize 10 align 1 minimum -64 maximum 63 step 1 textfont 1 textsize 11
  257. code0 {o->init("coarsedetune");}
  258. code3 {o->lstep(10);}
  259. class Fl_Osc_Counter
  260. }
  261. Fl_Slider detune {
  262. callback {o->oscWrite("detunevalue");}
  263. tooltip {Fine Detune (cents)} xywh {495 27 230 15} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
  264. code0 {o->init("PDetune",'i');}
  265. class Fl_Osc_Slider
  266. }
  267. Fl_Value_Output detunevalueoutput {
  268. label Detune
  269. xywh {448 27 45 15} labelsize 10 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 10
  270. code0 {o->init("detunevalue");}
  271. class Fl_Osc_Output
  272. }
  273. Fl_Dial bendadjdial {
  274. label Bend
  275. tooltip {How the frequency varies according to the pitch wheel} xywh {448 53 15 15} box ROUND_UP_BOX labelsize 10 align 8 minimum -64 maximum 63 step 1
  276. code0 {o->init("PBendAdjust"); o->reset_value=24;o->set_transform([](float x){return x/24.0f;});o->set_rounding(2);}
  277. class Fl_Osc_Dial
  278. }
  279. Fl_Dial offsethzdial {
  280. label Offset
  281. tooltip {Offset of frequency in Hz} xywh {500 53 15 15} box ROUND_UP_BOX labelsize 10 align 8 minimum -64 maximum 63 step 1
  282. code0 {o->init("POffsetHz"); o->set_rounding(2); o->set_transform([](float x){x/=64; return 15*(x*sqrtf(fabsf(x)));});}
  283. class Fl_Osc_Dial
  284. }
  285. Fl_Check_Button hz440 {
  286. label 440Hz
  287. callback {if (o->value()==0) fixedfreqetdial->deactivate();
  288. else fixedfreqetdial->activate();}
  289. tooltip {set the base frequency to 440Hz} xywh {555 53 50 15} down_box DOWN_BOX labelfont 1 labelsize 10
  290. code0 {o->init("Pfixedfreq");}
  291. class Fl_Osc_Check
  292. }
  293. Fl_Dial fixedfreqetdial {
  294. label {Eq.T.}
  295. tooltip {How the frequency varies according to the keyboard (leftmost for fixed frequency)} xywh {610 53 15 15} box ROUND_UP_BOX labelsize 10 align 8 maximum 127 step 1
  296. code0 {o->init("PfixedfreqET");}
  297. class Fl_Osc_Dial
  298. }
  299. Fl_Choice detunetype {
  300. label {Detune Type}
  301. callback {o->oscWrite("detunevalue");} open
  302. xywh {655 94 70 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
  303. code0 {o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
  304. code1 {o->init("PDetuneType",1);}
  305. class Fl_Osc_Choice
  306. } {}
  307. }
  308. Fl_Check_Button stereo {
  309. label Stereo
  310. xywh {440 406 55 35} box THIN_UP_BOX down_box DOWN_BOX labelsize 10
  311. code0 {o->init("Pstereo");}
  312. class Fl_Osc_Check
  313. }
  314. Fl_Button {} {
  315. label Clear
  316. callback {o->oscWrite("clear");
  317. for (int i=1;i<MAX_SUB_HARMONICS;i++){
  318. h[i]->mag->oscWrite(h[i]->mag->ext, "c", 0);
  319. h[i]->bw->oscWrite(h[i]->bw->ext, "c", 64);
  320. };
  321. h[0]->mag->oscWrite(h[0]->mag->ext, "c", 127);
  322. h[0]->bw->oscWrite(h[0]->bw->ext, "c", 64);
  323. SUBparameters->redraw();}
  324. tooltip {Clear the harmonics} xywh {445 446 70 25} box THIN_UP_BOX
  325. class Fl_Osc_Button
  326. }
  327. Fl_Group bandwidthsettingsui {
  328. label BANDWIDTH
  329. xywh {220 5 220 135} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 align 17
  330. } {
  331. Fl_Group bandwidthenvelopegroup {
  332. label {SUBsynth - BandWidth Envelope} open
  333. xywh {225 65 205 70} box FLAT_BOX color 51 align 144
  334. code0 {o->init(ENV_ADSR_BW, osc, loc, "BandWidthEnvelope/");}
  335. class EnvelopeUI
  336. } {}
  337. Fl_Check_Button bwee {
  338. label Enabled
  339. callback {if (o->value()==0) bandwidthenvelopegroup->deactivate();
  340. else bandwidthenvelopegroup->activate();
  341. o->show();
  342. bandwidthsettingsui->redraw();}
  343. xywh {225 67 55 15} down_box DOWN_BOX labelfont 1 labelsize 10
  344. code0 {o->init("PBandWidthEnvelopeEnabled");}
  345. class Fl_Osc_Check
  346. }
  347. Fl_Value_Slider bandwidth {
  348. label {Band Width}
  349. xywh {225 40 115 15} type {Horz Knob} box NO_BOX labelsize 10 align 1 maximum 127 step 1
  350. code0 {o->init("Pbandwidth");o->reset_value=40;}
  351. class Fl_Osc_VSlider
  352. }
  353. Fl_Value_Slider bwidthscale {
  354. label {B.Width Scale}
  355. tooltip {How much I increase the BandWidth according to lower/higher harmonics} xywh {345 40 90 15} type {Horz Knob} box NO_BOX labelsize 10 align 1 minimum -64 maximum 63 step 1
  356. code0 {o->init("Pbwscale",'i');}
  357. class Fl_Osc_TSlider
  358. }
  359. }
  360. Fl_Group globalfiltergroup {
  361. label FILTER
  362. xywh {440 221 290 185} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  363. } {
  364. Fl_Group filterenv {
  365. label {SUBsynth - Filter Envelope} open
  366. xywh {445 331 275 70} box FLAT_BOX color 51 align 144
  367. code0 {o->init(ENV_ADSR_FILTER, osc, loc, "GlobalFilterEnvelope/");}
  368. class EnvelopeUI
  369. } {}
  370. Fl_Group filterui {
  371. label {SUBsynthl - Filter} open
  372. xywh {445 246 275 75} box FLAT_BOX color 50 align 144
  373. code0 {o->init(loc + "PGlobalFilter" , osc, loc, "GlobalFilter/");}
  374. class FilterUI
  375. } {}
  376. }
  377. Fl_Check_Button filtere {
  378. label Enabled
  379. callback {if (o->value()==0) globalfiltergroup->deactivate();
  380. else globalfiltergroup->activate();
  381. o->show();
  382. globalfiltergroup->redraw();}
  383. xywh {445 226 85 20} down_box DOWN_BOX labelfont 1 labelsize 11
  384. code0 {o->init("PGlobalFilterEnabled");}
  385. class Fl_Osc_Check
  386. }
  387. Fl_Button {} {
  388. label C
  389. callback {presetsui->copy(loc);}
  390. xywh {600 451 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  391. }
  392. Fl_Button {} {
  393. label P
  394. callback {presetsui->paste(loc,this);}
  395. xywh {630 451 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  396. }
  397. Fl_Group {} {
  398. label OVERTONES open
  399. xywh {440 151 220 70} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 align 17
  400. } {
  401. Fl_Choice spreadtype {
  402. label OvertonesPosition
  403. xywh {450 190 80 20} down_box BORDER_BOX labelsize 10 align 5 textsize 10
  404. code0 {o->init("POvertoneSpread.type");}
  405. class Fl_Osc_Choice
  406. } {
  407. MenuItem {} {
  408. label Harmonic
  409. xywh {0 0 34 20} labelfont 1 labelsize 11
  410. }
  411. MenuItem {} {
  412. label ShiftU
  413. xywh {10 10 34 20} labelfont 1 labelsize 11
  414. }
  415. MenuItem {} {
  416. label ShiftL
  417. xywh {20 20 34 20} labelfont 1 labelsize 11
  418. }
  419. MenuItem {} {
  420. label PowerU
  421. xywh {20 20 34 20} labelfont 1 labelsize 11
  422. }
  423. MenuItem {} {
  424. label PowerL
  425. xywh {30 30 34 20} labelfont 1 labelsize 11
  426. }
  427. MenuItem {} {
  428. label Sine
  429. xywh {40 40 34 20} labelfont 1 labelsize 11
  430. }
  431. MenuItem {} {
  432. label Power
  433. xywh {50 50 34 20} labelfont 1 labelsize 11
  434. }
  435. MenuItem {} {
  436. label Shift
  437. xywh {20 20 34 20} labelfont 1 labelsize 11
  438. }
  439. }
  440. Fl_Dial spreadpar1 {
  441. label Par1
  442. xywh {548 173 30 30} box ROUND_UP_BOX labelsize 10 maximum 255 step 1
  443. code0 {o->init("POvertoneSpread.par1");}
  444. class Fl_Osc_Dial
  445. }
  446. Fl_Dial spreadpar2 {
  447. label Par2
  448. xywh {583 173 30 30} box ROUND_UP_BOX labelsize 10 maximum 255 step 1
  449. code0 {o->init("POvertoneSpread.par2");}
  450. class Fl_Osc_Dial
  451. }
  452. Fl_Dial spreadpar3 {
  453. label ForceH
  454. xywh {618 173 30 30} box ROUND_UP_BOX labelsize 10 maximum 255 step 1
  455. code0 {o->init("POvertoneSpread.par3");}
  456. class Fl_Osc_Dial
  457. }
  458. }
  459. }
  460. }
  461. Function {refresh()} {} {
  462. code {
  463. SUBparameters->update();
  464. for (int i=0;i<MAX_SUB_HARMONICS;i++) h[i]->refresh();
  465. //globalfiltergroup->redraw();
  466. //ampenv->refresh();
  467. //bandwidthenvelopegroup->refresh();
  468. //freqenvelopegroup->refresh();
  469. //filterui->refresh();
  470. //filterenv->refresh();} {}
  471. }
  472. Function {SUBnoteUI(Fl_Osc_Interface *osc_, std::string loc_)} {} {
  473. code {osc = osc_;
  474. loc = loc_;
  475. make_window();} {}
  476. }
  477. Function {~SUBnoteUI()} {} {
  478. code {//for (int i=0;i<MAX_SUB_HARMONICS;i++) delete (h[i]);
  479. SUBparameters->hide();
  480. delete(SUBparameters);} {}
  481. }
  482. decl {Fl_Osc_Interface *osc;} {private local
  483. }
  484. decl {std::string loc;} {private local
  485. }
  486. decl {SUBnoteharmonic *h[MAX_SUB_HARMONICS];} {private local
  487. }
  488. }