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.

ADnoteUI.fl 49KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162
  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0110
  3. header_name {.h}
  4. code_name {.cc}
  5. decl {//Copyright (c) 2002-2005 Nasca Octavian Paul} {}
  6. decl {//License: GNU GPL version 2 or later} {}
  7. decl {\#include "../Params/ADnoteParameters.h"} {public
  8. }
  9. decl {\#include "../Misc/Util.h"} {public
  10. }
  11. decl {\#include "../Misc/Master.h"} {public
  12. }
  13. decl {\#include "ResonanceUI.h"} {public
  14. }
  15. decl {\#include <FL/Fl_Box.H>} {public
  16. }
  17. decl {\#include <FL/Fl_Group.H>} {public
  18. }
  19. decl {\#include <math.h>} {}
  20. decl {\#include <stdio.h>} {}
  21. decl {\#include <stdlib.h>} {}
  22. decl {\#include <string.h>} {}
  23. decl {\#include "WidgetPDial.h"} {public
  24. }
  25. decl {\#include "EnvelopeUI.h"} {public
  26. }
  27. decl {\#include "LFOUI.h"} {public
  28. }
  29. decl {\#include "FilterUI.h"} {public
  30. }
  31. decl {\#include "OscilGenUI.h"} {public
  32. }
  33. decl {\#include "PresetsUI.h"} {public
  34. }
  35. class ADvoicelistitem {open : {public Fl_Group}
  36. } {
  37. Function {make_window()} {open private
  38. } {
  39. Fl_Window ADnoteVoiceListItem {open
  40. private xywh {262 736 615 100} type Double box UP_FRAME
  41. class Fl_Group visible
  42. } {
  43. Fl_Group voicelistitemgroup {
  44. private xywh {50 0 570 25}
  45. code0 {if (pars->VoicePar[nvoice].Enabled==0) o->deactivate();}
  46. } {
  47. Fl_Value_Slider voicevolume {
  48. callback {pars->VoicePar[nvoice].PVolume=(int)o->value();}
  49. tooltip Volume xywh {90 5 115 20} type {Horz Knob} box NO_BOX labelsize 8 align 5 maximum 127 step 1
  50. code0 {o->value(pars->VoicePar[nvoice].PVolume);}
  51. }
  52. Fl_Check_Button voiceresonanceenabled {
  53. callback {pars->VoicePar[nvoice].Presonance=(int)o->value();}
  54. tooltip {Resonance On/Off} xywh {245 7 15 17} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 11 align 4
  55. code0 {o->value(pars->VoicePar[nvoice].Presonance);}
  56. }
  57. Fl_Value_Slider voicelfofreq {
  58. callback {pars->VoicePar[nvoice].FreqLfo->Pintensity=(int)o->value();}
  59. tooltip {Frequency LFO amount} xywh {500 5 115 20} type {Horz Knob} box NO_BOX labelsize 8 align 5 maximum 127 step 1
  60. code0 {o->value(pars->VoicePar[nvoice].FreqLfo->Pintensity);}
  61. }
  62. Fl_Dial voicepanning {
  63. callback {pars->VoicePar[nvoice].PPanning=(int) o->value();}
  64. tooltip {Panning (leftmost is Random)} xywh {215 5 20 20} box ROUND_UP_BOX labelsize 10 align 4 maximum 127 step 1
  65. code0 {o->value(pars->VoicePar[nvoice].PPanning);}
  66. class WidgetPDial
  67. }
  68. Fl_Group voiceoscil {open
  69. xywh {60 5 30 20} box THIN_DOWN_BOX color 32 selection_color 71 labelcolor 179
  70. code0 {osc=new Oscilloscope(o->x(),o->y(),o->w(),o->h(),"");}
  71. code1 {osc->init(pars->VoicePar[nvoice].OscilSmp,0,pars->VoicePar[nvoice].Poscilphase,master);}
  72. code2 {if (pars->VoicePar[nvoice].Pextoscil != -1) {osc->init(pars->VoicePar[pars->VoicePar[nvoice].Pextoscil].OscilSmp,master);}}
  73. } {}
  74. Fl_Value_Output detunevalueoutput {
  75. callback {o->value(getdetune((pars->VoicePar[nvoice].PDetuneType==0)?(pars->GlobalPar.PDetuneType) : (pars->VoicePar[nvoice].PDetuneType),0,pars->VoicePar[nvoice].PDetune)*pars->getBandwidthDetuneMultiplier());}
  76. xywh {265 5 45 20} labelsize 10 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 10
  77. code0 {o->value(getdetune(pars->VoicePar[nvoice].PDetuneType,0,pars->VoicePar[nvoice].PDetune)*pars->getBandwidthDetuneMultiplier());}
  78. }
  79. Fl_Slider voicedetune {
  80. callback {pars->VoicePar[nvoice].PDetune=(int)o->value()+8192;
  81. detunevalueoutput->do_callback();}
  82. tooltip {Fine Detune (cents)} xywh {315 5 185 20} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
  83. code0 {o->value(pars->VoicePar[nvoice].PDetune-8192);}
  84. }
  85. Fl_Box noiselabel {
  86. label N
  87. callback {if (pars->VoicePar[nvoice].Type==0) {
  88. o->hide();
  89. voiceresonanceenabled->activate();
  90. detunevalueoutput->activate();
  91. voicedetune->activate();
  92. voicelfofreq->activate();
  93. voiceoscil->activate();
  94. } else {
  95. o->show();
  96. voiceresonanceenabled->deactivate();
  97. detunevalueoutput->deactivate();
  98. voicedetune->deactivate();
  99. voicelfofreq->deactivate();
  100. voiceoscil->deactivate();
  101. };}
  102. xywh {65 5 20 20} labelfont 1 labelsize 13 labelcolor 7
  103. code0 {if (pars->VoicePar[nvoice].Type==0) o->hide();}
  104. }
  105. }
  106. Fl_Check_Button voiceenabled {
  107. label 01
  108. callback {pars->VoicePar[nvoice].Enabled=(int)o->value();
  109. if (o->value()==0) voicelistitemgroup->deactivate();
  110. else voicelistitemgroup->activate();
  111. o->redraw();}
  112. private xywh {30 5 20 20} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 4
  113. code0 {char tmp[10];snprintf(tmp,10,"%d",nvoice+1);o->label(strdup(tmp));}
  114. code1 {o->value(pars->VoicePar[nvoice].Enabled);}
  115. }
  116. }
  117. }
  118. Function {ADvoicelistitem(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
  119. code {nvoice=0;
  120. pars=NULL;} {}
  121. }
  122. Function {init(ADnoteParameters *parameters,int nvoice_,Master *master_)} {} {
  123. code {pars=parameters;
  124. nvoice=nvoice_;
  125. master=master_;
  126. make_window();
  127. ADnoteVoiceListItem->show();
  128. end();} {}
  129. }
  130. Function {refreshlist()} {} {
  131. code {voiceenabled->value(pars->VoicePar[nvoice].Enabled);
  132. voiceresonanceenabled->value(pars->VoicePar[nvoice].Presonance);
  133. voicevolume->value(pars->VoicePar[nvoice].PVolume);
  134. voicedetune->value(pars->VoicePar[nvoice].PDetune-8192);
  135. voicepanning->value(pars->VoicePar[nvoice].PPanning);
  136. voicelfofreq->value(pars->VoicePar[nvoice].FreqLfo->Pintensity);
  137. if (pars->VoicePar[nvoice].Pextoscil != -1) {
  138. osc->init(pars->VoicePar[pars->VoicePar[nvoice].Pextoscil].OscilSmp,0,pars->VoicePar[nvoice].Poscilphase,master);
  139. } else
  140. osc->init(pars->VoicePar[nvoice].OscilSmp,0,pars->VoicePar[nvoice].Poscilphase,master);
  141. if (pars->VoicePar[nvoice].Enabled==0) voicelistitemgroup->deactivate();
  142. else voicelistitemgroup->activate();
  143. detunevalueoutput->do_callback();
  144. noiselabel->do_callback();
  145. ADnoteVoiceListItem->redraw();} {}
  146. }
  147. Function {~ADvoicelistitem()} {} {
  148. code {ADnoteVoiceListItem->hide();
  149. //delete(ADnoteVoiceListItem);} {}
  150. }
  151. decl {ADnoteParameters *pars;} {}
  152. decl {int nvoice;} {}
  153. decl {Oscilloscope *osc;} {}
  154. decl {Master *master;} {}
  155. }
  156. class ADvoiceUI {open : {public Fl_Group}
  157. } {
  158. Function {make_window()} {open
  159. } {
  160. Fl_Window ADnoteVoiceParameters {
  161. label Voice open
  162. xywh {84 305 765 590} type Double box NO_BOX
  163. class Fl_Group visible
  164. } {
  165. Fl_Group voiceparametersgroup {open
  166. xywh {0 0 765 595} color 48
  167. code0 {if (pars->VoicePar[nvoice].Enabled==0) o->deactivate();}
  168. } {
  169. Fl_Group voicemodegroup {open
  170. xywh {0 5 765 590} color 64
  171. } {
  172. Fl_Group voiceFMparametersgroup {
  173. label MODULATOR open
  174. xywh {530 5 230 580} box UP_FRAME color 48 labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  175. code0 {if (pars->VoicePar[nvoice].PFMEnabled==0) o->deactivate();}
  176. } {
  177. Fl_Group modfrequency {
  178. label {Mod.FREQUENCY}
  179. xywh {535 220 220 155} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  180. } {
  181. Fl_Group voiceFMfreqenvgroup {
  182. label {ADSynth Modulator - Frequency Envelope}
  183. xywh {540 300 210 70} box FLAT_BOX color 51 align 144
  184. code0 {o->init(pars->VoicePar[nvoice].FMFreqEnvelope);}
  185. code1 {if (pars->VoicePar[nvoice].PFMFreqEnvelopeEnabled==0) o->deactivate();}
  186. class EnvelopeUI
  187. } {}
  188. Fl_Check_Button {} {
  189. label On
  190. callback {pars->VoicePar[nvoice].PFMFreqEnvelopeEnabled=(int)o->value();
  191. if (o->value()==0) voiceFMfreqenvgroup->deactivate();
  192. else voiceFMfreqenvgroup->activate();
  193. o->redraw();}
  194. tooltip {Forced Relase} xywh {545 305 50 10} down_box DOWN_BOX labelfont 1 labelsize 11
  195. code0 {o->value(pars->VoicePar[nvoice].PFMFreqEnvelopeEnabled);}
  196. }
  197. Fl_Counter {} {
  198. label {Coarse Det.}
  199. callback {int k=(int) o->value();
  200. if (k<0) k+=1024;
  201. pars->VoicePar[nvoice].PFMCoarseDetune = k+
  202. (pars->VoicePar[nvoice].PFMCoarseDetune/1024)*1024;}
  203. tooltip {Coarse Detune} xywh {685 280 60 15} labelsize 10 align 1 minimum -64 maximum 63 step 1 textfont 1 textsize 11
  204. code0 {int k=pars->VoicePar[nvoice].PFMCoarseDetune%1024;}
  205. code1 {if (k>=512) k-=1024;}
  206. code2 {o->value(k);}
  207. code3 {o->lstep(10);}
  208. }
  209. Fl_Counter {} {
  210. label Octave
  211. callback {int k=(int) o->value();
  212. if (k<0) k+=16;
  213. pars->VoicePar[nvoice].PFMCoarseDetune = k*1024+
  214. pars->VoicePar[nvoice].PFMCoarseDetune%1024;}
  215. tooltip Octave xywh {625 280 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
  216. code0 {int k=pars->VoicePar[nvoice].PFMCoarseDetune/1024;}
  217. code1 {if (k>=8) k-=16;}
  218. code2 {o->value(k);}
  219. }
  220. Fl_Slider {} {
  221. callback {pars->VoicePar[nvoice].PFMDetune=(int)o->value()+8192;
  222. fmdetunevalueoutput->do_callback();}
  223. tooltip {Fine Detune (cents)} xywh {590 245 155 15} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
  224. code0 {o->value(pars->VoicePar[nvoice].PFMDetune-8192);}
  225. }
  226. Fl_Value_Output fmdetunevalueoutput {
  227. label Detune
  228. callback {o->value(getdetune((pars->VoicePar[nvoice].PFMDetuneType==0)?(pars->GlobalPar.PDetuneType) : (pars->VoicePar[nvoice].PFMDetuneType),0,pars->VoicePar[nvoice].PFMDetune));}
  229. xywh {540 245 45 18} labelsize 8 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 8
  230. code0 {o->value(getdetune((pars->VoicePar[nvoice].PFMDetuneType==0)?(pars->GlobalPar.PDetuneType) : (pars->VoicePar[nvoice].PFMDetuneType),0,pars->VoicePar[nvoice].PFMDetune));}
  231. code1 {//o->value(getdetune(pars->VoicePar[nvoice].PFMDetuneType,0,pars->VoicePar[nvoice].PFMDetune));}
  232. }
  233. Fl_Choice {} {
  234. label {Detune Type}
  235. callback {pars->VoicePar[nvoice].PFMDetuneType=(int) o->value();
  236. fmdetunevalueoutput->do_callback();} open
  237. xywh {540 280 75 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
  238. code0 {o->add("Default");o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
  239. code1 {o->value(pars->VoicePar[nvoice].PFMDetuneType);}
  240. } {}
  241. }
  242. Fl_Group {} {
  243. label {Mod.AMPLITUDE}
  244. xywh {535 60 220 160} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  245. } {
  246. Fl_Value_Slider {} {
  247. label Vol
  248. callback {pars->VoicePar[nvoice].PFMVolume=(int)o->value();}
  249. tooltip Volume xywh {540 80 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  250. code0 {o->value(pars->VoicePar[nvoice].PFMVolume);}
  251. }
  252. Fl_Value_Slider {} {
  253. label {V.Sns}
  254. callback {pars->VoicePar[nvoice].PFMVelocityScaleFunction=(int) o->value();}
  255. tooltip {Velocity Sensing Function (rightmost to disable)} xywh {540 100 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  256. code0 {o->value(pars->VoicePar[nvoice].PFMVelocityScaleFunction);}
  257. }
  258. Fl_Group voiceFMampenvgroup {
  259. label {ADSynth Modulator - Amplitude Envelope} open
  260. xywh {540 145 205 70} box FLAT_BOX color 51 align 144
  261. code0 {o->init(pars->VoicePar[nvoice].FMAmpEnvelope);}
  262. code1 {if (pars->VoicePar[nvoice].PFMAmpEnvelopeEnabled==0) o->deactivate();}
  263. class EnvelopeUI
  264. } {}
  265. Fl_Check_Button {} {
  266. label On
  267. callback {pars->VoicePar[nvoice].PFMAmpEnvelopeEnabled=(int)o->value();
  268. if (o->value()==0) voiceFMampenvgroup->deactivate();
  269. else voiceFMampenvgroup->activate();
  270. o->redraw();}
  271. tooltip {Forced Relase} xywh {545 150 50 10} down_box DOWN_BOX labelfont 1 labelsize 11
  272. code0 {o->value(pars->VoicePar[nvoice].PFMAmpEnvelopeEnabled);}
  273. }
  274. Fl_Value_Slider {} {
  275. label {F.Damp}
  276. callback {pars->VoicePar[nvoice].PFMVolumeDamp=(int) o->value()+64;}
  277. tooltip {Modulator Damp at Higher frequency} xywh {540 120 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 minimum -64 maximum 63 step 1
  278. code0 {o->value(pars->VoicePar[nvoice].PFMVolumeDamp-64);}
  279. }
  280. }
  281. Fl_Group modoscil {open
  282. xywh {535 365 220 220}
  283. } {
  284. Fl_Group fmoscil {open
  285. xywh {535 440 220 140} box THIN_DOWN_BOX color 32 selection_color 71 labelcolor 179
  286. code0 {oscFM=new Oscilloscope(o->x(),o->y(),o->w(),o->h(),"");}
  287. code1 {int nv=nvoice; if (pars->VoicePar[nvoice].PextFMoscil>=0) nv=pars->VoicePar[nvoice].PextFMoscil;}
  288. code2 {oscFM->init(pars->VoicePar[nv].FMSmp,0,pars->VoicePar[nvoice].PFMoscilphase,master);}
  289. } {}
  290. Fl_Box {} {
  291. label {Mod.Oscillator}
  292. xywh {535 375 155 20} labelfont 1 align 20
  293. }
  294. Fl_Button changeFMoscilbutton {
  295. label Change
  296. callback {if (oscedit!=NULL) delete(oscedit);
  297. int nv=nvoice;
  298. if (pars->VoicePar[nvoice].PextFMoscil>=0) nv=pars->VoicePar[nvoice].PextFMoscil;
  299. oscedit=new OscilEditor(pars->VoicePar[nv].FMSmp,fmoscil,NULL,NULL,master);}
  300. xywh {700 380 55 15} box THIN_UP_BOX labelfont 1 labelsize 11
  301. code0 {if (pars->VoicePar[nvoice].PextFMoscil>=0) o->labelcolor(FL_BLUE);}
  302. }
  303. Fl_Slider {} {
  304. label Phase
  305. callback {pars->VoicePar[nvoice].PFMoscilphase=64-(int)o->value();
  306. oscFM->phase=64-(int) o->value();
  307. fmoscil->redraw();}
  308. xywh {645 415 105 15} type {Horz Knob} box NO_BOX labelsize 10 align 5 minimum -64 maximum 63 step 1
  309. code0 {o->value(64-pars->VoicePar[nvoice].PFMoscilphase);}
  310. }
  311. Fl_Choice {} {
  312. label Use
  313. callback {pars->VoicePar[nvoice].PextFMoscil=(int)o->value()-1;
  314. if ((int) o->value() != 0) {
  315. oscFM->init(pars->VoicePar[(int) o->value()-1].FMSmp,master);
  316. changeFMoscilbutton->labelcolor(FL_BLUE);
  317. } else {
  318. oscFM->init(pars->VoicePar[nvoice].FMSmp,master);
  319. changeFMoscilbutton->labelcolor(FL_BLACK);
  320. };
  321. voiceFMparametersgroup->redraw();} open
  322. xywh {560 410 75 20} down_box BORDER_BOX labelsize 10 textfont 1 textsize 10
  323. code0 {o->add("Internal");}
  324. code1 {char tmp[50]; for (int i=0;i<nvoice;i++) {sprintf(tmp,"ExtM.%2d",i+1);o->add(tmp);};}
  325. code3 {o->value(pars->VoicePar[nvoice].PextFMoscil+1);}
  326. } {}
  327. }
  328. Fl_Choice {} {
  329. label {External Mod.}
  330. callback {pars->VoicePar[nvoice].PFMVoice=(int)o->value()-1;
  331. if ((int) o->value() != 0) {
  332. modoscil->deactivate();
  333. modfrequency->deactivate();
  334. } else {
  335. modoscil->activate();
  336. modfrequency->activate();
  337. };
  338. voiceFMparametersgroup->redraw();} open
  339. xywh {635 40 85 20} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
  340. code0 {o->add("OFF");}
  341. code1 {char tmp[50]; for (int i=0;i<nvoice;i++) {sprintf(tmp,"ExtMod.%2d",i+1);o->add(tmp);};}
  342. code2 {o->value(pars->VoicePar[nvoice].PFMVoice+1);}
  343. code3 {if ((int) o->value() != 0) {modoscil->deactivate();modfrequency->deactivate();}}
  344. } {}
  345. }
  346. Fl_Choice {} {
  347. label {Type:}
  348. callback {pars->VoicePar[nvoice].PFMEnabled=(int)o->value();
  349. if (o->value()==0) voiceFMparametersgroup->deactivate();
  350. else voiceFMparametersgroup->activate();
  351. o->redraw();}
  352. xywh {535 40 80 20} down_box BORDER_BOX align 5
  353. code0 {o->value(pars->VoicePar[nvoice].PFMEnabled);}
  354. } {
  355. MenuItem {} {
  356. label OFF
  357. xywh {40 40 100 20} labelfont 1
  358. }
  359. MenuItem {} {
  360. label MORPH
  361. xywh {50 50 100 20} labelfont 1
  362. }
  363. MenuItem {} {
  364. label RING
  365. xywh {60 60 100 20} labelfont 1
  366. }
  367. MenuItem {} {
  368. label PM
  369. xywh {70 70 100 20} labelfont 1
  370. }
  371. MenuItem {} {
  372. label FM
  373. xywh {80 80 100 20} labelfont 1
  374. }
  375. MenuItem {} {
  376. label PITCH
  377. xywh {90 90 100 20} labelfont 1 deactivate
  378. }
  379. }
  380. Fl_Group {} {
  381. label FREQUENCY
  382. xywh {5 265 525 120} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  383. } {
  384. Fl_Group voicefreqenvgroup {
  385. label {ADSynth Voice - Frequency Envelope} open
  386. xywh {10 305 205 70} box FLAT_BOX color 51 align 144
  387. code0 {o->init(pars->VoicePar[nvoice].FreqEnvelope);}
  388. code1 {if (pars->VoicePar[nvoice].PFreqEnvelopeEnabled==0) o->deactivate();}
  389. class EnvelopeUI
  390. } {}
  391. Fl_Check_Button {} {
  392. label On
  393. callback {pars->VoicePar[nvoice].PFreqEnvelopeEnabled=(int)o->value();
  394. if (o->value()==0) voicefreqenvgroup->deactivate();
  395. else voicefreqenvgroup->activate();
  396. o->redraw();}
  397. tooltip {Forced Relase} xywh {15 310 50 10} down_box DOWN_BOX labelfont 1 labelsize 11
  398. code0 {o->value(pars->VoicePar[nvoice].PFreqEnvelopeEnabled);}
  399. }
  400. Fl_Group voicefreqlfogroup {
  401. label {Frequency LFO } open
  402. xywh {220 305 230 70} box FLAT_BOX color 47 align 144
  403. code0 {o->init(pars->VoicePar[nvoice].FreqLfo);}
  404. code1 {if (pars->VoicePar[nvoice].PFreqLfoEnabled==0) o->deactivate();}
  405. class LFOUI
  406. } {}
  407. Fl_Check_Button {} {
  408. label On
  409. callback {pars->VoicePar[nvoice].PFreqLfoEnabled=(int)o->value();
  410. if (o->value()==0) voicefreqlfogroup->deactivate();
  411. else voicefreqlfogroup->activate();
  412. o->redraw();}
  413. tooltip {Forced Relase} xywh {225 311 55 10} down_box DOWN_BOX labelfont 1 labelsize 11
  414. code0 {o->value(pars->VoicePar[nvoice].PFreqLfoEnabled);}
  415. }
  416. Fl_Counter {} {
  417. label Octave
  418. callback {int k=(int) o->value();
  419. if (k<0) k+=16;
  420. pars->VoicePar[nvoice].PCoarseDetune = k*1024+
  421. pars->VoicePar[nvoice].PCoarseDetune%1024;}
  422. tooltip Octave xywh {470 285 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
  423. code0 {int k=pars->VoicePar[nvoice].PCoarseDetune/1024;}
  424. code1 {if (k>=8) k-=16;}
  425. code2 {o->value(k);}
  426. }
  427. Fl_Counter {} {
  428. label {Coarse Det.}
  429. callback {int k=(int) o->value();
  430. if (k<0) k+=1024;
  431. pars->VoicePar[nvoice].PCoarseDetune = k+
  432. (pars->VoicePar[nvoice].PCoarseDetune/1024)*1024;}
  433. tooltip {Coarse Detune} xywh {455 355 60 20} labelsize 10 align 1 minimum -64 maximum 63 step 1 textfont 1 textsize 11
  434. code0 {int k=pars->VoicePar[nvoice].PCoarseDetune%1024;}
  435. code1 {if (k>=512) k-=1024;}
  436. code2 {o->value(k);}
  437. code3 {o->lstep(10);}
  438. }
  439. Fl_Slider {} {
  440. callback {pars->VoicePar[nvoice].PDetune=(int)o->value()+8192;
  441. detunevalueoutput->do_callback();}
  442. tooltip {Fine Detune (cents)} xywh {58 287 392 13} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
  443. code0 {o->value(pars->VoicePar[nvoice].PDetune-8192);}
  444. }
  445. Fl_Value_Output detunevalueoutput {
  446. label Detune
  447. callback {o->value(getdetune((pars->VoicePar[nvoice].PDetuneType==0)?(pars->GlobalPar.PDetuneType) : (pars->VoicePar[nvoice].PDetuneType),0,pars->VoicePar[nvoice].PDetune)*pars->getBandwidthDetuneMultiplier());}
  448. xywh {10 287 45 15} labelsize 10 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 10
  449. code0 {o->value(getdetune((pars->VoicePar[nvoice].PDetuneType==0)?(pars->GlobalPar.PDetuneType) : (pars->VoicePar[nvoice].PDetuneType),0,pars->VoicePar[nvoice].PDetune)*pars->getBandwidthDetuneMultiplier());}
  450. }
  451. Fl_Check_Button {} {
  452. label 440Hz
  453. callback {int x=(int) o->value();
  454. pars->VoicePar[nvoice].Pfixedfreq=x;
  455. if (x==0) fixedfreqetdial->deactivate();
  456. else fixedfreqetdial->activate();}
  457. tooltip {Set the voice base frequency to 440Hz} xywh {345 268 55 15} down_box DOWN_BOX labelfont 1 labelsize 11
  458. code0 {o->value(pars->VoicePar[nvoice].Pfixedfreq);}
  459. }
  460. Fl_Dial fixedfreqetdial {
  461. label {Eq.T.}
  462. callback {pars->VoicePar[nvoice].PfixedfreqET=(int) o->value();}
  463. tooltip {How the frequency varies acording to the keyboard (leftmost for fixed frequency)} xywh {405 270 15 15} box ROUND_UP_BOX labelsize 10 align 8 maximum 127 step 1
  464. code0 {o->value(pars->VoicePar[nvoice].PfixedfreqET);}
  465. code1 {if (pars->VoicePar[nvoice].Pfixedfreq==0) o->deactivate();}
  466. class WidgetPDial
  467. }
  468. Fl_Choice {} {
  469. label {Detune Type}
  470. callback {pars->VoicePar[nvoice].PDetuneType=(int) o->value();
  471. detunevalueoutput->do_callback();} open
  472. xywh {455 320 70 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
  473. code0 {o->add("Default");o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
  474. code1 {o->value(pars->VoicePar[nvoice].PDetuneType);}
  475. } {}
  476. }
  477. Fl_Group voiceoscil {
  478. xywh {80 390 445 145} box THIN_DOWN_BOX color 32 selection_color 71 labelcolor 179
  479. code0 {osc=new Oscilloscope(o->x(),o->y(),o->w(),o->h(),"");}
  480. code1 {int nv=nvoice; if (pars->VoicePar[nvoice].Pextoscil>=0) nv=pars->VoicePar[nvoice].Pextoscil;}
  481. code2 {osc->init(pars->VoicePar[nv].OscilSmp,0,pars->VoicePar[nvoice].Poscilphase,master);}
  482. } {}
  483. Fl_Button changevoiceoscilbutton {
  484. label Change
  485. callback {if (oscedit!=NULL) delete(oscedit);
  486. int nv=nvoice;
  487. if (pars->VoicePar[nvoice].Pextoscil>=0) nv=pars->VoicePar[nvoice].Pextoscil;
  488. oscedit=new OscilEditor(pars->VoicePar[nv].OscilSmp,voiceoscil,NULL,NULL,master);}
  489. xywh {5 490 65 20} box THIN_UP_BOX labelfont 1 labelsize 11
  490. code0 {if (pars->VoicePar[nvoice].Pextoscil>=0) o->labelcolor(FL_BLUE);}
  491. }
  492. Fl_Box {} {
  493. label {Voice Oscillator}
  494. xywh {5 390 75 35} labelfont 1 labelsize 12 align 128
  495. }
  496. Fl_Slider {} {
  497. label Phase
  498. callback {pars->VoicePar[nvoice].Poscilphase=64-(int)o->value();
  499. osc->phase=64-(int) o->value();
  500. voiceoscil->redraw();}
  501. xywh {10 435 65 10} type {Horz Knob} box NO_BOX labelsize 10 align 5 minimum -64 maximum 63 step 1
  502. code0 {o->value(64-pars->VoicePar[nvoice].Poscilphase);}
  503. }
  504. Fl_Check_Button {} {
  505. label {R.}
  506. callback {pars->VoicePar[nvoice].Presonance=(int) o->value();}
  507. tooltip {Resonance On/Off} xywh {210 5 35 35} box THIN_UP_BOX down_box DOWN_BOX labelfont 1 labelsize 11
  508. code0 {o->value(pars->VoicePar[nvoice].Presonance);}
  509. }
  510. Fl_Choice {} {
  511. label {Use Oscil.}
  512. callback {pars->VoicePar[nvoice].Pextoscil=(int)o->value()-1;
  513. if ((int) o->value() != 0) {
  514. osc->init(pars->VoicePar[(int) o->value()-1].OscilSmp,master);
  515. changevoiceoscilbutton->labelcolor(FL_BLUE);
  516. } else {
  517. osc->init(pars->VoicePar[nvoice].OscilSmp,master);
  518. changevoiceoscilbutton->labelcolor(FL_BLACK);
  519. };
  520. voiceparametersgroup->redraw();
  521. voiceonbutton->redraw();} open
  522. xywh {5 470 65 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
  523. code0 {o->add("Internal");}
  524. code1 {char tmp[50]; for (int i=0;i<nvoice;i++) {sprintf(tmp,"Ext.%2d",i+1);o->add(tmp);};}
  525. code3 {o->value(pars->VoicePar[nvoice].Pextoscil+1);}
  526. } {}
  527. Fl_Group {} {open
  528. xywh {5 540 515 45} box UP_FRAME
  529. } {
  530. Fl_Dial {} {
  531. label Stereo
  532. callback {pars->VoicePar[nvoice].Unison_stereo_spread=(int)o->value();}
  533. tooltip {Stereo Spread} xywh {285 555 25 30} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  534. code0 {o->value(pars->VoicePar[nvoice].Unison_stereo_spread);}
  535. class WidgetPDial
  536. }
  537. Fl_Choice {} {
  538. label Unison
  539. callback {pars->set_unison_size_index(nvoice,(int) o->value());} open
  540. tooltip {Unison size} xywh {10 560 75 20} down_box BORDER_BOX labelfont 1 align 5 textfont 1 textsize 10
  541. code0 {o->add("OFF");char tmp[100];for (int i=1;ADnote_unison_sizes[i];i++){snprintf(tmp,100,"size %d",ADnote_unison_sizes[i]);o->add(tmp);};}
  542. code1 {o->value(pars->get_unison_size_index(nvoice));}
  543. } {}
  544. Fl_Dial {} {
  545. label Vibratto
  546. callback {pars->VoicePar[nvoice].Unison_vibratto=(int)o->value();}
  547. tooltip Vibratto xywh {340 555 25 30} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  548. code0 {o->value(pars->VoicePar[nvoice].Unison_vibratto);}
  549. class WidgetPDial
  550. }
  551. Fl_Choice {} {
  552. label Invert
  553. callback {pars->VoicePar[nvoice].Unison_invert_phase=(int) o->value();} open
  554. tooltip {Phase Invert} xywh {445 560 65 15} down_box BORDER_BOX labelsize 11 align 5 textfont 1 textsize 10
  555. code0 {o->add("None");o->add("Random");char tmp[100];for (int i=2;i<=5;i++){snprintf(tmp,100,"%d %%",100/i);o->add(tmp);};}
  556. code1 {o->value(pars->VoicePar[nvoice].Unison_invert_phase);}
  557. } {}
  558. Fl_Slider {} {
  559. label {Frequency Spread}
  560. callback {pars->VoicePar[nvoice].Unison_frequency_spread=(int)o->value();
  561. unisonspreadoutput->do_callback();}
  562. tooltip {Frequency Spread of the Unison} xywh {95 562 125 13} type {Horz Knob} box NO_BOX labelsize 12 align 1 maximum 127 step 1 value 64
  563. code0 {o->value(pars->VoicePar[nvoice].Unison_frequency_spread);}
  564. }
  565. Fl_Value_Output unisonspreadoutput {
  566. label {(cents)}
  567. callback {o->value(pars->getUnisonFrequencySpreadCents(nvoice));}
  568. xywh {225 560 40 15} labelsize 10 align 5 maximum 1000 step 0.1 textfont 1 textsize 10
  569. code0 {o->value(pars->getUnisonFrequencySpreadCents(nvoice));}
  570. }
  571. Fl_Dial {} {
  572. label {Vib.speed}
  573. callback {pars->VoicePar[nvoice].Unison_vibratto_speed=(int)o->value();}
  574. tooltip {Vibratto Average Speed} xywh {390 555 25 30} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  575. code0 {o->value(pars->VoicePar[nvoice].Unison_vibratto_speed);}
  576. class WidgetPDial
  577. }
  578. }
  579. }
  580. Fl_Group {} {
  581. label AMPLITUDE open
  582. xywh {5 40 240 220} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  583. } {
  584. Fl_Value_Slider {} {
  585. label Vol
  586. callback {pars->VoicePar[nvoice].PVolume=(int)o->value();}
  587. tooltip Volume xywh {10 60 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  588. code0 {o->value(pars->VoicePar[nvoice].PVolume);}
  589. }
  590. Fl_Value_Slider {} {
  591. label {V.Sns}
  592. callback {pars->VoicePar[nvoice].PAmpVelocityScaleFunction=(int) o->value();}
  593. tooltip {Velocity Sensing Function (rightmost to disable)} xywh {10 80 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  594. code0 {o->value(pars->VoicePar[nvoice].PAmpVelocityScaleFunction);}
  595. }
  596. Fl_Group voiceampenvgroup {
  597. label {ADSynth Voice - Amplitude Envelope} open
  598. xywh {10 105 205 70} box FLAT_BOX color 51 align 144
  599. code0 {o->init(pars->VoicePar[nvoice].AmpEnvelope);}
  600. code1 {if (pars->VoicePar[nvoice].PAmpEnvelopeEnabled==0) o->deactivate();}
  601. class EnvelopeUI
  602. } {}
  603. Fl_Dial {} {
  604. label Pan
  605. callback {pars->VoicePar[nvoice].PPanning=(int) o->value();}
  606. tooltip {Panning (leftmost is Random)} xywh {210 60 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  607. code0 {o->value(pars->VoicePar[nvoice].PPanning);}
  608. class WidgetPDial
  609. }
  610. Fl_Check_Button {} {
  611. label On
  612. callback {pars->VoicePar[nvoice].PAmpEnvelopeEnabled=(int)o->value();
  613. if (o->value()==0) voiceampenvgroup->deactivate();
  614. else voiceampenvgroup->activate();
  615. o->redraw();}
  616. tooltip {Forced Relase} xywh {15 110 50 10} down_box DOWN_BOX labelfont 1 labelsize 11
  617. code0 {o->value(pars->VoicePar[nvoice].PAmpEnvelopeEnabled);}
  618. }
  619. Fl_Group voiceamplfogroup {
  620. label {Amplitude LFO } open
  621. xywh {10 180 230 75} box FLAT_BOX color 47 align 144
  622. code0 {o->init(pars->VoicePar[nvoice].AmpLfo);}
  623. code1 {if (pars->VoicePar[nvoice].PAmpLfoEnabled==0) o->deactivate();}
  624. class LFOUI
  625. } {}
  626. Fl_Check_Button {} {
  627. label On
  628. callback {pars->VoicePar[nvoice].PAmpLfoEnabled=(int)o->value();
  629. if (o->value()==0) voiceamplfogroup->deactivate();
  630. else voiceamplfogroup->activate();
  631. o->redraw();}
  632. tooltip {Forced Relase} xywh {15 185 55 10} down_box DOWN_BOX labelfont 1 labelsize 11
  633. code0 {o->value(pars->VoicePar[nvoice].PAmpLfoEnabled);}
  634. }
  635. Fl_Check_Button {} {
  636. label Minus
  637. callback {pars->VoicePar[nvoice].PVolumeminus=(int)o->value();}
  638. xywh {10 45 50 10} down_box DOWN_BOX labelfont 1 labelsize 10
  639. code0 {o->value(pars->VoicePar[nvoice].PVolumeminus);}
  640. }
  641. }
  642. Fl_Group voicefiltergroup {
  643. label FILTER open
  644. xywh {245 5 285 260} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  645. code0 {if (pars->VoicePar[nvoice].PFilterEnabled==0) o->deactivate();}
  646. } {
  647. Fl_Group {} {
  648. label {ADsynth Voice - Filter} open
  649. xywh {250 30 275 75} box FLAT_BOX color 50 align 144
  650. code0 {o->init(pars->VoicePar[nvoice].VoiceFilter,NULL,NULL);}
  651. class FilterUI
  652. } {}
  653. Fl_Group voicefilterenvgroup {
  654. label {ADSynth Voice - Filter Envelope} open
  655. xywh {250 115 275 70} box FLAT_BOX color 51 align 144
  656. code0 {o->init(pars->VoicePar[nvoice].FilterEnvelope);}
  657. code1 {if (pars->VoicePar[nvoice].PFilterEnvelopeEnabled==0) o->deactivate();}
  658. class EnvelopeUI
  659. } {}
  660. Fl_Check_Button {} {
  661. label On
  662. callback {pars->VoicePar[nvoice].PFilterEnvelopeEnabled=(int)o->value();
  663. if (o->value()==0) voicefilterenvgroup->deactivate();
  664. else voicefilterenvgroup->activate();
  665. o->redraw();}
  666. tooltip {Forced Relase} xywh {255 119 55 10} down_box DOWN_BOX labelfont 1 labelsize 11
  667. code0 {o->value(pars->VoicePar[nvoice].PFilterEnvelopeEnabled);}
  668. }
  669. Fl_Group voicefilterlfogroup {
  670. label {Filter LFO } open
  671. xywh {250 190 230 70} box FLAT_BOX color 47 align 144
  672. code0 {o->init(pars->VoicePar[nvoice].FilterLfo);}
  673. code1 {if (pars->VoicePar[nvoice].PFilterLfoEnabled==0) o->deactivate();}
  674. class LFOUI
  675. } {}
  676. Fl_Check_Button {} {
  677. label On
  678. callback {pars->VoicePar[nvoice].PFilterLfoEnabled=(int)o->value();
  679. if (o->value()==0) voicefilterlfogroup->deactivate();
  680. else voicefilterlfogroup->activate();
  681. o->redraw();}
  682. tooltip {Forced Relase} xywh {255 196 55 10} down_box DOWN_BOX labelfont 1 labelsize 11
  683. code0 {o->value(pars->VoicePar[nvoice].PFilterLfoEnabled);}
  684. }
  685. }
  686. Fl_Group {} {
  687. label 01
  688. xywh {5 5 55 35} box THIN_UP_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 22 align 16
  689. code0 {char tmp[10];snprintf(tmp,10,"%d",nvoice+1);o->label(strdup(tmp));}
  690. } {}
  691. Fl_Choice {} {
  692. callback {int x=(int) o->value();
  693. pars->VoicePar[nvoice].Type=x;
  694. if (x==0) voicemodegroup->activate();
  695. else voicemodegroup->deactivate();
  696. noiselabel->do_callback();}
  697. tooltip {Oscillator Type (sound/noise)} xywh {5 515 65 20} down_box BORDER_BOX labelsize 10 textfont 1 textsize 10
  698. code0 {o->value(pars->VoicePar[nvoice].Type);}
  699. code1 {if (pars->VoicePar[nvoice].Type!=0) voicemodegroup->deactivate();}
  700. } {
  701. MenuItem {} {
  702. label Sound
  703. xywh {5 5 100 20} labelfont 1 labelsize 11
  704. }
  705. MenuItem {} {
  706. label NOISE
  707. xywh {15 15 100 20} labelfont 1 labelsize 11 labelcolor 1
  708. }
  709. }
  710. Fl_Check_Button bypassfiltercheckbutton {
  711. label {Bypass Global F.}
  712. callback {pars->VoicePar[nvoice].Pfilterbypass=(int)o->value();}
  713. xywh {425 10 100 20} down_box DOWN_BOX labelfont 1 labelsize 10 align 148
  714. code0 {o->value(pars->VoicePar[nvoice].Pfilterbypass);}
  715. }
  716. Fl_Group {} {open
  717. xywh {115 5 95 35} box THIN_UP_BOX
  718. } {
  719. Fl_Value_Slider {} {
  720. label Delay
  721. callback {pars->VoicePar[nvoice].PDelay=(int)o->value();}
  722. tooltip Volume xywh {120 21 84 12} type {Horz Knob} box NO_BOX labelsize 11 align 5 maximum 127 step 1
  723. code0 {o->value(pars->VoicePar[nvoice].PDelay);}
  724. }
  725. }
  726. Fl_Check_Button {} {
  727. label On
  728. callback {pars->VoicePar[nvoice].PFilterEnabled=(int)o->value();
  729. if (o->value()==0) voicefiltergroup->deactivate();
  730. else voicefiltergroup->activate();
  731. o->redraw();
  732. bypassfiltercheckbutton->redraw();}
  733. tooltip {Enable Filter} xywh {250 15 60 15} down_box DOWN_BOX labelfont 1 labelsize 11
  734. code0 {o->value(pars->VoicePar[nvoice].PFilterEnabled);}
  735. }
  736. Fl_Box noiselabel {
  737. label {White Noise}
  738. callback {if (pars->VoicePar[nvoice].Type==0) o->hide(); else o->show();}
  739. xywh {150 430 300 65} labelfont 1 labelsize 50 labelcolor 7
  740. code0 {if (pars->VoicePar[nvoice].Type==0) o->hide(); else o->show();}
  741. }
  742. }
  743. Fl_Check_Button voiceonbutton {
  744. label On
  745. callback {pars->VoicePar[nvoice].Enabled=(int)o->value();
  746. if (o->value()==0) voiceparametersgroup->deactivate();
  747. else voiceparametersgroup->activate();
  748. o->redraw();}
  749. xywh {60 5 55 35} box THIN_UP_BOX down_box DOWN_BOX labelfont 1 labelsize 13
  750. code0 {o->value(pars->VoicePar[nvoice].Enabled);}
  751. }
  752. }
  753. }
  754. Function {ADvoiceUI(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
  755. code {nvoice=0;
  756. pars=NULL;
  757. oscedit=NULL;} {}
  758. }
  759. Function {init(ADnoteParameters *parameters,int nvoice_,Master *master_)} {open
  760. } {
  761. code {pars=parameters;
  762. nvoice=nvoice_;
  763. master=master_;
  764. make_window();
  765. end();
  766. ADnoteVoiceParameters->show();} {}
  767. }
  768. Function {~ADvoiceUI()} {open
  769. } {
  770. code {ADnoteVoiceParameters->hide();
  771. hide();
  772. if (oscedit!=NULL) {
  773. delete(oscedit);
  774. };
  775. //delete (ADnoteVoiceParameters);} {}
  776. }
  777. decl {int nvoice;} {}
  778. decl {ADnoteParameters *pars;} {}
  779. decl {OscilEditor *oscedit;} {}
  780. decl {Oscilloscope *osc;} {}
  781. decl {Oscilloscope *oscFM;} {}
  782. decl {Master *master;} {}
  783. }
  784. class ADnoteUI {open : {public PresetsUI_}
  785. } {
  786. Function {make_window()} {open private
  787. } {
  788. Fl_Window ADnoteGlobalParameters {
  789. label {ADsynth Global Parameters of the Instrument} open
  790. xywh {457 319 540 430} type Double visible
  791. } {
  792. Fl_Group {} {
  793. label FREQUENCY open
  794. xywh {5 280 530 115} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  795. } {
  796. Fl_Group freqenv {
  797. label {ADSynth Global - Frequency Envelope} open
  798. xywh {10 320 205 70} box FLAT_BOX color 51 align 144
  799. code0 {o->init(pars->GlobalPar.FreqEnvelope);}
  800. class EnvelopeUI
  801. } {}
  802. Fl_Counter octave {
  803. label Octave
  804. callback {int k=(int) o->value();
  805. if (k<0) k+=16;
  806. pars->GlobalPar.PCoarseDetune = k*1024+
  807. pars->GlobalPar.PCoarseDetune%1024;}
  808. tooltip Octave xywh {455 300 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
  809. code0 {int k=pars->GlobalPar.PCoarseDetune/1024;if (k>=8) k-=16;}
  810. code2 {o->value(k);}
  811. }
  812. Fl_Counter coarsedet {
  813. label {Coarse det.}
  814. callback {int k=(int) o->value();
  815. if (k<0) k+=1024;
  816. pars->GlobalPar.PCoarseDetune = k+
  817. (pars->GlobalPar.PCoarseDetune/1024)*1024;}
  818. tooltip {Coarse Detune} xywh {460 370 60 20} type Simple labelsize 10 align 5 minimum -64 maximum 63 step 1 textfont 1 textsize 11
  819. code0 {int k=pars->GlobalPar.PCoarseDetune%1024;if (k>=512) k-=1024;}
  820. code2 {o->value(k);}
  821. code3 {o->lstep(10);}
  822. }
  823. Fl_Group freqlfo {
  824. label {Frequency LFO } open
  825. xywh {220 320 230 70} box FLAT_BOX color 47 align 144
  826. code0 {o->init(pars->GlobalPar.FreqLfo);}
  827. class LFOUI
  828. } {}
  829. Fl_Slider freq {
  830. callback {pars->GlobalPar.PDetune=(int)o->value()+8192;
  831. detunevalueoutput->do_callback();}
  832. tooltip {Fine Detune (cents)} xywh {60 300 385 15} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
  833. code0 {o->value(pars->GlobalPar.PDetune-8192);}
  834. }
  835. Fl_Value_Output detunevalueoutput {
  836. label Detune
  837. callback {o->value(getdetune(pars->GlobalPar.PDetuneType,0,pars->GlobalPar.PDetune));}
  838. xywh {12 300 45 15} labelsize 10 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 10
  839. code0 {o->value(getdetune(pars->GlobalPar.PDetuneType,0,pars->GlobalPar.PDetune));}
  840. }
  841. Fl_Choice detunetype {
  842. label {Detune Type}
  843. callback {pars->GlobalPar.PDetuneType=(int) o->value()+1;
  844. detunevalueoutput->do_callback();} open
  845. xywh {455 340 75 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
  846. code0 {o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
  847. code1 {o->value(pars->GlobalPar.PDetuneType-1);}
  848. } {}
  849. Fl_Dial {} {
  850. label relBW
  851. callback {pars->GlobalPar.PBandwidth=(int) o->value();
  852. pars->getBandwidthDetuneMultiplier();
  853. for (int i=0;i<NUM_VOICES;i++){
  854. voicelistitem[i]->refreshlist();
  855. };}
  856. tooltip {Bandwidth - how the relative fine detune of the voice are changed} xywh {505 295 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  857. code0 {o->value(pars->GlobalPar.PBandwidth);}
  858. class WidgetPDial
  859. }
  860. }
  861. Fl_Group {} {
  862. label AMPLITUDE
  863. xywh {5 5 240 260} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  864. } {
  865. Fl_Value_Slider volume {
  866. label Vol
  867. callback {pars->GlobalPar.PVolume=(int)o->value();}
  868. tooltip Volume xywh {10 30 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  869. code0 {o->value(pars->GlobalPar.PVolume);}
  870. }
  871. Fl_Value_Slider vsns {
  872. label {V.Sns}
  873. callback {pars->GlobalPar.PAmpVelocityScaleFunction=(int) o->value();}
  874. tooltip {Velocity Sensing Function (rightmost to disable)} xywh {10 50 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  875. code0 {o->value(pars->GlobalPar.PAmpVelocityScaleFunction);}
  876. }
  877. Fl_Dial pan {
  878. label Pan
  879. callback {pars->GlobalPar.PPanning=(int) o->value();}
  880. tooltip {Panning (leftmost is Random)} xywh {210 25 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  881. code0 {o->value(pars->GlobalPar.PPanning);}
  882. class WidgetPDial
  883. }
  884. Fl_Dial pstr {
  885. label {P.Str.}
  886. callback {pars->GlobalPar.PPunchStrength=(int) o->value();}
  887. tooltip {Punch Strength} xywh {125 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  888. code0 {o->value(pars->GlobalPar.PPunchStrength);}
  889. class WidgetPDial
  890. }
  891. Fl_Dial pt {
  892. label {P.t.}
  893. callback {pars->GlobalPar.PPunchTime=(int) o->value();}
  894. tooltip {Punch Time (duration)} xywh {155 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  895. code0 {o->value(pars->GlobalPar.PPunchTime);}
  896. class WidgetPDial
  897. }
  898. Fl_Dial pstc {
  899. label {P.Stc.}
  900. callback {pars->GlobalPar.PPunchStretch=(int) o->value();}
  901. tooltip {Punch Stretch} xywh {185 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  902. code0 {o->value(pars->GlobalPar.PPunchStretch);}
  903. class WidgetPDial
  904. }
  905. Fl_Dial pvel {
  906. label {P.Vel.}
  907. callback {pars->GlobalPar.PPunchVelocitySensing=(int) o->value();}
  908. tooltip {Punch Velocity Sensing} xywh {215 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  909. code0 {o->value(pars->GlobalPar.PPunchVelocitySensing);}
  910. class WidgetPDial
  911. }
  912. Fl_Group ampenv {
  913. label {ADSynth Global - Amplitude Envelope} open
  914. xywh {10 75 205 70} box FLAT_BOX color 51 align 144
  915. code0 {o->init(pars->GlobalPar.AmpEnvelope);}
  916. class EnvelopeUI
  917. } {}
  918. Fl_Group amplfo {
  919. label {Amplitude LFO } open
  920. xywh {10 150 230 70} box FLAT_BOX color 47 align 144
  921. code0 {o->init(pars->GlobalPar.AmpLfo);}
  922. class LFOUI
  923. } {}
  924. Fl_Check_Button rndgrp {
  925. label {Rnd Grp}
  926. callback {pars->GlobalPar.Hrandgrouping=(int) o->value();}
  927. tooltip {How the Harmonic Amplitude is applied to voices that use the same oscillator} xywh {70 235 40 25} down_box DOWN_BOX labelsize 10 align 148
  928. code0 {o->value(pars->GlobalPar.Hrandgrouping);}
  929. }
  930. }
  931. Fl_Group {} {
  932. label FILTER open selected
  933. xywh {250 5 285 265} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  934. } {
  935. Fl_Group filterenv {
  936. label {ADSynth Global - Filter Envelope} open
  937. xywh {255 118 275 70} box FLAT_BOX color 51 align 144
  938. code0 {o->init(pars->GlobalPar.FilterEnvelope);}
  939. class EnvelopeUI
  940. } {}
  941. Fl_Group filterlfo {
  942. label {Filter LFO} open
  943. xywh {255 195 230 70} box FLAT_BOX color 47 align 144
  944. code0 {o->init(pars->GlobalPar.FilterLfo);}
  945. class LFOUI
  946. } {}
  947. Fl_Group filterui {
  948. label {ADsynth Global - Filter} open
  949. xywh {255 35 275 75} box FLAT_BOX color 50 align 144
  950. code0 {o->init(pars->GlobalPar.GlobalFilter,&pars->GlobalPar.PFilterVelocityScale,&pars->GlobalPar.PFilterVelocityScaleFunction);}
  951. class FilterUI
  952. } {}
  953. }
  954. Fl_Check_Button stereo {
  955. label Stereo
  956. callback {pars->GlobalPar.PStereo=(int) o->value();}
  957. xywh {5 230 65 35} down_box DOWN_BOX labelsize 11
  958. code0 {o->value(pars->GlobalPar.PStereo);}
  959. }
  960. Fl_Button {} {
  961. label {Show Voice List}
  962. callback {for (int i=0;i<NUM_VOICES;i++){
  963. voicelistitem[i]->refreshlist();
  964. }
  965. ADnoteVoiceList->show();}
  966. xywh {180 400 125 25} labelsize 12
  967. }
  968. Fl_Button {} {
  969. label {Show Voice Parameters}
  970. callback {ADnoteVoice->show();}
  971. xywh {5 400 170 25} labelsize 12
  972. }
  973. Fl_Button {} {
  974. label Close
  975. callback {ADnoteGlobalParameters->hide();}
  976. xywh {475 400 60 25} box THIN_UP_BOX
  977. }
  978. Fl_Button {} {
  979. label Resonance
  980. callback {resui->resonancewindow->redraw();
  981. resui->resonancewindow->show();}
  982. tooltip Resonance xywh {309 400 86 25} box THIN_UP_BOX labelsize 12
  983. }
  984. Fl_Button {} {
  985. label C
  986. callback {presetsui->copy(pars);}
  987. xywh {405 405 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
  988. }
  989. Fl_Button {} {
  990. label P
  991. callback {presetsui->paste(pars,this);}
  992. xywh {435 405 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
  993. }
  994. }
  995. Fl_Window ADnoteVoice {
  996. label {ADsynth Voice Parameters} open
  997. xywh {512 361 765 620} type Double visible
  998. } {
  999. Fl_Group advoice {
  1000. xywh {0 0 765 585}
  1001. code0 {o->init(pars,nvoice,master);}
  1002. code1 {o->show();}
  1003. class ADvoiceUI
  1004. } {}
  1005. Fl_Button {} {
  1006. label {Close Window}
  1007. callback {ADnoteVoice->hide();}
  1008. xywh {305 590 195 25} box THIN_UP_BOX labelfont 1
  1009. }
  1010. Fl_Counter currentvoicecounter {
  1011. label {Current Voice}
  1012. callback {nvoice=(int)o->value()-1;
  1013. advoice->hide();
  1014. ADnoteVoice->remove(advoice);
  1015. delete advoice;
  1016. advoice=new ADvoiceUI(0,0,765,585);
  1017. ADnoteVoice->add(advoice);
  1018. advoice->init(pars,nvoice,master);
  1019. advoice->show();
  1020. ADnoteVoice->redraw();}
  1021. xywh {10 590 130 25} type Simple labelfont 1 align 8 minimum 0 maximum 2 step 1 value 1 textfont 1 textsize 13
  1022. code0 {o->bounds(1,NUM_VOICES);}
  1023. }
  1024. Fl_Button {} {
  1025. label C
  1026. callback {presetsui->copy(pars,nvoice);}
  1027. xywh {705 595 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
  1028. }
  1029. Fl_Button {} {
  1030. label P
  1031. callback {presetsui->paste(pars,this,nvoice);}
  1032. xywh {735 595 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
  1033. }
  1034. }
  1035. Fl_Window ADnoteVoiceList {
  1036. label {ADsynth Voices list}
  1037. xywh {32 266 650 260} type Double hide
  1038. } {
  1039. Fl_Text_Display {} {
  1040. label {No.}
  1041. xywh {10 15 30 10} box NO_BOX labelfont 1 labelsize 11
  1042. }
  1043. Fl_Text_Display {} {
  1044. label Vol
  1045. xywh {145 15 30 10} box NO_BOX labelfont 1 labelsize 11
  1046. }
  1047. Fl_Text_Display {} {
  1048. label Detune
  1049. xywh {384 15 25 10} box NO_BOX labelfont 1 labelsize 11
  1050. }
  1051. Fl_Text_Display {} {
  1052. label Pan
  1053. xywh {210 15 30 10} box NO_BOX labelfont 1 labelsize 11
  1054. }
  1055. Fl_Text_Display {} {
  1056. label {Vib. Depth}
  1057. xywh {560 15 30 10} box NO_BOX labelfont 1 labelsize 11
  1058. }
  1059. Fl_Text_Display {} {
  1060. label {R.}
  1061. xywh {245 15 25 10} box NO_BOX labelfont 1 labelsize 11
  1062. }
  1063. Fl_Button {} {
  1064. label {Hide Voice List}
  1065. callback {ADnoteVoiceList->hide();}
  1066. xywh {255 237 125 20}
  1067. }
  1068. Fl_Scroll {} {open
  1069. xywh {0 15 640 220} type VERTICAL box THIN_UP_BOX
  1070. } {
  1071. Fl_Pack {} {open
  1072. xywh {0 20 620 210}
  1073. code0 {for (int i=0;i<NUM_VOICES;i++){voicelistitem[i]=new ADvoicelistitem(0,0,620,25,"");voicelistitem[i]->init(pars,i,master);}}
  1074. } {}
  1075. }
  1076. }
  1077. }
  1078. Function {ADnoteUI(ADnoteParameters *parameters,Master *master_)} {} {
  1079. code {pars=parameters;
  1080. master=master_;
  1081. nvoice=0;
  1082. resui=new ResonanceUI(pars->GlobalPar.Reson);
  1083. make_window();} {}
  1084. }
  1085. Function {~ADnoteUI()} {} {
  1086. code {ADnoteVoiceList->hide();
  1087. ADnoteGlobalParameters->hide();
  1088. ADnoteVoice->hide();
  1089. delete(ADnoteVoiceList);
  1090. delete(ADnoteGlobalParameters);
  1091. delete(ADnoteVoice);
  1092. delete(resui);} {}
  1093. }
  1094. Function {refresh()} {} {
  1095. code {volume->value(pars->GlobalPar.PVolume);
  1096. vsns->value(pars->GlobalPar.PAmpVelocityScaleFunction);
  1097. pan->value(pars->GlobalPar.PPanning);
  1098. stereo->value(pars->GlobalPar.PStereo);
  1099. rndgrp->value(pars->GlobalPar.Hrandgrouping);
  1100. pstr->value(pars->GlobalPar.PPunchStrength);
  1101. pt->value(pars->GlobalPar.PPunchTime);
  1102. pstc->value(pars->GlobalPar.PPunchStretch);
  1103. pvel->value(pars->GlobalPar.PPunchVelocitySensing);
  1104. detunevalueoutput->value(getdetune(pars->GlobalPar.PDetuneType,0,pars->GlobalPar.PDetune));
  1105. freq->value(pars->GlobalPar.PDetune-8192);
  1106. int k=pars->GlobalPar.PCoarseDetune/1024;if (k>=8) k-=16;
  1107. octave->value(k);
  1108. detunetype->value(pars->GlobalPar.PDetuneType-1);
  1109. k=pars->GlobalPar.PCoarseDetune%1024;if (k>=512) k-=1024;
  1110. coarsedet->value(k);
  1111. amplfo->refresh();
  1112. freqlfo->refresh();
  1113. filterlfo->refresh();
  1114. ampenv->refresh();
  1115. freqenv->refresh();
  1116. filterenv->refresh();
  1117. filterui->refresh();
  1118. for (int i=0;i<NUM_VOICES;i++) voicelistitem[i]->refreshlist();
  1119. resui->refresh();
  1120. currentvoicecounter->do_callback();} {}
  1121. }
  1122. decl {ADnoteParameters *pars;} {}
  1123. decl {ResonanceUI *resui;} {}
  1124. decl {Master *master;} {}
  1125. decl {int nvoice;} {}
  1126. decl {ADvoicelistitem *voicelistitem[NUM_VOICES];} {}
  1127. }