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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169
  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 53
  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 {863 89 765 595} type Double box NO_BOX
  163. class Fl_Group visible
  164. } {
  165. Fl_Group voiceparametersgroup {open
  166. xywh {0 0 770 590} color 48
  167. code0 {if (pars->VoicePar[nvoice].Enabled==0) o->deactivate();}
  168. } {
  169. Fl_Group voicemodegroup {open
  170. xywh {0 5 770 585} 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 520 50} 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 {322 555 25 25} 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 Vibrato
  546. callback {pars->VoicePar[nvoice].Unison_vibratto=(int)o->value();}
  547. tooltip Vibrato xywh {364 555 25 25} 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 {V.speed}
  573. callback {pars->VoicePar[nvoice].Unison_vibratto_speed=(int)o->value();} selected
  574. tooltip {Vibrato Average Speed} xywh {406 555 25 25} 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. Fl_Dial {} {
  579. label {Ph.rand}
  580. callback {pars->VoicePar[nvoice].Unison_phase_randomness=(int)o->value();}
  581. tooltip {Phase randomness} xywh {280 555 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  582. code0 {o->value(pars->VoicePar[nvoice].Unison_phase_randomness);}
  583. class WidgetPDial
  584. }
  585. }
  586. }
  587. Fl_Group {} {
  588. label AMPLITUDE open
  589. xywh {5 40 240 220} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  590. } {
  591. Fl_Value_Slider {} {
  592. label Vol
  593. callback {pars->VoicePar[nvoice].PVolume=(int)o->value();}
  594. tooltip Volume xywh {10 60 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  595. code0 {o->value(pars->VoicePar[nvoice].PVolume);}
  596. }
  597. Fl_Value_Slider {} {
  598. label {V.Sns}
  599. callback {pars->VoicePar[nvoice].PAmpVelocityScaleFunction=(int) o->value();}
  600. 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
  601. code0 {o->value(pars->VoicePar[nvoice].PAmpVelocityScaleFunction);}
  602. }
  603. Fl_Group voiceampenvgroup {
  604. label {ADSynth Voice - Amplitude Envelope} open
  605. xywh {10 105 205 70} box FLAT_BOX color 51 align 144
  606. code0 {o->init(pars->VoicePar[nvoice].AmpEnvelope);}
  607. code1 {if (pars->VoicePar[nvoice].PAmpEnvelopeEnabled==0) o->deactivate();}
  608. class EnvelopeUI
  609. } {}
  610. Fl_Dial {} {
  611. label Pan
  612. callback {pars->VoicePar[nvoice].PPanning=(int) o->value();}
  613. tooltip {Panning (leftmost is Random)} xywh {210 60 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  614. code0 {o->value(pars->VoicePar[nvoice].PPanning);}
  615. class WidgetPDial
  616. }
  617. Fl_Check_Button {} {
  618. label On
  619. callback {pars->VoicePar[nvoice].PAmpEnvelopeEnabled=(int)o->value();
  620. if (o->value()==0) voiceampenvgroup->deactivate();
  621. else voiceampenvgroup->activate();
  622. o->redraw();}
  623. tooltip {Forced Relase} xywh {15 110 50 10} down_box DOWN_BOX labelfont 1 labelsize 11
  624. code0 {o->value(pars->VoicePar[nvoice].PAmpEnvelopeEnabled);}
  625. }
  626. Fl_Group voiceamplfogroup {
  627. label {Amplitude LFO } open
  628. xywh {10 180 230 75} box FLAT_BOX color 47 align 144
  629. code0 {o->init(pars->VoicePar[nvoice].AmpLfo);}
  630. code1 {if (pars->VoicePar[nvoice].PAmpLfoEnabled==0) o->deactivate();}
  631. class LFOUI
  632. } {}
  633. Fl_Check_Button {} {
  634. label On
  635. callback {pars->VoicePar[nvoice].PAmpLfoEnabled=(int)o->value();
  636. if (o->value()==0) voiceamplfogroup->deactivate();
  637. else voiceamplfogroup->activate();
  638. o->redraw();}
  639. tooltip {Forced Relase} xywh {15 185 55 10} down_box DOWN_BOX labelfont 1 labelsize 11
  640. code0 {o->value(pars->VoicePar[nvoice].PAmpLfoEnabled);}
  641. }
  642. Fl_Check_Button {} {
  643. label Minus
  644. callback {pars->VoicePar[nvoice].PVolumeminus=(int)o->value();}
  645. xywh {10 45 50 10} down_box DOWN_BOX labelfont 1 labelsize 10
  646. code0 {o->value(pars->VoicePar[nvoice].PVolumeminus);}
  647. }
  648. }
  649. Fl_Group voicefiltergroup {
  650. label FILTER open
  651. xywh {245 5 285 260} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  652. code0 {if (pars->VoicePar[nvoice].PFilterEnabled==0) o->deactivate();}
  653. } {
  654. Fl_Group {} {
  655. label {ADsynth Voice - Filter} open
  656. xywh {250 30 275 75} box FLAT_BOX color 50 align 144
  657. code0 {o->init(pars->VoicePar[nvoice].VoiceFilter,NULL,NULL);}
  658. class FilterUI
  659. } {}
  660. Fl_Group voicefilterenvgroup {
  661. label {ADSynth Voice - Filter Envelope} open
  662. xywh {250 115 275 70} box FLAT_BOX color 51 align 144
  663. code0 {o->init(pars->VoicePar[nvoice].FilterEnvelope);}
  664. code1 {if (pars->VoicePar[nvoice].PFilterEnvelopeEnabled==0) o->deactivate();}
  665. class EnvelopeUI
  666. } {}
  667. Fl_Check_Button {} {
  668. label On
  669. callback {pars->VoicePar[nvoice].PFilterEnvelopeEnabled=(int)o->value();
  670. if (o->value()==0) voicefilterenvgroup->deactivate();
  671. else voicefilterenvgroup->activate();
  672. o->redraw();}
  673. tooltip {Forced Relase} xywh {255 119 55 10} down_box DOWN_BOX labelfont 1 labelsize 11
  674. code0 {o->value(pars->VoicePar[nvoice].PFilterEnvelopeEnabled);}
  675. }
  676. Fl_Group voicefilterlfogroup {
  677. label {Filter LFO } open
  678. xywh {250 190 230 70} box FLAT_BOX color 47 align 144
  679. code0 {o->init(pars->VoicePar[nvoice].FilterLfo);}
  680. code1 {if (pars->VoicePar[nvoice].PFilterLfoEnabled==0) o->deactivate();}
  681. class LFOUI
  682. } {}
  683. Fl_Check_Button {} {
  684. label On
  685. callback {pars->VoicePar[nvoice].PFilterLfoEnabled=(int)o->value();
  686. if (o->value()==0) voicefilterlfogroup->deactivate();
  687. else voicefilterlfogroup->activate();
  688. o->redraw();}
  689. tooltip {Forced Relase} xywh {255 196 55 10} down_box DOWN_BOX labelfont 1 labelsize 11
  690. code0 {o->value(pars->VoicePar[nvoice].PFilterLfoEnabled);}
  691. }
  692. }
  693. Fl_Group {} {
  694. label 01
  695. xywh {5 5 55 35} box THIN_UP_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 22 align 16
  696. code0 {char tmp[10];snprintf(tmp,10,"%d",nvoice+1);o->label(strdup(tmp));}
  697. } {}
  698. Fl_Choice {} {
  699. callback {int x=(int) o->value();
  700. pars->VoicePar[nvoice].Type=x;
  701. if (x==0) voicemodegroup->activate();
  702. else voicemodegroup->deactivate();
  703. noiselabel->do_callback();}
  704. tooltip {Oscillator Type (sound/noise)} xywh {5 515 65 20} down_box BORDER_BOX labelsize 10 textfont 1 textsize 10
  705. code0 {o->value(pars->VoicePar[nvoice].Type);}
  706. code1 {if (pars->VoicePar[nvoice].Type!=0) voicemodegroup->deactivate();}
  707. } {
  708. MenuItem {} {
  709. label Sound
  710. xywh {5 5 100 20} labelfont 1 labelsize 11
  711. }
  712. MenuItem {} {
  713. label NOISE
  714. xywh {15 15 100 20} labelfont 1 labelsize 11 labelcolor 1
  715. }
  716. }
  717. Fl_Check_Button bypassfiltercheckbutton {
  718. label {Bypass Global F.}
  719. callback {pars->VoicePar[nvoice].Pfilterbypass=(int)o->value();}
  720. xywh {425 10 100 20} down_box DOWN_BOX labelfont 1 labelsize 10 align 148
  721. code0 {o->value(pars->VoicePar[nvoice].Pfilterbypass);}
  722. }
  723. Fl_Group {} {open
  724. xywh {115 5 95 35} box THIN_UP_BOX
  725. } {
  726. Fl_Value_Slider {} {
  727. label Delay
  728. callback {pars->VoicePar[nvoice].PDelay=(int)o->value();}
  729. tooltip Volume xywh {120 21 84 12} type {Horz Knob} box NO_BOX labelsize 11 align 5 maximum 127 step 1
  730. code0 {o->value(pars->VoicePar[nvoice].PDelay);}
  731. }
  732. }
  733. Fl_Check_Button {} {
  734. label On
  735. callback {pars->VoicePar[nvoice].PFilterEnabled=(int)o->value();
  736. if (o->value()==0) voicefiltergroup->deactivate();
  737. else voicefiltergroup->activate();
  738. o->redraw();
  739. bypassfiltercheckbutton->redraw();}
  740. tooltip {Enable Filter} xywh {250 15 60 15} down_box DOWN_BOX labelfont 1 labelsize 11
  741. code0 {o->value(pars->VoicePar[nvoice].PFilterEnabled);}
  742. }
  743. Fl_Box noiselabel {
  744. label {White Noise}
  745. callback {if (pars->VoicePar[nvoice].Type==0) o->hide(); else o->show();}
  746. xywh {150 430 300 65} labelfont 1 labelsize 50 labelcolor 53
  747. code0 {if (pars->VoicePar[nvoice].Type==0) o->hide(); else o->show();}
  748. }
  749. }
  750. Fl_Check_Button voiceonbutton {
  751. label On
  752. callback {pars->VoicePar[nvoice].Enabled=(int)o->value();
  753. if (o->value()==0) voiceparametersgroup->deactivate();
  754. else voiceparametersgroup->activate();
  755. o->redraw();}
  756. xywh {60 5 55 35} box THIN_UP_BOX down_box DOWN_BOX labelfont 1 labelsize 13
  757. code0 {o->value(pars->VoicePar[nvoice].Enabled);}
  758. }
  759. }
  760. }
  761. Function {ADvoiceUI(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {} {
  762. code {nvoice=0;
  763. pars=NULL;
  764. oscedit=NULL;} {}
  765. }
  766. Function {init(ADnoteParameters *parameters,int nvoice_,Master *master_)} {open
  767. } {
  768. code {pars=parameters;
  769. nvoice=nvoice_;
  770. master=master_;
  771. make_window();
  772. end();
  773. ADnoteVoiceParameters->show();} {}
  774. }
  775. Function {~ADvoiceUI()} {open
  776. } {
  777. code {ADnoteVoiceParameters->hide();
  778. hide();
  779. if (oscedit!=NULL) {
  780. delete(oscedit);
  781. };
  782. //delete (ADnoteVoiceParameters);} {}
  783. }
  784. decl {int nvoice;} {}
  785. decl {ADnoteParameters *pars;} {}
  786. decl {OscilEditor *oscedit;} {}
  787. decl {Oscilloscope *osc;} {}
  788. decl {Oscilloscope *oscFM;} {}
  789. decl {Master *master;} {}
  790. }
  791. class ADnoteUI {open : {public PresetsUI_}
  792. } {
  793. Function {make_window()} {open private
  794. } {
  795. Fl_Window ADnoteGlobalParameters {
  796. label {ADsynth Global Parameters of the Instrument} open
  797. xywh {457 319 540 430} type Double visible
  798. } {
  799. Fl_Group {} {
  800. label FREQUENCY open
  801. xywh {5 280 530 115} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  802. } {
  803. Fl_Group freqenv {
  804. label {ADSynth Global - Frequency Envelope} open
  805. xywh {10 320 205 70} box FLAT_BOX color 51 align 144
  806. code0 {o->init(pars->GlobalPar.FreqEnvelope);}
  807. class EnvelopeUI
  808. } {}
  809. Fl_Counter octave {
  810. label Octave
  811. callback {int k=(int) o->value();
  812. if (k<0) k+=16;
  813. pars->GlobalPar.PCoarseDetune = k*1024+
  814. pars->GlobalPar.PCoarseDetune%1024;}
  815. tooltip Octave xywh {455 300 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
  816. code0 {int k=pars->GlobalPar.PCoarseDetune/1024;if (k>=8) k-=16;}
  817. code2 {o->value(k);}
  818. }
  819. Fl_Counter coarsedet {
  820. label {Coarse det.}
  821. callback {int k=(int) o->value();
  822. if (k<0) k+=1024;
  823. pars->GlobalPar.PCoarseDetune = k+
  824. (pars->GlobalPar.PCoarseDetune/1024)*1024;}
  825. tooltip {Coarse Detune} xywh {460 370 60 20} type Simple labelsize 10 align 5 minimum -64 maximum 63 step 1 textfont 1 textsize 11
  826. code0 {int k=pars->GlobalPar.PCoarseDetune%1024;if (k>=512) k-=1024;}
  827. code2 {o->value(k);}
  828. code3 {o->lstep(10);}
  829. }
  830. Fl_Group freqlfo {
  831. label {Frequency LFO } open
  832. xywh {220 320 230 70} box FLAT_BOX color 47 align 144
  833. code0 {o->init(pars->GlobalPar.FreqLfo);}
  834. class LFOUI
  835. } {}
  836. Fl_Slider freq {
  837. callback {pars->GlobalPar.PDetune=(int)o->value()+8192;
  838. detunevalueoutput->do_callback();}
  839. tooltip {Fine Detune (cents)} xywh {60 300 385 15} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
  840. code0 {o->value(pars->GlobalPar.PDetune-8192);}
  841. }
  842. Fl_Value_Output detunevalueoutput {
  843. label Detune
  844. callback {o->value(getdetune(pars->GlobalPar.PDetuneType,0,pars->GlobalPar.PDetune));}
  845. xywh {12 300 45 15} labelsize 10 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 10
  846. code0 {o->value(getdetune(pars->GlobalPar.PDetuneType,0,pars->GlobalPar.PDetune));}
  847. }
  848. Fl_Choice detunetype {
  849. label {Detune Type}
  850. callback {pars->GlobalPar.PDetuneType=(int) o->value()+1;
  851. detunevalueoutput->do_callback();} open
  852. xywh {455 340 75 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
  853. code0 {o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
  854. code1 {o->value(pars->GlobalPar.PDetuneType-1);}
  855. } {}
  856. Fl_Dial {} {
  857. label relBW
  858. callback {pars->GlobalPar.PBandwidth=(int) o->value();
  859. pars->getBandwidthDetuneMultiplier();
  860. for (int i=0;i<NUM_VOICES;i++){
  861. voicelistitem[i]->refreshlist();
  862. };}
  863. 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
  864. code0 {o->value(pars->GlobalPar.PBandwidth);}
  865. class WidgetPDial
  866. }
  867. }
  868. Fl_Group {} {
  869. label AMPLITUDE
  870. xywh {5 5 240 260} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  871. } {
  872. Fl_Value_Slider volume {
  873. label Vol
  874. callback {pars->GlobalPar.PVolume=(int)o->value();}
  875. tooltip Volume xywh {10 30 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
  876. code0 {o->value(pars->GlobalPar.PVolume);}
  877. }
  878. Fl_Value_Slider vsns {
  879. label {V.Sns}
  880. callback {pars->GlobalPar.PAmpVelocityScaleFunction=(int) o->value();}
  881. 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
  882. code0 {o->value(pars->GlobalPar.PAmpVelocityScaleFunction);}
  883. }
  884. Fl_Dial pan {
  885. label Pan
  886. callback {pars->GlobalPar.PPanning=(int) o->value();}
  887. tooltip {Panning (leftmost is Random)} xywh {210 25 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
  888. code0 {o->value(pars->GlobalPar.PPanning);}
  889. class WidgetPDial
  890. }
  891. Fl_Dial pstr {
  892. label {P.Str.}
  893. callback {pars->GlobalPar.PPunchStrength=(int) o->value();}
  894. tooltip {Punch Strength} xywh {125 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  895. code0 {o->value(pars->GlobalPar.PPunchStrength);}
  896. class WidgetPDial
  897. }
  898. Fl_Dial pt {
  899. label {P.t.}
  900. callback {pars->GlobalPar.PPunchTime=(int) o->value();}
  901. tooltip {Punch Time (duration)} xywh {155 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  902. code0 {o->value(pars->GlobalPar.PPunchTime);}
  903. class WidgetPDial
  904. }
  905. Fl_Dial pstc {
  906. label {P.Stc.}
  907. callback {pars->GlobalPar.PPunchStretch=(int) o->value();}
  908. tooltip {Punch Stretch} xywh {185 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  909. code0 {o->value(pars->GlobalPar.PPunchStretch);}
  910. class WidgetPDial
  911. }
  912. Fl_Dial pvel {
  913. label {P.Vel.}
  914. callback {pars->GlobalPar.PPunchVelocitySensing=(int) o->value();}
  915. tooltip {Punch Velocity Sensing} xywh {215 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
  916. code0 {o->value(pars->GlobalPar.PPunchVelocitySensing);}
  917. class WidgetPDial
  918. }
  919. Fl_Group ampenv {
  920. label {ADSynth Global - Amplitude Envelope} open
  921. xywh {10 75 205 70} box FLAT_BOX color 51 align 144
  922. code0 {o->init(pars->GlobalPar.AmpEnvelope);}
  923. class EnvelopeUI
  924. } {}
  925. Fl_Group amplfo {
  926. label {Amplitude LFO } open
  927. xywh {10 150 230 70} box FLAT_BOX color 47 align 144
  928. code0 {o->init(pars->GlobalPar.AmpLfo);}
  929. class LFOUI
  930. } {}
  931. Fl_Check_Button rndgrp {
  932. label {Rnd Grp}
  933. callback {pars->GlobalPar.Hrandgrouping=(int) o->value();}
  934. 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
  935. code0 {o->value(pars->GlobalPar.Hrandgrouping);}
  936. }
  937. }
  938. Fl_Group {} {
  939. label FILTER open selected
  940. xywh {250 5 285 265} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
  941. } {
  942. Fl_Group filterenv {
  943. label {ADSynth Global - Filter Envelope} open
  944. xywh {255 118 275 70} box FLAT_BOX color 51 align 144
  945. code0 {o->init(pars->GlobalPar.FilterEnvelope);}
  946. class EnvelopeUI
  947. } {}
  948. Fl_Group filterlfo {
  949. label {Filter LFO} open
  950. xywh {255 195 230 70} box FLAT_BOX color 47 align 144
  951. code0 {o->init(pars->GlobalPar.FilterLfo);}
  952. class LFOUI
  953. } {}
  954. Fl_Group filterui {
  955. label {ADsynth Global - Filter} open
  956. xywh {255 35 275 75} box FLAT_BOX color 50 align 144
  957. code0 {o->init(pars->GlobalPar.GlobalFilter,&pars->GlobalPar.PFilterVelocityScale,&pars->GlobalPar.PFilterVelocityScaleFunction);}
  958. class FilterUI
  959. } {}
  960. }
  961. Fl_Check_Button stereo {
  962. label Stereo
  963. callback {pars->GlobalPar.PStereo=(int) o->value();}
  964. xywh {5 230 65 35} down_box DOWN_BOX labelsize 11
  965. code0 {o->value(pars->GlobalPar.PStereo);}
  966. }
  967. Fl_Button {} {
  968. label {Show Voice List}
  969. callback {for (int i=0;i<NUM_VOICES;i++){
  970. voicelistitem[i]->refreshlist();
  971. }
  972. ADnoteVoiceList->show();}
  973. xywh {180 400 125 25} labelsize 12
  974. }
  975. Fl_Button {} {
  976. label {Show Voice Parameters}
  977. callback {ADnoteVoice->show();}
  978. xywh {5 400 170 25} labelsize 12
  979. }
  980. Fl_Button {} {
  981. label Close
  982. callback {ADnoteGlobalParameters->hide();}
  983. xywh {475 400 60 25} box THIN_UP_BOX
  984. }
  985. Fl_Button {} {
  986. label Resonance
  987. callback {resui->resonancewindow->redraw();
  988. resui->resonancewindow->show();}
  989. tooltip Resonance xywh {309 400 86 25} box THIN_UP_BOX labelsize 12
  990. }
  991. Fl_Button {} {
  992. label C
  993. callback {presetsui->copyArray(pars);}
  994. xywh {405 405 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  995. }
  996. Fl_Button {} {
  997. label P
  998. callback {presetsui->pasteArray(pars,this);}
  999. xywh {435 405 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  1000. }
  1001. }
  1002. Fl_Window ADnoteVoice {
  1003. label {ADsynth Voice Parameters} open
  1004. xywh {1142 229 765 630} type Double visible
  1005. } {
  1006. Fl_Group advoice {open
  1007. xywh {0 0 765 595}
  1008. code0 {o->init(pars,nvoice,master);}
  1009. code1 {o->show();}
  1010. class ADvoiceUI
  1011. } {}
  1012. Fl_Button {} {
  1013. label {Close Window}
  1014. callback {ADnoteVoice->hide();}
  1015. xywh {305 601 195 25} box THIN_UP_BOX labelfont 1
  1016. }
  1017. Fl_Counter currentvoicecounter {
  1018. label {Current Voice}
  1019. callback {nvoice=(int)o->value()-1;
  1020. advoice->hide();
  1021. ADnoteVoice->remove(advoice);
  1022. delete advoice;
  1023. advoice=new ADvoiceUI(0,0,765,590);
  1024. ADnoteVoice->add(advoice);
  1025. advoice->init(pars,nvoice,master);
  1026. advoice->show();
  1027. ADnoteVoice->redraw();}
  1028. xywh {10 601 130 25} type Simple labelfont 1 align 8 minimum 0 maximum 2 step 1 value 1 textfont 1 textsize 13
  1029. code0 {o->bounds(1,NUM_VOICES);}
  1030. }
  1031. Fl_Button {} {
  1032. label C
  1033. callback {presetsui->copy(pars,nvoice);}
  1034. xywh {705 609 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  1035. }
  1036. Fl_Button {} {
  1037. label P
  1038. callback {presetsui->paste(pars,this,nvoice);}
  1039. xywh {735 609 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
  1040. }
  1041. }
  1042. Fl_Window ADnoteVoiceList {
  1043. label {ADsynth Voices list}
  1044. xywh {32 266 650 260} type Double hide
  1045. } {
  1046. Fl_Text_Display {} {
  1047. label {No.}
  1048. xywh {10 15 30 10} box NO_BOX labelfont 1 labelsize 11
  1049. }
  1050. Fl_Text_Display {} {
  1051. label Vol
  1052. xywh {145 15 30 10} box NO_BOX labelfont 1 labelsize 11
  1053. }
  1054. Fl_Text_Display {} {
  1055. label Detune
  1056. xywh {384 15 25 10} box NO_BOX labelfont 1 labelsize 11
  1057. }
  1058. Fl_Text_Display {} {
  1059. label Pan
  1060. xywh {210 15 30 10} box NO_BOX labelfont 1 labelsize 11
  1061. }
  1062. Fl_Text_Display {} {
  1063. label {Vib. Depth}
  1064. xywh {560 15 30 10} box NO_BOX labelfont 1 labelsize 11
  1065. }
  1066. Fl_Text_Display {} {
  1067. label {R.}
  1068. xywh {245 15 25 10} box NO_BOX labelfont 1 labelsize 11
  1069. }
  1070. Fl_Button {} {
  1071. label {Hide Voice List}
  1072. callback {ADnoteVoiceList->hide();}
  1073. xywh {255 237 125 20}
  1074. }
  1075. Fl_Scroll {} {open
  1076. xywh {0 15 640 220} type VERTICAL box THIN_UP_BOX
  1077. } {
  1078. Fl_Pack {} {open
  1079. xywh {0 20 620 210}
  1080. code0 {for (int i=0;i<NUM_VOICES;i++){voicelistitem[i]=new ADvoicelistitem(0,0,620,25,"");voicelistitem[i]->init(pars,i,master);}}
  1081. } {}
  1082. }
  1083. }
  1084. }
  1085. Function {ADnoteUI(ADnoteParameters *parameters,Master *master_)} {} {
  1086. code {pars=parameters;
  1087. master=master_;
  1088. nvoice=0;
  1089. resui=new ResonanceUI(pars->GlobalPar.Reson);
  1090. make_window();} {}
  1091. }
  1092. Function {~ADnoteUI()} {} {
  1093. code {ADnoteVoiceList->hide();
  1094. ADnoteGlobalParameters->hide();
  1095. ADnoteVoice->hide();
  1096. delete(ADnoteVoiceList);
  1097. delete(ADnoteGlobalParameters);
  1098. delete(ADnoteVoice);
  1099. delete(resui);} {}
  1100. }
  1101. Function {refresh()} {} {
  1102. code {volume->value(pars->GlobalPar.PVolume);
  1103. vsns->value(pars->GlobalPar.PAmpVelocityScaleFunction);
  1104. pan->value(pars->GlobalPar.PPanning);
  1105. stereo->value(pars->GlobalPar.PStereo);
  1106. rndgrp->value(pars->GlobalPar.Hrandgrouping);
  1107. pstr->value(pars->GlobalPar.PPunchStrength);
  1108. pt->value(pars->GlobalPar.PPunchTime);
  1109. pstc->value(pars->GlobalPar.PPunchStretch);
  1110. pvel->value(pars->GlobalPar.PPunchVelocitySensing);
  1111. detunevalueoutput->value(getdetune(pars->GlobalPar.PDetuneType,0,pars->GlobalPar.PDetune));
  1112. freq->value(pars->GlobalPar.PDetune-8192);
  1113. int k=pars->GlobalPar.PCoarseDetune/1024;if (k>=8) k-=16;
  1114. octave->value(k);
  1115. detunetype->value(pars->GlobalPar.PDetuneType-1);
  1116. k=pars->GlobalPar.PCoarseDetune%1024;if (k>=512) k-=1024;
  1117. coarsedet->value(k);
  1118. amplfo->refresh();
  1119. freqlfo->refresh();
  1120. filterlfo->refresh();
  1121. ampenv->refresh();
  1122. freqenv->refresh();
  1123. filterenv->refresh();
  1124. filterui->refresh();
  1125. for (int i=0;i<NUM_VOICES;i++) voicelistitem[i]->refreshlist();
  1126. resui->refresh();
  1127. currentvoicecounter->do_callback();} {}
  1128. }
  1129. decl {ADnoteParameters *pars;} {}
  1130. decl {ResonanceUI *resui;} {}
  1131. decl {Master *master;} {}
  1132. decl {int nvoice;} {}
  1133. decl {ADvoicelistitem *voicelistitem[NUM_VOICES];} {}
  1134. }