commit 3c924a4cb2bc731bacc8feb8970cf438454022fe
parent a62f22dcbe13567f1c7c3060051df2cd028f0e67
Author: fundamental <[email protected]>
Date: Tue, 6 Aug 2013 11:11:29 -0400
Partial Oscification of ADnoteUI
This takes care of a part of the ADnoteUI, though voices won't work too smoothly
until osc renaming is handled correctly...
Diffstat:
3 files changed, 353 insertions(+), 280 deletions(-)
diff --git a/src/Params/ADnoteParameters.cpp b/src/Params/ADnoteParameters.cpp
@@ -53,6 +53,93 @@ static Ports voicePorts = {
rRecurp(FMFreqEnvelope, "Modulator Frequency Envelope"),
rRecurp(FMAmpEnvelope, "Modulator Amplitude Envelope"),
rRecurp(VoiceFilter, "Optional Voice Filter"),
+
+ rToggle(Enabled, "Voice Enable"),
+ rParam(Unison_size, "Number of subvoices"),
+ rParam(Unison_frequency_spread, "Subvoice detune"),
+ rParam(Unison_stereo_spread, "Subvoice L/R Separation"),
+ rParam(Unison_vibratto, "Subvoice vibratto"),
+ rParam(Unison_vibratto_speed, "Subvoice vibratto speed"),
+ rOption(Unison_invert_phase, rOptions(none, random, 50%, 33%, 25%), "Subvoice Phases"),
+ rOption(Type, rOptions(Sound,Noise), "Type of Sound"),
+ rParam(PDelay, "Voice Startup Delay"),
+ rToggle(Presonance, "Resonance Enable"),
+ rParam(Pextoscil, "External Oscilator Selection"),
+ rParam(PextFMoscil, "External FM Oscilator Selection"),
+ rParam(Poscilphase, "Oscillator Phase"),
+ rParam(PFMoscilphase, "FM Oscillator Phase"),
+ rToggle(Pfilterbypass, "Filter Bypass"),
+
+ //Freq Stuff
+ rToggle(Pfixedfreq, "If frequency is fixed"),
+ rParam(PfixedfreqET, "Equal Tempermant Parameter"),
+ rParamI(PDetune, "Fine Detune"),
+ rParamI(PCoarseDetune, "Coarse Detune"),
+ rParam(PDetuneType, "Magnitude of Detune"),
+ rToggle(PFreqEnvelopeEnabled, "Frequency Envelope Enable"),
+ rToggle(PFreqLfoEnabled, "Frequency LFO Enable"),
+
+ //Amplitude Stuff
+ rParam(PPanning, "Panning"),
+ rParam(PVolume, "Volume"),
+ rToggle(PVolumeminus, "Signal Inverter"), //do we really need this??
+ rParam(PAmpVelocityScaleFunction, "Velocity Sensing"),
+ rToggle(PAmpEnvelopeEnabled, "Amplitude Envelope Enable"),
+ rToggle(PAmpLfoEnabled, "Amplitude LFO Enable"),
+
+ //Filter Stuff
+ rToggle(PFilterEnabled, "Filter Enable"),
+ rToggle(PFilterEnvelopeEnabled, "Filter Envelope Enable"),
+ rToggle(PFilterLfoEnabled, "Filter LFO Enable"),
+
+
+ //Modulator Stuff
+ rToggle(PFMEnabled, "Modulator Enable"),
+ rParamI(PFMVoice, "Modulator Oscillator Selection"),
+ rParam(PFMVolume, "Modulator Magnitude"),
+ rParam(PFMVolumeDamp, "Modulator HF dampening"),
+ rParam(PFMVelocityScaleFunction, "Modulator Velocity Function"),
+ rParamI(PFMDetune, "Modulator Fine Detune"),
+ rParamI(PFMCoarseDetune, "Modulator Coarse Detune"),
+ rParam(PFMDetuneType, "Modulator Detune Magnitude"),
+ rToggle(PFMFreqEnvelopeEnabled, "Modulator Frequency Envelope"),
+ rToggle(PFMAmpEnvelopeEnabled, "Modulator Amplitude Envelope"),
+
+
+ //weird stuff for PCoarseDetune
+ {"detunevalue:", NULL, NULL, [](const char *, RtData &d)
+ {
+ rObject *obj = (rObject *)d.obj;
+ //TODO check if this is accurate or if PCoarseDetune is utilized
+ //TODO do the same for the other engines
+ d.reply(d.loc, "f", getdetune(obj->PDetuneType, 0, obj->PDetune));
+ }},
+ {"octave::c:i", NULL, NULL, [](const char *msg, RtData &d)
+ {
+ rObject *obj = (rObject *)d.obj;
+ if(!rtosc_narguments(msg)) {
+ int k=obj->PCoarseDetune/1024;
+ if (k>=8) k-=16;
+ d.reply(d.loc, "i", k);
+ } else {
+ int k=(int) rtosc_argument(msg, 0).i;
+ if (k<0) k+=16;
+ obj->PCoarseDetune = k*1024 + obj->PCoarseDetune%1024;
+ }
+ }},
+ {"coarsedetune::c:i", NULL, NULL, [](const char *msg, RtData &d)
+ {
+ rObject *obj = (rObject *)d.obj;
+ if(!rtosc_narguments(msg)) {
+ int k=obj->PCoarseDetune%1024;
+ if (k>=512) k-=1024;
+ d.reply(d.loc, "i", k);
+ } else {
+ int k=(int) rtosc_argument(msg, 0).i;
+ if (k<0) k+=1024;
+ obj->PCoarseDetune = k + (obj->PCoarseDetune/1024)*1024;
+ }
+ }},
};
#undef rObject
@@ -71,8 +158,8 @@ static Ports globalPorts = {
rToggle(PStereo, "Mono/Stereo Enable"),
//Frequency
- rParam(PDetune, "Fine Detune"),
- rParam(PCoarseDetune, "Coarse Detune"),
+ rParamI(PDetune, "Fine Detune"),
+ rParamI(PCoarseDetune, "Coarse Detune"),
rParam(PDetuneType, "Detune Scaling Type"),
rParam(PBandwidth, "Relative Fine Detune Gain"),
@@ -94,6 +181,38 @@ static Ports globalPorts = {
//Resonance
rParam(Hrandgrouping, "How randomness is applied to multiple voices using the same oscil"),
+ //weird stuff for PCoarseDetune
+ {"detunevalue:", NULL, NULL, [](const char *, RtData &d)
+ {
+ rObject *obj = (rObject *)d.obj;
+ d.reply(d.loc, "f", getdetune(obj->PDetuneType, 0, obj->PDetune));
+ }},
+ {"octave::c:i", NULL, NULL, [](const char *msg, RtData &d)
+ {
+ rObject *obj = (rObject *)d.obj;
+ if(!rtosc_narguments(msg)) {
+ int k=obj->PCoarseDetune/1024;
+ if (k>=8) k-=16;
+ d.reply(d.loc, "i", k);
+ } else {
+ int k=(int) rtosc_argument(msg, 0).i;
+ if (k<0) k+=16;
+ obj->PCoarseDetune = k*1024 + obj->PCoarseDetune%1024;
+ }
+ }},
+ {"coarsedetune::c:i", NULL, NULL, [](const char *msg, RtData &d)
+ {
+ rObject *obj = (rObject *)d.obj;
+ if(!rtosc_narguments(msg)) {
+ int k=obj->PCoarseDetune%1024;
+ if (k>=512) k-=1024;
+ d.reply(d.loc, "i", k);
+ } else {
+ int k=(int) rtosc_argument(msg, 0).i;
+ if (k<0) k+=1024;
+ obj->PCoarseDetune = k + (obj->PCoarseDetune/1024)*1024;
+ }
+ }},
};
diff --git a/src/UI/ADnoteUI.fl b/src/UI/ADnoteUI.fl
@@ -38,7 +38,22 @@ decl {\#include <stdlib.h>} {private local
decl {\#include <string.h>} {private local
}
-decl {\#include "WidgetPDial.h"} {public local
+decl {\#include "Fl_Osc_Pane.H"} {public local
+}
+
+decl {\#include "Fl_Osc_Dial.H"} {public local
+}
+
+decl {\#include "Fl_Osc_Check.H"} {public local
+}
+
+decl {\#include "Fl_Osc_Choice.H"} {public local
+}
+
+decl {\#include "Fl_Osc_Slider.H"} {public local
+}
+
+decl {\#include "Fl_Osc_VSlider.H"} {public local
}
decl {\#include "Fl_Oscilloscope.h"} {public local
@@ -59,29 +74,31 @@ decl {\#include "OscilGenUI.h"} {public local
decl {\#include "PresetsUI.h"} {public local
}
-class ADvoicelistitem {open : {public Fl_Group}
+class ADvoicelistitem {open : {public Fl_Osc_Group}
} {
Function {make_window()} {open private
} {
Fl_Window ADnoteVoiceListItem {open
- private xywh {337 881 615 100} type Double box UP_FRAME
- class Fl_Group visible
+ private xywh {340 881 615 100} type Double box UP_FRAME
+ class Fl_Osc_Group visible
} {
+ Fl_Box {} {
+ xywh {0 0 0 0}
+ code0 {ADnoteVoiceListItem->pane_name = loc;}
+ }
Fl_Group voicelistitemgroup {open
private xywh {50 0 570 25}
- code0 {if (pars->VoicePar[nvoice].Enabled==0) o->deactivate();}
class Fl_Osc_Group
} {
Fl_Value_Slider voicevolume {
- callback {pars->VoicePar[nvoice].PVolume=(int)o->value();}
tooltip Volume xywh {90 5 115 20} type {Horz Knob} box NO_BOX labelsize 8 align 5 maximum 127 step 1
- code0 {voicelistitemgroup->osc=osc_i;voicelistitemgroup->pane_name=loc;}
- code1 {o->value(pars->VoicePar[nvoice].PVolume);}
+ code1 {o->init("PVolume");}
+ class Fl_Osc_VSlider
}
Fl_Check_Button voiceresonanceenabled {
- callback {pars->VoicePar[nvoice].Presonance=(int)o->value();}
tooltip {Resonance On/Off} xywh {245 7 15 17} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 11 align 4
- code0 {o->value(pars->VoicePar[nvoice].Presonance);}
+ code0 {o->init("Presonance");}
+ class Fl_Osc_Check
}
Fl_Value_Slider voicelfofreq {
tooltip {Frequency LFO amount} xywh {500 5 115 20} type {Horz Knob} box NO_BOX labelsize 8 align 5 maximum 127 step 1
@@ -89,65 +106,68 @@ class ADvoicelistitem {open : {public Fl_Group}
class Fl_Osc_Slider
}
Fl_Dial voicepanning {
- callback {pars->VoicePar[nvoice].PPanning=(int) o->value();}
tooltip {Panning (leftmost is Random)} xywh {215 5 20 20} box ROUND_UP_BOX labelsize 10 align 4 maximum 127 step 1
- code0 {o->value(pars->VoicePar[nvoice].PPanning);}
- class WidgetPDial
+ code0 {o->init("PPanning");}
+ class Fl_Osc_Dial
}
Fl_Group voiceoscil {open
xywh {60 5 30 20} box THIN_DOWN_BOX color 32 selection_color 71 labelcolor 179
- code0 {osc=new Fl_Oscilloscope(o->x(),o->y(),o->w(),o->h(),"");}
- code1 {osc->init(false, "oscil/");}
- code2 {if (pars->VoicePar[nvoice].Pextoscil != -1) { osc->init(false);}}
+ code0 {oscil=new Fl_Oscilloscope(o->x(),o->y(),o->w(),o->h(),"");}
+ code1 {oscil->init(false, "oscil/");}
class Fl_Osc_Group
} {}
Fl_Value_Output detunevalueoutput {
- callback {o->value(getdetune((pars->VoicePar[nvoice].PDetuneType==0)?(pars->GlobalPar.PDetuneType) : (pars->VoicePar[nvoice].PDetuneType),0,pars->VoicePar[nvoice].PDetune)*pars->getBandwidthDetuneMultiplier());}
+ callback {/*o->value(getdetune((pars->VoicePar[nvoice].PDetuneType==0)?(pars->GlobalPar.PDetuneType) : (pars->VoicePar[nvoice].PDetuneType),0,pars->VoicePar[nvoice].PDetune)*pars->getBandwidthDetuneMultiplier());*/}
xywh {265 5 45 20} labelsize 10 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 10
- code0 {o->value(getdetune(pars->VoicePar[nvoice].PDetuneType,0,pars->VoicePar[nvoice].PDetune)*pars->getBandwidthDetuneMultiplier());}
+ code0 {/*o->value(getdetune(pars->VoicePar[nvoice].PDetuneType,0,pars->VoicePar[nvoice].PDetune)*pars->getBandwidthDetuneMultiplier());*/}
}
Fl_Slider voicedetune {
- callback {pars->VoicePar[nvoice].PDetune=(int)o->value()+8192;
-detunevalueoutput->do_callback();}
+ callback {//detunevalueoutput->do_callback();}
tooltip {Fine Detune (cents)} xywh {315 5 185 20} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
- code0 {o->value(pars->VoicePar[nvoice].PDetune-8192);}
+ code0 {o->init("PDetune",'i');}
+ class Fl_Osc_Slider
}
Fl_Box noiselabel {
label N
- callback {if (pars->VoicePar[nvoice].Type==0) {
- o->hide();
+ xywh {65 5 20 20} labelfont 1 labelsize 13 labelcolor 7
+ }
+ Fl_Check_Button noisehack {
+ callback {if (o->value()==0) {
+ noiselabel->hide();
voiceresonanceenabled->activate();
detunevalueoutput->activate();
voicedetune->activate();
voicelfofreq->activate();
voiceoscil->activate();
} else {
- o->show();
+ noiselabel->show();
voiceresonanceenabled->deactivate();
detunevalueoutput->deactivate();
voicedetune->deactivate();
voicelfofreq->deactivate();
voiceoscil->deactivate();
};}
- xywh {65 5 20 20} labelfont 1 labelsize 13 labelcolor 7
- code0 {if (pars->VoicePar[nvoice].Type==0) o->hide();}
+ xywh {0 0 0 0} down_box DOWN_BOX
+ code0 {o->init("Type");o->hide();}
+ class Fl_Osc_Check
}
}
Fl_Check_Button voiceenabled {
label 01
- callback {pars->VoicePar[nvoice].Enabled=(int)o->value();
-if (o->value()==0) voicelistitemgroup->deactivate();
+ callback {if (o->value()==0) voicelistitemgroup->deactivate();
else voicelistitemgroup->activate();
o->redraw();}
private xywh {30 5 20 20} down_box DOWN_BOX labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 4
code0 {char tmp[10];snprintf(tmp,10,"%d",nvoice+1);o->label(strdup(tmp));}
- code1 {o->value(pars->VoicePar[nvoice].Enabled);}
+ code1 {o->init("Enabled");}
+ class Fl_Osc_Check
}
}
}
- Function {ADvoicelistitem(int x,int y, int w, int h, const char *label=0):Fl_Group(x,y,w,h,label)} {open
+ Function {ADvoicelistitem(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h,label)} {open
} {
- code {nvoice=0;
+ code {assert(osc);
+ nvoice=0;
pars=NULL;} {}
}
Function {init(ADnoteParameters *parameters,int nvoice_, std::string loc_, Fl_Osc_Interface *osc_)} {open
@@ -157,7 +177,6 @@ assert(!loc_.empty());
pars=parameters;
nvoice=nvoice_;
-osc_i = osc_;
loc = loc_;
make_window();
ADnoteVoiceListItem->show();
@@ -165,50 +184,42 @@ end();} {}
}
Function {refreshlist()} {open
} {
- code {voiceenabled->value(pars->VoicePar[nvoice].Enabled);
-voiceresonanceenabled->value(pars->VoicePar[nvoice].Presonance);
-voicevolume->value(pars->VoicePar[nvoice].PVolume);
-voicedetune->value(pars->VoicePar[nvoice].PDetune-8192);
-voicepanning->value(pars->VoicePar[nvoice].PPanning);
-//voicelfofreq->value(pars->VoicePar[nvoice].FreqLfo->Pintensity);
-if (pars->VoicePar[nvoice].Pextoscil != -1) {
- osc->init(false);
-} else {
- osc->init(false);
-}
-if (pars->VoicePar[nvoice].Enabled==0) voicelistitemgroup->deactivate();
+ code {if (voiceenabled->value()==0) voicelistitemgroup->deactivate();
else voicelistitemgroup->activate();
detunevalueoutput->do_callback();
noiselabel->do_callback();
ADnoteVoiceListItem->redraw();} {}
}
Function {~ADvoicelistitem()} {} {
- code {ADnoteVoiceListItem->hide();
-//delete(ADnoteVoiceListItem);} {}
+ code {ADnoteVoiceListItem->hide();} {}
}
decl {ADnoteParameters *pars;} {private local
}
decl {int nvoice;} {private local
}
- decl {Fl_Oscilloscope *osc;} {private local
- }
- decl {Fl_Osc_Interface *osc_i;} {private local
+ decl {Fl_Oscilloscope *oscil;} {private local
}
decl {std::string loc;} {private local
}
}
-class ADvoiceUI {: {public Fl_Group}
+class ADvoiceUI {open : {public Fl_Group}
} {
- Function {make_window()} {} {
+ Function {make_window()} {open
+ } {
Fl_Window ADnoteVoiceParameters {
label Voice open
xywh {512 391 765 590} type Double box NO_BOX
- class Fl_Group visible
+ class Fl_Osc_Group visible
} {
+ Fl_Box {} {
+ label label selected
+ xywh {25 25 35 16}
+ code0 {ADnoteVoiceParameters->pane_name = loc;}
+ code1 {ADnoteVoiceParameters->osc = osc_i;}
+ }
Fl_Group voiceparametersgroup {open
xywh {0 0 765 595} color 48
- code0 {if (pars->VoicePar[nvoice].Enabled==0) o->deactivate();}
} {
Fl_Group voicemodegroup {open
xywh {0 5 765 590} color 64
@@ -216,7 +227,6 @@ class ADvoiceUI {: {public Fl_Group}
Fl_Group voiceFMparametersgroup {
label MODULATOR open
xywh {530 5 230 580} box UP_FRAME color 48 labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
- code0 {if (pars->VoicePar[nvoice].PFMEnabled==0) o->deactivate();}
} {
Fl_Group modfrequency {
label {Mod.FREQUENCY}
@@ -225,63 +235,51 @@ class ADvoiceUI {: {public Fl_Group}
Fl_Group voiceFMfreqenvgroup {
label {ADSynth Modulator - Frequency Envelope}
xywh {540 300 210 70} box FLAT_BOX color 51 align 144
- code0 {o->init(//pars->VoicePar[nvoice].FMFreqEnvelope,
- ENV_ASR, osc_i, loc + "FMFreqEnvelope/");}
- code1 {if (pars->VoicePar[nvoice].PFMFreqEnvelopeEnabled==0) o->deactivate();}
+ code0 {o->init(ENV_ASR, osc_i, loc + "FMFreqEnvelope/");}
class EnvelopeUI
} {}
Fl_Check_Button {} {
label On
- callback {pars->VoicePar[nvoice].PFMFreqEnvelopeEnabled=(int)o->value();
-if (o->value()==0) voiceFMfreqenvgroup->deactivate();
+ callback {if (o->value()==0) voiceFMfreqenvgroup->deactivate();
else voiceFMfreqenvgroup->activate();
o->redraw();}
tooltip {Forced Relase} xywh {545 305 50 10} down_box DOWN_BOX labelfont 1 labelsize 11
- code0 {o->value(pars->VoicePar[nvoice].PFMFreqEnvelopeEnabled);}
+ code0 {o->init("PFMFreqEnvelopeEnabled");}
+ class Fl_Osc_Check
}
Fl_Counter {} {
label {Coarse Det.}
- callback {int k=(int) o->value();
-if (k<0) k+=1024;
-pars->VoicePar[nvoice].PFMCoarseDetune = k+
- (pars->VoicePar[nvoice].PFMCoarseDetune/1024)*1024;}
tooltip {Coarse Detune} xywh {685 280 60 15} labelsize 10 align 1 minimum -64 maximum 63 step 1 textfont 1 textsize 11
- code0 {int k=pars->VoicePar[nvoice].PFMCoarseDetune%1024;}
- code1 {if (k>=512) k-=1024;}
- code2 {o->value(k);}
+ code0 {o->init("FMcoarsedetune");}
code3 {o->lstep(10);}
+ class Fl_Osc_Counter
}
Fl_Counter {} {
label Octave
- callback {int k=(int) o->value();
-if (k<0) k+=16;
-pars->VoicePar[nvoice].PFMCoarseDetune = k*1024+
- pars->VoicePar[nvoice].PFMCoarseDetune%1024;}
tooltip Octave xywh {625 280 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
- code0 {int k=pars->VoicePar[nvoice].PFMCoarseDetune/1024;}
- code1 {if (k>=8) k-=16;}
- code2 {o->value(k);}
+ code0 {o->init("FMoctave");}
+ class Fl_Osc_Counter
}
Fl_Slider {} {
- callback {pars->VoicePar[nvoice].PFMDetune=(int)o->value()+8192;
-fmdetunevalueoutput->do_callback();}
+ callback {o->oscWrite("detunevalue");}
tooltip {Fine Detune (cents)} xywh {590 245 155 15} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
- code0 {o->value(pars->VoicePar[nvoice].PFMDetune-8192);}
+ code0 {o->init("PFMDetune", 'i');}
+ class Fl_Osc_Slider
}
Fl_Value_Output fmdetunevalueoutput {
label Detune
- callback {o->value(getdetune((pars->VoicePar[nvoice].PFMDetuneType==0)?(pars->GlobalPar.PDetuneType) : (pars->VoicePar[nvoice].PFMDetuneType),0,pars->VoicePar[nvoice].PFMDetune));}
+ callback {//o->value(getdetune((pars->VoicePar[nvoice].PFMDetuneType==0)?(pars->GlobalPar.PDetuneType) : (pars->VoicePar[nvoice].PFMDetuneType),0,pars->VoicePar[nvoice].PFMDetune));}
xywh {540 245 45 18} labelsize 8 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 8
- code0 {o->value(getdetune((pars->VoicePar[nvoice].PFMDetuneType==0)?(pars->GlobalPar.PDetuneType) : (pars->VoicePar[nvoice].PFMDetuneType),0,pars->VoicePar[nvoice].PFMDetune));}
- code1 {//o->value(getdetune(pars->VoicePar[nvoice].PFMDetuneType,0,pars->VoicePar[nvoice].PFMDetune));}
+ code0 {o->init("FMdetunevalue");}
+ class Fl_Osc_Output
}
Fl_Choice {} {
label {Detune Type}
- callback {pars->VoicePar[nvoice].PFMDetuneType=(int) o->value();
-fmdetunevalueoutput->do_callback();} open
+ callback {fmdetunevalueoutput->do_callback();} open
xywh {540 280 75 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
code0 {o->add("Default");o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
- code1 {o->value(pars->VoicePar[nvoice].PFMDetuneType);}
+ code1 {o->init("PFMDetuneType");}
+ class Fl_Osc_Choice
} {}
}
Fl_Group {} {
@@ -290,38 +288,37 @@ fmdetunevalueoutput->do_callback();} open
} {
Fl_Value_Slider {} {
label Vol
- callback {pars->VoicePar[nvoice].PFMVolume=(int)o->value();}
tooltip Volume xywh {540 80 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
- code0 {o->value(pars->VoicePar[nvoice].PFMVolume);}
+ code0 {o->init("PFMVolume", 'c');}
+ class Fl_Osc_Slider
}
Fl_Value_Slider {} {
label {V.Sns}
- callback {pars->VoicePar[nvoice].PFMVelocityScaleFunction=(int) o->value();}
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
- code0 {o->value(pars->VoicePar[nvoice].PFMVelocityScaleFunction);}
+ code0 {o->init("PFMVelocityScaleFunction");}
+ class Fl_Osc_VSlider
}
Fl_Group voiceFMampenvgroup {
label {ADSynth Modulator - Amplitude Envelope} open
xywh {540 145 205 70} box FLAT_BOX color 51 align 144
code0 {o->init(//pars->VoicePar[nvoice].FMAmpEnvelope,
ENV_ADSR, osc_i, loc + "FMAmpEnvelope/");}
- code1 {if (pars->VoicePar[nvoice].PFMAmpEnvelopeEnabled==0) o->deactivate();}
class EnvelopeUI
} {}
Fl_Check_Button {} {
label On
- callback {pars->VoicePar[nvoice].PFMAmpEnvelopeEnabled=(int)o->value();
-if (o->value()==0) voiceFMampenvgroup->deactivate();
+ callback {if (o->value()==0) voiceFMampenvgroup->deactivate();
else voiceFMampenvgroup->activate();
o->redraw();}
tooltip {Forced Relase} xywh {545 150 50 10} down_box DOWN_BOX labelfont 1 labelsize 11
- code0 {o->value(pars->VoicePar[nvoice].PFMAmpEnvelopeEnabled);}
+ code0 {o->init("PFMAmpEnvelopeEnabled");}
+ class Fl_Osc_Check
}
Fl_Value_Slider {} {
label {F.Damp}
- callback {pars->VoicePar[nvoice].PFMVolumeDamp=(int) o->value()+64;}
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
- code0 {o->value(pars->VoicePar[nvoice].PFMVolumeDamp-64);}
+ code0 {o->init("PFMVolumeDamp",'c');}
+ class Fl_Osc_Slider
}
}
Fl_Group modoscil {open
@@ -397,12 +394,12 @@ voiceFMparametersgroup->redraw();} open
}
Fl_Choice {} {
label {Type:}
- callback {pars->VoicePar[nvoice].PFMEnabled=(int)o->value();
-if (o->value()==0) voiceFMparametersgroup->deactivate();
+ callback {if (o->value()==0) voiceFMparametersgroup->deactivate();
else voiceFMparametersgroup->activate();
o->redraw();}
xywh {535 40 80 20} down_box BORDER_BOX align 5
- code0 {o->value(pars->VoicePar[nvoice].PFMEnabled);}
+ code0 {o->init("PFMEnabled");}
+ class Fl_Osc_Choice
} {
MenuItem {} {
label OFF
@@ -438,62 +435,50 @@ o->redraw();}
xywh {10 305 205 70} box FLAT_BOX color 51 align 144
code0 {o->init(//pars->VoicePar[nvoice].FreqEnvelope,
ENV_ASR, osc_i, loc + "FreqEnvelope/");}
- code1 {if (pars->VoicePar[nvoice].PFreqEnvelopeEnabled==0) o->deactivate();}
class EnvelopeUI
} {}
Fl_Check_Button {} {
label On
- callback {pars->VoicePar[nvoice].PFreqEnvelopeEnabled=(int)o->value();
-if (o->value()==0) voicefreqenvgroup->deactivate();
+ callback {if (o->value()==0) voicefreqenvgroup->deactivate();
else voicefreqenvgroup->activate();
o->redraw();}
tooltip {Forced Relase} xywh {15 310 50 10} down_box DOWN_BOX labelfont 1 labelsize 11
- code0 {o->value(pars->VoicePar[nvoice].PFreqEnvelopeEnabled);}
+ code0 {o->init("PFreqEnvelopeEnabled");}
+ class Fl_Osc_Check
}
Fl_Group voicefreqlfogroup {
label {Frequency LFO } open
xywh {220 305 230 70} box FLAT_BOX color 47 align 144
code0 {o->init(osc_i, loc+"FreqLfo/");}
- code1 {if (pars->VoicePar[nvoice].PFreqLfoEnabled==0) o->deactivate();}
class LFOUI
} {}
Fl_Check_Button {} {
label On
- callback {pars->VoicePar[nvoice].PFreqLfoEnabled=(int)o->value();
-if (o->value()==0) voicefreqlfogroup->deactivate();
+ callback {if (o->value()==0) voicefreqlfogroup->deactivate();
else voicefreqlfogroup->activate();
o->redraw();}
tooltip {Forced Relase} xywh {225 311 55 10} down_box DOWN_BOX labelfont 1 labelsize 11
- code0 {o->value(pars->VoicePar[nvoice].PFreqLfoEnabled);}
+ code0 {o->init("PFreqLfoEnabled");}
+ class Fl_Osc_Check
}
Fl_Counter {} {
label Octave
- callback {int k=(int) o->value();
-if (k<0) k+=16;
-pars->VoicePar[nvoice].PCoarseDetune = k*1024+
- pars->VoicePar[nvoice].PCoarseDetune%1024;}
tooltip Octave xywh {470 285 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
- code0 {int k=pars->VoicePar[nvoice].PCoarseDetune/1024;}
- code1 {if (k>=8) k-=16;}
- code2 {o->value(k);}
+ code0 {o->init("octave");}
+ class Fl_Osc_Counter
}
Fl_Counter {} {
label {Coarse Det.}
- callback {int k=(int) o->value();
-if (k<0) k+=1024;
-pars->VoicePar[nvoice].PCoarseDetune = k+
- (pars->VoicePar[nvoice].PCoarseDetune/1024)*1024;}
tooltip {Coarse Detune} xywh {455 355 60 20} labelsize 10 align 1 minimum -64 maximum 63 step 1 textfont 1 textsize 11
- code0 {int k=pars->VoicePar[nvoice].PCoarseDetune%1024;}
- code1 {if (k>=512) k-=1024;}
- code2 {o->value(k);}
+ code0 {o->init("coarsedetune");}
code3 {o->lstep(10);}
+ class Fl_Osc_Counter
}
Fl_Slider {} {
- callback {pars->VoicePar[nvoice].PDetune=(int)o->value()+8192;
-detunevalueoutput->do_callback();}
+ callback {detunevalueoutput->do_callback();}
tooltip {Fine Detune (cents)} xywh {58 287 392 13} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
- code0 {o->value(pars->VoicePar[nvoice].PDetune-8192);}
+ code0 {o->init("PDetune", 'i');}
+ class Fl_Osc_Slider
}
Fl_Value_Output detunevalueoutput {
label Detune
@@ -503,28 +488,25 @@ detunevalueoutput->do_callback();}
}
Fl_Check_Button {} {
label 440Hz
- callback {int x=(int) o->value();
-pars->VoicePar[nvoice].Pfixedfreq=x;
-if (x==0) fixedfreqetdial->deactivate();
+ callback {if (o->value()==0) fixedfreqetdial->deactivate();
else fixedfreqetdial->activate();}
tooltip {Set the voice base frequency to 440Hz} xywh {345 268 55 15} down_box DOWN_BOX labelfont 1 labelsize 11
- code0 {o->value(pars->VoicePar[nvoice].Pfixedfreq);}
+ code0 {o->init("Pfixedfreq");}
+ class Fl_Osc_Check
}
Fl_Dial fixedfreqetdial {
label {Eq.T.}
- callback {pars->VoicePar[nvoice].PfixedfreqET=(int) o->value();}
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
- code0 {o->value(pars->VoicePar[nvoice].PfixedfreqET);}
- code1 {if (pars->VoicePar[nvoice].Pfixedfreq==0) o->deactivate();}
- class WidgetPDial
+ code0 {o->init("PfixedfreqET");}
+ class Fl_Osc_Dial
}
Fl_Choice {} {
label {Detune Type}
- callback {pars->VoicePar[nvoice].PDetuneType=(int) o->value();
-detunevalueoutput->do_callback();} open
+ callback {detunevalueoutput->do_callback();} open
xywh {455 320 70 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
code0 {o->add("Default");o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
- code1 {o->value(pars->VoicePar[nvoice].PDetuneType);}
+ code1 {o->init("PDetuneType");}
+ class Fl_Osc_Choice
} {}
}
Fl_Group voiceoscil {
@@ -537,13 +519,12 @@ detunevalueoutput->do_callback();} open
} {}
Fl_Button changevoiceoscilbutton {
label Change
- callback {if (oscedit!=NULL) delete(oscedit);
-
-int nv=nvoice;
-if(pars->VoicePar[nvoice].Pextoscil>=0)
- nv=pars->VoicePar[nvoice].Pextoscil;
+ callback {delete oscedit;
+ int nv=nvoice;
+ if(pars->VoicePar[nvoice].Pextoscil>=0)
+ nv=pars->VoicePar[nvoice].Pextoscil;
-oscedit=new OscilEditor(true,loc+"oscil/", osc_i);}
+ oscedit=new OscilEditor(true,loc+"oscil/", osc_i);}
xywh {5 490 65 20} box THIN_UP_BOX labelfont 1 labelsize 11
code0 {if (pars->VoicePar[nvoice].Pextoscil>=0) o->labelcolor(FL_BLUE);}
}
@@ -553,17 +534,17 @@ oscedit=new OscilEditor(true,loc+"oscil/", osc_i);}
}
Fl_Slider {} {
label Phase
- callback {pars->VoicePar[nvoice].Poscilphase=64-(int)o->value();
-osc->phase=64-(int) o->value();
+ callback {osc->phase=64-(int) o->value();
voiceoscil->redraw();}
xywh {10 435 65 10} type {Horz Knob} box NO_BOX labelsize 10 align 5 minimum -64 maximum 63 step 1
- code0 {o->value(64-pars->VoicePar[nvoice].Poscilphase);}
+ code0 {o->init("Poscilphase", 'c');}
+ class Fl_Osc_Slider
}
Fl_Check_Button {} {
label {R.}
- callback {pars->VoicePar[nvoice].Presonance=(int) o->value();}
tooltip {Resonance On/Off} xywh {210 5 35 35} box THIN_UP_BOX down_box DOWN_BOX labelfont 1 labelsize 11
- code0 {o->value(pars->VoicePar[nvoice].Presonance);}
+ code0 {o->init("Presonance");}
+ class Fl_Osc_Check
}
Fl_Choice {} {
label {Use Oscil.}
@@ -588,51 +569,49 @@ voiceonbutton->redraw();} open
} {
Fl_Dial {} {
label Stereo
- callback {pars->VoicePar[nvoice].Unison_stereo_spread=(int)o->value();}
tooltip {Stereo Spread} xywh {285 555 25 30} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
- code0 {o->value(pars->VoicePar[nvoice].Unison_stereo_spread);}
- class WidgetPDial
+ code0 {o->init("Unison_stereo_spread");}
+ class Fl_Osc_Dial
}
Fl_Choice {} {
label Unison
- callback {pars->set_unison_size_index(nvoice,(int) o->value());} open
+ callback {//pars->set_unison_size_index(nvoice,(int) o->value());} open
tooltip {Unison size} xywh {10 560 75 20} down_box BORDER_BOX labelfont 1 align 5 textfont 1 textsize 10
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);};}
- code1 {o->value(pars->get_unison_size_index(nvoice));}
+ code1 {o->init("Unison_size");//pars->get_unison_size_index(nvoice));}
+ class Fl_Osc_Choice
} {}
Fl_Dial {} {
label Vibratto
- callback {pars->VoicePar[nvoice].Unison_vibratto=(int)o->value();}
tooltip Vibratto xywh {340 555 25 30} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
- code0 {o->value(pars->VoicePar[nvoice].Unison_vibratto);}
- class WidgetPDial
+ code0 {o->init("Unison_vibratto");}
+ class Fl_Osc_Dial
}
Fl_Choice {} {
label Invert
- callback {pars->VoicePar[nvoice].Unison_invert_phase=(int) o->value();} open
tooltip {Phase Invert} xywh {445 560 65 15} down_box BORDER_BOX labelsize 11 align 5 textfont 1 textsize 10
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);};}
- code1 {o->value(pars->VoicePar[nvoice].Unison_invert_phase);}
+ code1 {o->init("Unison_invert_phase");}
+ class Fl_Osc_Choice
} {}
Fl_Slider {} {
label {Frequency Spread}
- callback {pars->VoicePar[nvoice].Unison_frequency_spread=(int)o->value();
-unisonspreadoutput->do_callback();}
+ callback {//unisonspreadoutput->do_callback();}
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
- code0 {o->value(pars->VoicePar[nvoice].Unison_frequency_spread);}
+ code0 {o->init("Unison_frequency_spread", 'c');}
+ class Fl_Osc_Slider
}
Fl_Value_Output unisonspreadoutput {
label {(cents)}
- callback {o->value(pars->getUnisonFrequencySpreadCents(nvoice));}
xywh {225 560 40 15} labelsize 10 align 5 maximum 1000 step 0.1 textfont 1 textsize 10
- code0 {o->value(pars->getUnisonFrequencySpreadCents(nvoice));}
+ code0 {o->init("unisonFrequencySpreadCents");//o->value(pars->getUnisonFrequencySpreadCents(nvoice));}
+ class Fl_Osc_Output
}
Fl_Dial {} {
label {Vib.speed}
- callback {pars->VoicePar[nvoice].Unison_vibratto_speed=(int)o->value();}
tooltip {Vibratto Average Speed} xywh {390 555 25 30} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
- code0 {o->value(pars->VoicePar[nvoice].Unison_vibratto_speed);}
- class WidgetPDial
+ code0 {o->init("Unison_vibratto_speed");}
+ class Fl_Osc_Dial
}
}
}
@@ -642,67 +621,63 @@ unisonspreadoutput->do_callback();}
} {
Fl_Value_Slider {} {
label Vol
- callback {pars->VoicePar[nvoice].PVolume=(int)o->value();}
tooltip Volume xywh {10 60 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
- code0 {o->value(pars->VoicePar[nvoice].PVolume);}
+ code0 {o->init("PVolume");}
+ class Fl_Osc_VSlider
}
Fl_Value_Slider {} {
label {V.Sns}
- callback {pars->VoicePar[nvoice].PAmpVelocityScaleFunction=(int) o->value();}
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
- code0 {o->value(pars->VoicePar[nvoice].PAmpVelocityScaleFunction);}
+ code0 {o->init("PAmpVelocityScaleFunction");}
+ class Fl_Osc_VSlider
}
Fl_Group voiceampenvgroup {
label {ADSynth Voice - Amplitude Envelope} open
xywh {10 105 205 70} box FLAT_BOX color 51 align 144
code0 {o->init(//pars->VoicePar[nvoice].AmpEnvelope,
ENV_ADSR, osc_i, loc + "AmpEnvelope/");}
- code1 {if (pars->VoicePar[nvoice].PAmpEnvelopeEnabled==0) o->deactivate();}
class EnvelopeUI
} {}
Fl_Dial {} {
label Pan
- callback {pars->VoicePar[nvoice].PPanning=(int) o->value();}
tooltip {Panning (leftmost is Random)} xywh {210 60 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(pars->VoicePar[nvoice].PPanning);}
- class WidgetPDial
+ code0 {o->init("PPanning");}
+ class Fl_Osc_Dial
}
Fl_Check_Button {} {
label On
- callback {pars->VoicePar[nvoice].PAmpEnvelopeEnabled=(int)o->value();
-if (o->value()==0) voiceampenvgroup->deactivate();
+ callback {if (o->value()==0) voiceampenvgroup->deactivate();
else voiceampenvgroup->activate();
o->redraw();}
tooltip {Forced Relase} xywh {15 110 50 10} down_box DOWN_BOX labelfont 1 labelsize 11
- code0 {o->value(pars->VoicePar[nvoice].PAmpEnvelopeEnabled);}
+ code0 {o->init("PAmpEnvelopeEnabled");}
+ class Fl_Osc_Check
}
Fl_Group voiceamplfogroup {
label {Amplitude LFO } open
xywh {10 180 230 75} box FLAT_BOX color 47 align 144
code0 {o->init(osc_i, loc + "AmpLfo/");}
- code1 {if (pars->VoicePar[nvoice].PAmpLfoEnabled==0) o->deactivate();}
class LFOUI
} {}
Fl_Check_Button {} {
label On
- callback {pars->VoicePar[nvoice].PAmpLfoEnabled=(int)o->value();
-if (o->value()==0) voiceamplfogroup->deactivate();
+ callback {if (o->value()==0) voiceamplfogroup->deactivate();
else voiceamplfogroup->activate();
o->redraw();}
tooltip {Forced Relase} xywh {15 185 55 10} down_box DOWN_BOX labelfont 1 labelsize 11
- code0 {o->value(pars->VoicePar[nvoice].PAmpLfoEnabled);}
+ code0 {o->init("PAmpLfoEnabled");}
+ class Fl_Osc_Check
}
Fl_Check_Button {} {
label Minus
- callback {pars->VoicePar[nvoice].PVolumeminus=(int)o->value();}
xywh {10 45 50 10} down_box DOWN_BOX labelfont 1 labelsize 10
- code0 {o->value(pars->VoicePar[nvoice].PVolumeminus);}
+ code0 {o->init("PVolumeminus");}
+ class Fl_Osc_Check
}
}
Fl_Group voicefiltergroup {
label FILTER open
xywh {245 5 285 260} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
- code0 {if (pars->VoicePar[nvoice].PFilterEnabled==0) o->deactivate();}
} {
Fl_Group {} {
label {ADsynth Voice - Filter} open
@@ -715,33 +690,31 @@ o->redraw();}
xywh {250 115 275 70} box FLAT_BOX color 51 align 144
code0 {o->init(//pars->VoicePar[nvoice].FilterEnvelope,
ENV_ADSR_FILTER, osc_i, loc + "FilterEnvelope/");}
- code1 {if (pars->VoicePar[nvoice].PFilterEnvelopeEnabled==0) o->deactivate();}
class EnvelopeUI
} {}
Fl_Check_Button {} {
label On
- callback {pars->VoicePar[nvoice].PFilterEnvelopeEnabled=(int)o->value();
-if (o->value()==0) voicefilterenvgroup->deactivate();
+ callback {if (o->value()==0) voicefilterenvgroup->deactivate();
else voicefilterenvgroup->activate();
o->redraw();}
tooltip {Forced Relase} xywh {255 119 55 10} down_box DOWN_BOX labelfont 1 labelsize 11
- code0 {o->value(pars->VoicePar[nvoice].PFilterEnvelopeEnabled);}
+ code0 {o->init("PFilterEnvelopeEnabled");}
+ class Fl_Osc_Check
}
Fl_Group voicefilterlfogroup {
label {Filter LFO } open
xywh {250 190 230 70} box FLAT_BOX color 47 align 144
code0 {o->init(osc_i, loc + "FilterLfo/");}
- code1 {if (pars->VoicePar[nvoice].PFilterLfoEnabled==0) o->deactivate();}
class LFOUI
} {}
Fl_Check_Button {} {
label On
- callback {pars->VoicePar[nvoice].PFilterLfoEnabled=(int)o->value();
-if (o->value()==0) voicefilterlfogroup->deactivate();
+ callback {if (o->value()==0) voicefilterlfogroup->deactivate();
else voicefilterlfogroup->activate();
o->redraw();}
tooltip {Forced Relase} xywh {255 196 55 10} down_box DOWN_BOX labelfont 1 labelsize 11
- code0 {o->value(pars->VoicePar[nvoice].PFilterLfoEnabled);}
+ code0 {o->init("PFilterLfoEnabled");}
+ class Fl_Osc_Check
}
}
Fl_Group {} {
@@ -750,14 +723,12 @@ o->redraw();}
code0 {char tmp[10];snprintf(tmp,10,"%d",nvoice+1);o->label(strdup(tmp));}
} {}
Fl_Choice {} {
- callback {int x=(int) o->value();
-pars->VoicePar[nvoice].Type=x;
-if (x==0) voicemodegroup->activate();
+ callback {if (o->value()==0) voicemodegroup->activate();
else voicemodegroup->deactivate();
noiselabel->do_callback();}
tooltip {Oscillator Type (sound/noise)} xywh {5 515 65 20} down_box BORDER_BOX labelsize 10 textfont 1 textsize 10
- code0 {o->value(pars->VoicePar[nvoice].Type);}
- code1 {if (pars->VoicePar[nvoice].Type!=0) voicemodegroup->deactivate();}
+ code0 {o->init("Type");}
+ class Fl_Osc_Choice
} {
MenuItem {} {
label Sound
@@ -770,29 +741,29 @@ noiselabel->do_callback();}
}
Fl_Check_Button bypassfiltercheckbutton {
label {Bypass Global F.}
- callback {pars->VoicePar[nvoice].Pfilterbypass=(int)o->value();}
xywh {425 10 100 20} down_box DOWN_BOX labelfont 1 labelsize 10 align 148
- code0 {o->value(pars->VoicePar[nvoice].Pfilterbypass);}
+ code0 {o->init("Pfilterbypass");}
+ class Fl_Osc_Check
}
Fl_Group {} {open
xywh {115 5 95 35} box THIN_UP_BOX
} {
Fl_Value_Slider {} {
label Delay
- callback {pars->VoicePar[nvoice].PDelay=(int)o->value();}
tooltip Volume xywh {120 21 84 12} type {Horz Knob} box NO_BOX labelsize 11 align 5 maximum 127 step 1
- code0 {o->value(pars->VoicePar[nvoice].PDelay);}
+ code0 {o->init("PDelay");}
+ class Fl_Osc_VSlider
}
}
Fl_Check_Button {} {
label On
- callback {pars->VoicePar[nvoice].PFilterEnabled=(int)o->value();
-if (o->value()==0) voicefiltergroup->deactivate();
+ callback {if (o->value()==0) voicefiltergroup->deactivate();
else voicefiltergroup->activate();
o->redraw();
bypassfiltercheckbutton->redraw();}
tooltip {Enable Filter} xywh {250 15 60 15} down_box DOWN_BOX labelfont 1 labelsize 11
- code0 {o->value(pars->VoicePar[nvoice].PFilterEnabled);}
+ code0 {o->init("PFilterEnabled");}
+ class Fl_Osc_Check
}
Fl_Box noiselabel {
label {White Noise}
@@ -803,12 +774,12 @@ bypassfiltercheckbutton->redraw();}
}
Fl_Check_Button voiceonbutton {
label On
- callback {pars->VoicePar[nvoice].Enabled=(int)o->value();
-if (o->value()==0) voiceparametersgroup->deactivate();
+ callback {if (o->value()==0) voiceparametersgroup->deactivate();
else voiceparametersgroup->activate();
o->redraw();}
xywh {60 5 55 35} box THIN_UP_BOX down_box DOWN_BOX labelfont 1 labelsize 13
- code0 {o->value(pars->VoicePar[nvoice].Enabled);}
+ code0 {o->init("Enabled");}
+ class Fl_Osc_Check
}
}
}
@@ -858,8 +829,13 @@ class ADnoteUI {open : {public PresetsUI_}
} {
Fl_Window ADnoteGlobalParameters {
label {ADsynth Global Parameters of the Instrument} open
- xywh {679 551 540 430} type Double visible
+ xywh {682 551 540 430} type Double
+ class Fl_Osc_Window visible
} {
+ Fl_Box {} {
+ xywh {0 0 0 0}
+ code0 {ADnoteGlobalParameters->pane_name = loc + "global/"; ADnoteGlobalParameters->osc = osc;}
+ }
Fl_Group {} {
label FREQUENCY open
xywh {5 280 530 115} box UP_FRAME labeltype EMBOSSED_LABEL labelfont 1 labelsize 13 align 17
@@ -872,24 +848,16 @@ class ADnoteUI {open : {public PresetsUI_}
} {}
Fl_Counter octave {
label Octave
- callback {int k=(int) o->value();
-if (k<0) k+=16;
-pars->GlobalPar.PCoarseDetune = k*1024+
- pars->GlobalPar.PCoarseDetune%1024;}
tooltip Octave xywh {455 300 45 15} type Simple labelsize 10 align 1 minimum -8 maximum 7 step 1 textfont 1 textsize 11
- code0 {int k=pars->GlobalPar.PCoarseDetune/1024;if (k>=8) k-=16;}
- code2 {o->value(k);}
+ code0 {o->init("octave");}
+ class Fl_Osc_Counter
}
Fl_Counter coarsedet {
label {Coarse det.}
- callback {int k=(int) o->value();
-if (k<0) k+=1024;
-pars->GlobalPar.PCoarseDetune = k+
- (pars->GlobalPar.PCoarseDetune/1024)*1024;}
tooltip {Coarse Detune} xywh {460 370 60 20} type Simple labelsize 10 align 5 minimum -64 maximum 63 step 1 textfont 1 textsize 11
- code0 {int k=pars->GlobalPar.PCoarseDetune%1024;if (k>=512) k-=1024;}
- code2 {o->value(k);}
+ code0 {o->init("coarsedetune");}
code3 {o->lstep(10);}
+ class Fl_Osc_Counter
}
Fl_Group freqlfo {
label {Frequency LFO } open
@@ -897,25 +865,25 @@ pars->GlobalPar.PCoarseDetune = k+
code0 {o->init(osc, loc + "global/FreqLfo/");}
class LFOUI
} {}
- Fl_Slider freq {
- callback {pars->GlobalPar.PDetune=(int)o->value()+8192;
-detunevalueoutput->do_callback();}
+ Fl_Slider detune {
+ callback {o->oscWrite("detunevalue");}
tooltip {Fine Detune (cents)} xywh {60 300 385 15} type {Horz Knob} box NO_BOX minimum -8192 maximum 8191 step 1
- code0 {o->value(pars->GlobalPar.PDetune-8192);}
+ code0 {o->init("PDetune", 'i');}
+ class Fl_Osc_Slider
}
Fl_Value_Output detunevalueoutput {
label Detune
- callback {o->value(getdetune(pars->GlobalPar.PDetuneType,0,pars->GlobalPar.PDetune));}
xywh {12 300 45 15} labelsize 10 align 5 minimum -5000 maximum 5000 step 0.01 textfont 1 textsize 10
- code0 {o->value(getdetune(pars->GlobalPar.PDetuneType,0,pars->GlobalPar.PDetune));}
+ code0 {o->init("detunevalue");}
+ class Fl_Osc_Output
}
Fl_Choice detunetype {
label {Detune Type}
- callback {pars->GlobalPar.PDetuneType=(int) o->value()+1;
-detunevalueoutput->do_callback();} open
+ callback {o->oscWrite("detunevalue");} open
xywh {455 340 75 15} down_box BORDER_BOX labelsize 10 align 5 textfont 1 textsize 10
code0 {o->add("L35cents");o->add("L10cents");o->add("E100cents");o->add("E1200cents");}
- code1 {o->value(pars->GlobalPar.PDetuneType-1);}
+ code1 {o->init("PDetuneType",1);}
+ class Fl_Osc_Choice
} {}
Fl_Dial {} {
label relBW
@@ -937,50 +905,45 @@ for (int i=0;i<NUM_VOICES;i++){
} {
Fl_Value_Slider volume {
label Vol
- callback {pars->GlobalPar.PVolume=(int)o->value();}
tooltip Volume xywh {10 30 160 15} type {Horz Knob} box NO_BOX labelsize 11 align 8 maximum 127 step 1
- code0 {o->value(pars->GlobalPar.PVolume);}
+ code0 {o->init("PVolume");}
+ class Fl_Osc_VSlider
}
Fl_Value_Slider vsns {
label {V.Sns}
- callback {pars->GlobalPar.PAmpVelocityScaleFunction=(int) o->value();}
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
- code0 {o->value(pars->GlobalPar.PAmpVelocityScaleFunction);}
+ code0 {o->init("PAmpVelocityScaleFunction");}
+ class Fl_Osc_VSlider
}
Fl_Dial pan {
label Pan
- callback {pars->GlobalPar.PPanning=(int) o->value();}
tooltip {Panning (leftmost is Random)} xywh {210 25 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
- code0 {o->value(pars->GlobalPar.PPanning);}
- class WidgetPDial
+ code0 {o->init("PPanning");}
+ class Fl_Osc_Dial
}
Fl_Dial pstr {
label {P.Str.}
- callback {pars->GlobalPar.PPunchStrength=(int) o->value();}
tooltip {Punch Strength} xywh {125 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
- code0 {o->value(pars->GlobalPar.PPunchStrength);}
- class WidgetPDial
+ code0 {o->init("PPunchStrength");}
+ class Fl_Osc_Dial
}
Fl_Dial pt {
label {P.t.}
- callback {pars->GlobalPar.PPunchTime=(int) o->value();}
tooltip {Punch Time (duration)} xywh {155 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
- code0 {o->value(pars->GlobalPar.PPunchTime);}
- class WidgetPDial
+ code0 {o->init("PPunchTime");}
+ class Fl_Osc_Dial
}
Fl_Dial pstc {
label {P.Stc.}
- callback {pars->GlobalPar.PPunchStretch=(int) o->value();}
tooltip {Punch Stretch} xywh {185 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
- code0 {o->value(pars->GlobalPar.PPunchStretch);}
- class WidgetPDial
+ code0 {o->init("PPunchStretch");}
+ class Fl_Osc_Dial
}
Fl_Dial pvel {
label {P.Vel.}
- callback {pars->GlobalPar.PPunchVelocitySensing=(int) o->value();}
tooltip {Punch Velocity Sensing} xywh {215 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
- code0 {o->value(pars->GlobalPar.PPunchVelocitySensing);}
- class WidgetPDial
+ code0 {o->init("PPunchVelocitySensing");}
+ class Fl_Osc_Dial
}
Fl_Group ampenv {
label {ADSynth Global - Amplitude Envelope} open
@@ -996,9 +959,9 @@ for (int i=0;i<NUM_VOICES;i++){
} {}
Fl_Check_Button rndgrp {
label {Rnd Grp}
- callback {pars->GlobalPar.Hrandgrouping=(int) o->value();}
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
- code0 {o->value(pars->GlobalPar.Hrandgrouping);}
+ code0 {o->init("Hrandgrouping");}
+ class Fl_Osc_Check
}
}
Fl_Group {} {
@@ -1027,9 +990,9 @@ for (int i=0;i<NUM_VOICES;i++){
}
Fl_Check_Button stereo {
label Stereo
- callback {pars->GlobalPar.PStereo=(int) o->value();}
xywh {5 230 65 35} down_box DOWN_BOX labelsize 11
- code0 {o->value(pars->GlobalPar.PStereo);}
+ code0 {o->init("PStereo");}
+ class Fl_Osc_Check
}
Fl_Button {} {
label {Show Voice List}
@@ -1057,19 +1020,25 @@ resui->resonancewindow->show();}
}
Fl_Button {} {
label C
- callback {presetsui->copy(pars);}
+ callback {/*presetsui->copy(pars);*/}
xywh {405 405 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
}
Fl_Button {} {
label P
- callback {presetsui->paste(pars,this);}
+ callback {/*presetsui->paste(pars,this);*/}
xywh {435 405 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
}
}
Fl_Window ADnoteVoice {
label {ADsynth Voice Parameters} open
- xywh {39 344 765 620} type Double visible
+ xywh {42 361 765 620} type Double
+ class Fl_Osc_Window visible
} {
+ Fl_Box {} {
+ xywh {0 0 0 0}
+ code0 {ADnoteVoice->pane_name = loc;}
+ code1 {ADnoteVoice->osc = osc;}
+ }
Fl_Group advoice {open
xywh {0 0 765 585}
code0 {o->init(pars,nvoice,loc+"voice"+to_s(nvoice)+"/", osc);/*Here*/}
@@ -1097,19 +1066,25 @@ ADnoteVoice->redraw();}
}
Fl_Button {} {
label C
- callback {presetsui->copy(pars,nvoice);}
+ callback {/*presetsui->copy(pars,nvoice);*/}
xywh {705 595 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
}
Fl_Button {} {
label P
- callback {presetsui->paste(pars,this,nvoice);}
+ callback {/*presetsui->paste(pars,this,nvoice);*/}
xywh {735 595 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
}
}
Fl_Window ADnoteVoiceList {
label {ADsynth Voices list} open
xywh {32 266 650 260} type Double hide
+ class Fl_Osc_Window
} {
+ Fl_Box {} {
+ xywh {0 0 0 0}
+ code0 {ADnoteVoiceList->pane_name = loc;}
+ code1 {ADnoteVoiceList->osc = osc;}
+ }
Fl_Text_Display {} {
label {No.}
xywh {10 15 30 10} box NO_BOX labelfont 1 labelsize 11
@@ -1144,7 +1119,7 @@ ADnoteVoice->redraw();}
} {
Fl_Pack {} {open
xywh {0 20 620 210}
- code0 {for (int i=0;i<NUM_VOICES;i++){voicelistitem[i]=new ADvoicelistitem(0,0,620,25,"");voicelistitem[i]->init(pars,i,loc+"voice"+to_s(i)+"/",osc);}}
+ code0 {o->begin();for (int i=0;i<NUM_VOICES;i++){voicelistitem[i]=new ADvoicelistitem(0,0,620,25,"");voicelistitem[i]->init(pars,i,loc+"voice"+to_s(i)+"/",osc);}o->end();}
} {}
}
}
@@ -1159,8 +1134,7 @@ nvoice=0;
resui=new ResonanceUI(osc_, loc_+"global/Reson/");
loc=loc_;
osc=osc_;
-make_window();} {selected
- }
+make_window();} {}
}
Function {~ADnoteUI()} {open
} {
@@ -1174,28 +1148,7 @@ delete resui;} {}
}
Function {refresh()} {open
} {
- code {volume->value(pars->GlobalPar.PVolume);
-vsns->value(pars->GlobalPar.PAmpVelocityScaleFunction);
-pan->value(pars->GlobalPar.PPanning);
-
-stereo->value(pars->GlobalPar.PStereo);
-rndgrp->value(pars->GlobalPar.Hrandgrouping);
-
-pstr->value(pars->GlobalPar.PPunchStrength);
-pt->value(pars->GlobalPar.PPunchTime);
-pstc->value(pars->GlobalPar.PPunchStretch);
-pvel->value(pars->GlobalPar.PPunchVelocitySensing);
-
-detunevalueoutput->value(getdetune(pars->GlobalPar.PDetuneType,0,pars->GlobalPar.PDetune));
-freq->value(pars->GlobalPar.PDetune-8192);
-
-int k=pars->GlobalPar.PCoarseDetune/1024;if (k>=8) k-=16;
-octave->value(k);
-
-detunetype->value(pars->GlobalPar.PDetuneType-1);
-k=pars->GlobalPar.PCoarseDetune%1024;if (k>=512) k-=1024;
-coarsedet->value(k);
-amplfo->refresh();
+ code {amplfo->refresh();
freqlfo->refresh();
filterlfo->refresh();
diff --git a/src/UI/Fl_Osc_Pane.H b/src/UI/Fl_Osc_Pane.H
@@ -13,7 +13,7 @@ class Fl_Osc_Pane
std::string pane_name;
};
-class Fl_Osc_Window:public Fl_Osc_Pane, public Fl_Double_Window
+class Fl_Osc_Window:public Fl_Double_Window, public Fl_Osc_Pane
{
public:
Fl_Osc_Window(int w, int h, const char *L=0)
@@ -48,6 +48,7 @@ class Fl_Osc_Group:public Fl_Osc_Pane, public Fl_Group
if(auto *p = find_osc_pane(this)) {
osc = p->osc;
pane_name = p->pane_name;
+ assert(osc);
}
};
};