External plugins for 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.

533 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 "Fl_Osc_Dial.H"} {public local
  10. }
  11. decl {\#include "Fl_Osc_Choice.H"} {public local
  12. }
  13. decl {\#include "Fl_Osc_Check.H"} {public local
  14. }
  15. decl {\#include "Fl_Osc_Counter.H"} {public local
  16. }
  17. decl {\#include "Fl_Osc_Output.H"} {public local
  18. }
  19. decl {\#include "Fl_Osc_Slider.H"} {public local
  20. }
  21. decl {\#include "Fl_Osc_Pane.H"} {public local
  22. }
  23. decl {\#include <cmath>} {private local
  24. }
  25. decl {\#include <stdio.h>} {private global
  26. }
  27. decl {\#include <stdlib.h>} {private global
  28. }
  29. decl {\#include "../globals.h"} {public local
  30. }
  31. decl {\#include "../Misc/Util.h"} {public local
  32. }
  33. decl {\#include <FL/Fl_Group.H>} {public local
  34. }
  35. decl {\#include "../Params/FilterParams.h"} {public local
  36. }
  37. decl {\#include <FL/Fl_Box.H>} {public local
  38. }
  39. decl {\#include <FL/fl_draw.H>} {public local
  40. }
  41. decl {\#include <FL/fl_ask.H>} {public local
  42. }
  43. decl {\#include "PresetsUI.h"} {public local
  44. }
  45. decl {\#include "common.H"} {public local
  46. }
  47. decl {\#include "FormantFilterGraph.H"} {public local
  48. }
  49. decl {using namespace zyncarla;} {public local
  50. }
  51. class FilterUI {open : {public Fl_Osc_Group,PresetsUI_}
  52. } {
  53. Function {FilterUI(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h)} {} {
  54. code {nvowel=0;nformant=0;nseqpos=0;} {}
  55. }
  56. Function {~FilterUI()} {} {
  57. code {filterui->hide();
  58. formantparswindow->hide();
  59. hide();
  60. //delete (filterui);
  61. delete (formantparswindow);} {}
  62. }
  63. Function {make_window()} {open
  64. } {
  65. Fl_Window filterui {open
  66. xywh {516 484 275 70} type Double color 50 labelfont 1
  67. class Fl_Osc_Group visible
  68. } {
  69. Fl_Button {} {
  70. label P
  71. callback {presetsui->paste(filterui->loc(),this);}
  72. xywh {203 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
  73. }
  74. Fl_Group filterparamswindow {
  75. label {Filter Parameters}
  76. xywh {0 0 275 75} box UP_FRAME color 183 labeltype ENGRAVED_LABEL labelsize 10 align 17
  77. code0 {set_module_parameters( o );}
  78. } {
  79. Fl_Choice analogfiltertypechoice {
  80. label FilterType
  81. tooltip {The Filter type} xywh {10 50 50 15} down_box BORDER_BOX labelsize 10 align 5 textsize 10
  82. code1 {o->init("Ptype");}
  83. class Fl_Osc_Choice
  84. } {
  85. MenuItem {} {
  86. label LPF1
  87. xywh {40 40 100 20} labelfont 1 labelsize 10
  88. }
  89. MenuItem {} {
  90. label HPF1
  91. xywh {50 50 100 20} labelfont 1 labelsize 10
  92. }
  93. MenuItem {} {
  94. label LPF2
  95. xywh {60 60 100 20} labelfont 1 labelsize 10
  96. }
  97. MenuItem {} {
  98. label HPF2
  99. xywh {70 70 100 20} labelfont 1 labelsize 10
  100. }
  101. MenuItem {} {
  102. label BPF2
  103. xywh {82 82 100 20} labelfont 1 labelsize 10
  104. }
  105. MenuItem {} {
  106. label NF2
  107. xywh {94 94 100 20} labelfont 1 labelsize 10
  108. }
  109. MenuItem {} {
  110. label PkF2
  111. xywh {104 104 100 20} labelfont 1 labelsize 10
  112. }
  113. MenuItem {} {
  114. label LSh2
  115. xywh {114 114 100 20} labelfont 1 labelsize 10
  116. }
  117. MenuItem {} {
  118. label HSh2
  119. xywh {124 124 100 20} labelfont 1 labelsize 10
  120. }
  121. }
  122. Fl_Choice svfiltertypechoice {
  123. label FilterType
  124. tooltip {The Filter type} xywh {10 50 50 15} down_box BORDER_BOX labelsize 10 align 5 textsize 10
  125. code1 {o->init("Ptype");}
  126. class Fl_Osc_Choice
  127. } {
  128. MenuItem {} {
  129. label 1LPF
  130. xywh {134 134 100 20} labelfont 1 labelsize 10
  131. }
  132. MenuItem {} {
  133. label 1HPF
  134. xywh {144 144 100 20} labelfont 1 labelsize 10
  135. }
  136. MenuItem {} {
  137. label 1BPF
  138. xywh {154 154 100 20} labelfont 1 labelsize 10
  139. }
  140. MenuItem {} {
  141. label 1NF
  142. xywh {164 164 100 20} labelfont 1 labelsize 10
  143. }
  144. }
  145. Fl_Choice filtertype {
  146. label Category
  147. callback {refresh();}
  148. tooltip {The Category of the Filter (Analog/Formantic/etc.)} xywh {10 20 60 15} down_box BORDER_BOX labelsize 10 align 5 textsize 10
  149. code0 {o->init("Pcategory");}
  150. class Fl_Osc_Choice
  151. } {
  152. MenuItem {} {
  153. label Analog
  154. xywh {50 50 100 20} labelfont 1 labelsize 10
  155. }
  156. MenuItem {} {
  157. label Formant
  158. xywh {60 60 100 20} labelfont 1 labelsize 10
  159. }
  160. MenuItem {} {
  161. label StVarF
  162. xywh {70 70 100 20} labelfont 1 labelsize 10
  163. }
  164. }
  165. Fl_Dial cfreqdial {
  166. label {C.Freq}
  167. tooltip {Center Frequency of the Filter or the base position in the vowel's sequence} xywh {75 25 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  168. code0 {o->init("Pfreq");}
  169. class Fl_Osc_Dial
  170. }
  171. Fl_Dial qdial {
  172. label Q
  173. callback {formantfiltergraph->redraw();}
  174. tooltip {Filter resonance or bandwidth} xywh {110 25 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  175. code0 {o->init("Pq");}
  176. class Fl_Osc_Dial
  177. }
  178. Fl_Dial freqtrdial {
  179. label {freq.tr.}
  180. tooltip {Filter frequency tracking (left is negative, middle is 0, and right is positive)} xywh {215 25 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  181. code0 {o->init("Pfreqtrack");}
  182. class Fl_Osc_Dial
  183. }
  184. Fl_Dial vsnsadial {
  185. label {V.SnsA.}
  186. tooltip {Velocity sensing amount of the Filter} xywh {145 25 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  187. code0 {if(!alt_root.empty()) o->alt_init(alt_root, "VelocityScale"); }
  188. code1 {else {o->deactivate(); o->value(127);o->mark_dead();}}
  189. class Fl_Osc_Dial
  190. }
  191. Fl_Dial vsnsdial {
  192. label {V.Sns.}
  193. tooltip {Velocity Sensing Function of the Filter} xywh {180 25 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  194. code0 {if(!alt_root.empty()) o->alt_init(alt_root, "VelocityScaleFunction"); }
  195. code1 {else {o->deactivate(); o->value(127);o->mark_dead();}}
  196. class Fl_Osc_Dial
  197. }
  198. Fl_Dial gaindial {
  199. label gain
  200. callback {formantfiltergraph->redraw();}
  201. tooltip {Filter output gain/damp} xywh {250 35 20 20} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  202. code0 {o->init("Pgain");}
  203. class Fl_Osc_Dial
  204. }
  205. Fl_Choice stcounter {
  206. label St
  207. callback {formantfiltergraph->redraw();} open
  208. tooltip {Filter stages (in order to increase dB/oct. value and the order of the filter)} xywh {235 5 35 15} down_box BORDER_BOX labelsize 10 textfont 1 textsize 10
  209. code1 {for (int i=0;i<MAX_FILTER_STAGES;i++) {char tmp[10];snprintf(tmp,10,"%dx",i+1);o->add(tmp);};}
  210. code2 {o->init("Pstages");}
  211. class Fl_Osc_Choice
  212. } {}
  213. }
  214. Fl_Button editbutton {
  215. label Edit
  216. callback {formantparswindow->show();}
  217. xywh {15 40 50 25} labelfont 1 labelsize 11
  218. }
  219. Fl_Button {} {
  220. label C
  221. callback {presetsui->copy(filterui->loc());}
  222. xywh {186 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
  223. }
  224. Fl_Button {} {
  225. label P
  226. callback {presetsui->paste(filterui->loc(),this);}
  227. xywh {203 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
  228. }
  229. }
  230. }
  231. Function {make_formant_window()} {open
  232. } {
  233. Fl_Window formantparswindow {
  234. label {Formant Filter Parameters} open
  235. xywh {536 611 700 205} type Double
  236. class Fl_Osc_Window visible
  237. } {
  238. Fl_Button {} {
  239. label P
  240. callback {presetsui->paste(filterui->loc(),this,nvowel);}
  241. xywh {665 25 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  242. code0 {formantparswindow->osc = osc;}
  243. code1 {formantparswindow->base = loc();}
  244. }
  245. Fl_Group {} {open
  246. xywh {485 47 105 113} box THIN_UP_BOX
  247. class Fl_Osc_Group
  248. } {
  249. Fl_Counter {} {
  250. label {Formant }
  251. callback {nformant=(int) o->value();
  252. formantparsgroup->reext("Pvowels"+to_s(nvowel)+"/Pformants"+to_s(nformant)+"/");
  253. update_formant_window();
  254. formantfiltergraph->redraw();}
  255. xywh {545 80 40 15} type Simple labelfont 1 labelsize 10 align 4 minimum 0 maximum 127 step 1 textsize 10
  256. code0 {o->bounds(0,FF_MAX_FORMANTS-1);}
  257. code1 {o->value(nformant);}
  258. }
  259. Fl_Counter {} {
  260. label {Vowel no.}
  261. callback {nvowel=(int) o->value();
  262. formantparsgroup->reext("Pvowels"+to_s(nvowel)+"/Pformants"+to_s(nformant)+"/");
  263. update_formant_window();
  264. formantfiltergraph->redraw();}
  265. xywh {545 55 40 20} type Simple labelfont 1 labelsize 10 align 4 minimum 0 maximum 127 step 1 textfont 1 textsize 11
  266. code0 {o->bounds(0,FF_MAX_VOWELS-1);}
  267. code1 {o->value(nvowel);}
  268. }
  269. Fl_Group formantparsgroup {open
  270. xywh {490 105 95 50} box ENGRAVED_FRAME
  271. class Fl_Osc_Group
  272. } {
  273. Fl_Box {} {
  274. label dummy selected
  275. xywh {515 130 35 16} hide deactivate
  276. code0 {formantparsgroup->ext = "Pvowels0/Pformants0/";}
  277. }
  278. Fl_Dial formant_freq_dial {
  279. label freq
  280. callback {formantfiltergraph->update();}
  281. tooltip {Formant frequency} xywh {495 115 25 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  282. code0 {//TODO get widget renaming working here!!!}
  283. code1 {o->init("freq");}
  284. class Fl_Osc_Dial
  285. }
  286. Fl_Dial formant_q_dial {
  287. label Q
  288. callback {formantfiltergraph->update();}
  289. tooltip {Formant's Q} xywh {525 115 24 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  290. code0 {o->init("q");}
  291. class Fl_Osc_Dial
  292. }
  293. Fl_Dial formant_amp_dial {
  294. label amp
  295. callback {formantfiltergraph->update();}
  296. tooltip {Formant amplitude} xywh {555 115 24 25} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  297. code0 {o->init("amp");}
  298. class Fl_Osc_Dial
  299. }
  300. }
  301. }
  302. Fl_Group {} {open
  303. xywh {590 47 100 113} box THIN_UP_BOX
  304. class Fl_Osc_Group
  305. } {
  306. Fl_Counter sequencesize {
  307. label {Seq.Size}
  308. callback {update_formant_window();}
  309. xywh {595 62 55 20} type Simple labelfont 1 labelsize 10 align 5 minimum 0 maximum 127 step 1 textfont 1 textsize 11
  310. code0 {o->bounds(1,FF_MAX_SEQUENCE-1);}
  311. code1 {o->init("Psequencesize");}
  312. class Fl_Osc_Counter
  313. }
  314. Fl_Counter {} {
  315. label {S.Pos.}
  316. callback {nseqpos = o->value();update_formant_window();vowel_counter->oscMove("vowel_seq"+to_s(nseqpos));}
  317. tooltip {Current position from the sequence} xywh {595 97 40 15} type Simple labelfont 1 labelsize 10 align 9 minimum 0 maximum 127 step 1 textsize 10
  318. code0 {o->bounds(0,FF_MAX_SEQUENCE-2);}
  319. code1 {o->value(nseqpos);}
  320. }
  321. Fl_Counter vowel_counter {
  322. label Vowel
  323. callback {(void)o;//pars->Psequence[nseqpos].nvowel=(int) o->value(); pars->changed=true;}
  324. xywh {640 97 40 15} type Simple labelsize 10 align 1 minimum 0 maximum 127 step 1 textsize 10
  325. code0 {o->bounds(0,FF_MAX_VOWELS-1);}
  326. code1 {o->init("vowel_seq0");}
  327. class Fl_Osc_Counter
  328. }
  329. Fl_Check_Button {} {
  330. label {Neg.Input}
  331. tooltip {Negate the input from LFO/envelopes/etc.} xywh {625 132 60 20} down_box DOWN_BOX labelsize 10
  332. code0 {o->init("Psequencereversed");}
  333. class Fl_Osc_Check
  334. }
  335. Fl_Dial strchdial {
  336. label Strch
  337. tooltip {Sequence Stretch} xywh {595 130 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  338. code0 {o->init("Psequencestretch");}
  339. class Fl_Osc_Dial
  340. }
  341. }
  342. Fl_Counter numformants {
  343. label {Num.Formants}
  344. callback {update_formant_window();
  345. formantfiltergraph->redraw();}
  346. xywh {485 15 65 20} type Simple labelfont 0 labelsize 10 align 5 minimum 0 maximum 127 step 1
  347. code0 {o->bounds(1,FF_MAX_FORMANTS);}
  348. code1 {o->init("Pnumformants");}
  349. class Fl_Osc_Counter
  350. }
  351. Fl_Dial frsldial {
  352. label {Fr.Sl.}
  353. tooltip {Formant's Slowness (Morphing)} xywh {565 15 25 25} box ROUND_UP_BOX labelfont 0 labelsize 10 align 1 maximum 127 step 1
  354. code0 {o->init("Pformantslowness");}
  355. class Fl_Osc_Dial
  356. }
  357. Fl_Value_Output centerfreqvo {
  358. label {C.f.}
  359. callback {o->value(o->newvalue()/1000.0);}
  360. tooltip {Center Frequency (kHz)} xywh {511 164 40 18} when 3 minimum 1 maximum 10 step 0.01 value 1 textfont 1 textsize 11 labelsize 13
  361. code0 {o->init("centerfreq");}
  362. class Fl_Osc_Output
  363. }
  364. Fl_Value_Output octavesfreqvo {
  365. label {Oct.}
  366. callback {o->value(o->newvalue());}
  367. tooltip {No. of octaves} xywh {511 182 40 18} when 3 minimum 1 maximum 127 step 0.01 value 5 textfont 1 textsize 11 labelsize 13
  368. code0 {o->init("octavesfreq");}
  369. class Fl_Osc_Output
  370. }
  371. Fl_Slider cfknob {
  372. callback {centerfreqvo->update();}
  373. xywh {555 167 84 15} type {Horz Knob} box FLAT_BOX maximum 127
  374. code0 {o->init("Pcenterfreq", 'i');}
  375. class Fl_Osc_Slider
  376. }
  377. Fl_Slider octknob {
  378. callback {octavesfreqvo->update();}
  379. xywh {555 185 84 15} type {Horz Knob} box FLAT_BOX maximum 127
  380. code0 {o->init("Poctavesfreq", 'i');}
  381. class Fl_Osc_Slider
  382. }
  383. Fl_Box formantfiltergraph {
  384. xywh {5 5 475 195} box BORDER_BOX
  385. code0 {o->init(&nvowel,&nformant);}
  386. class FormantFilterGraph
  387. }
  388. Fl_Dial wvknob {
  389. label {Vw.Cl.}
  390. tooltip {Vowel "clearness" (how the mixed vowels are avoided)} xywh {600 15 25 25} box ROUND_UP_BOX labelfont 0 labelsize 10 align 1 maximum 127 step 1
  391. code0 {o->init("Pvowelclearness");}
  392. class Fl_Osc_Dial
  393. }
  394. Fl_Button {} {
  395. label Close
  396. callback {formantparswindow->hide();}
  397. xywh {645 180 50 25} box THIN_UP_BOX
  398. }
  399. Fl_Button {} {
  400. label C
  401. callback {presetsui->copy(filterui->loc(),nvowel);}
  402. xywh {635 25 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  403. }
  404. Fl_Box {} {
  405. label Vowel
  406. xywh {635 6 55 15} labelfont 1
  407. }
  408. }
  409. }
  410. Function {update_formant_window()} {open
  411. } {
  412. code {//formant_freq_dial->value(pars->Pvowels[nvowel].formants[nformant].freq);
  413. //formant_q_dial->value(pars->Pvowels[nvowel].formants[nformant].q);
  414. //formant_amp_dial->value(pars->Pvowels[nvowel].formants[nformant].amp);
  415. if (nformant<numformants->value()) formantparsgroup->activate();
  416. else formantparsgroup->deactivate();
  417. if (nseqpos<sequencesize->value()) vowel_counter->activate();
  418. else vowel_counter->deactivate();
  419. //vowel_counter->value(pars->Psequence[nseqpos].nvowel);} {}
  420. }
  421. Function {refresh()} {open
  422. } {
  423. code {update_formant_window();
  424. formantfiltergraph->redraw();
  425. const int Pcategory = filtertype->value();
  426. const int Ptype = analogfiltertypechoice->value();
  427. if (Pcategory==2) svfiltertypechoice->value(Ptype);
  428. if (Pcategory==0) analogfiltertypechoice->value(Ptype);
  429. const int categ=Pcategory;
  430. if ((categ==0)||(categ==2)) {
  431. if (categ==0) {
  432. analogfiltertypechoice->show();
  433. svfiltertypechoice->hide();
  434. } else {
  435. svfiltertypechoice->show();
  436. analogfiltertypechoice->hide();
  437. };
  438. editbutton->hide();
  439. formantparswindow->hide();
  440. cfreqdial->label("C.freq");
  441. } else {
  442. analogfiltertypechoice->hide();
  443. svfiltertypechoice->hide();
  444. editbutton->show();
  445. cfreqdial->label("BS.pos");
  446. };
  447. filterparamswindow->redraw();} {}
  448. }
  449. Function {rebase(std::string new_base)} {open
  450. } {
  451. code {
  452. formantparswindow->rebase(new_base+"VoiceFilter/");
  453. Fl_Osc_Group::rebase(new_base);
  454. } {}
  455. }
  456. Function {init(std::string alt_root_, Fl_Osc_Interface *osc_, std::string base_, std::string ext_)} {} {
  457. code {alt_root = alt_root_;
  458. osc = osc_;
  459. base = base_;
  460. ext = ext_;
  461. assert(osc);
  462. make_window();
  463. end();
  464. make_formant_window();
  465. filterui->resize(this->x(),this->y(),this->w(),this->h());
  466. switchcategory(0);
  467. formantparswindow->label(this->label());
  468. update_formant_window();} {}
  469. }
  470. Function {switchcategory(int newcat)} {open
  471. } {
  472. code {
  473. //TODO update Pgain & filter type on switch Pgain=64;
  474. (void) newcat;
  475. refresh();} {}
  476. }
  477. Function {use_for_dynamic_filter()} {open
  478. } {
  479. code {freqtrdial->deactivate();
  480. gaindial->when(0);
  481. cfknob->when(FL_WHEN_RELEASE);
  482. octknob->when(FL_WHEN_RELEASE);
  483. frsldial->when(0);
  484. wvknob->when(0);
  485. formant_freq_dial->when(0);
  486. formant_q_dial->when(0);
  487. formant_amp_dial->when(0);
  488. strchdial->when(0);} {}
  489. }
  490. decl {std::string alt_root;} {private local
  491. }
  492. decl {int nvowel,nformant,nseqpos;} {private local
  493. }
  494. }