commit 44217f459ddc140476697272df56790909831a92
parent a47294335ae2f8f8291500eef1b4617127943173
Author: paulnasca <paulnasca>
Date: Mon, 14 Jun 2004 20:14:44 +0000
*** empty log message ***
Diffstat:
2 files changed, 68 insertions(+), 57 deletions(-)
diff --git a/src/Synth/OscilGen.C b/src/Synth/OscilGen.C
@@ -66,7 +66,7 @@ void OscilGen::defaults(){
Pbasefuncmodulation=0;
Pbasefuncmodulationpar1=64;
Pbasefuncmodulationpar2=0;
- Pbasefuncmodulationpar3=0;
+ Pbasefuncmodulationpar3=32;
Pwaveshapingfunction=0;
Pwaveshaping=64;
@@ -217,8 +217,13 @@ void OscilGen::getbasefunction(REALTYPE *smps){
case 2:basefuncmodulationpar1=(pow(2,basefuncmodulationpar1*5.0)-1.0)/10.0;
basefuncmodulationpar3=1.0+floor((pow(2,basefuncmodulationpar3*5.0)-1.0));
break;
+ case 3:basefuncmodulationpar1=(pow(2,basefuncmodulationpar1*7.0)-1.0)/10.0;
+ basefuncmodulationpar3=0.01+(pow(2,basefuncmodulationpar3*16.0)-1.0)/10.0;
+ break;
};
+// printf("%.5f %.5f\n",basefuncmodulationpar1,basefuncmodulationpar3);
+
for (i=0;i<OSCIL_SIZE;i++) {
REALTYPE t=i*1.0/OSCIL_SIZE;
@@ -227,6 +232,8 @@ void OscilGen::getbasefunction(REALTYPE *smps){
break;
case 2:t=t+sin((t*basefuncmodulationpar3+basefuncmodulationpar2)*2.0*PI)*basefuncmodulationpar1;//sine
break;
+ case 3:t=t+pow((1.0-cos((t+basefuncmodulationpar2)*2.0*PI))*0.5,basefuncmodulationpar3)*basefuncmodulationpar1;//power
+ break;
};
t=t-floor(t);
diff --git a/src/UI/ADnoteUI.fl b/src/UI/ADnoteUI.fl
@@ -353,7 +353,7 @@ oldosc->redraw();}
Fl_Group basefuncdisplaygroup {
xywh {375 5 360 300} box ENGRAVED_FRAME
} {
- Fl_Group {} {open
+ Fl_Group {} {
xywh {380 85 350 190} box THIN_DOWN_BOX color 32 selection_color 71 labelcolor 179
code0 {ADOscilloscope *osc=new ADOscilloscope(o->x(),o->y(),o->w(),o->h(),"");}
code1 {osc->init(oscil,1,master);}
@@ -448,6 +448,64 @@ if ((oscil->Pcurrentbasefunc==0)||(oscil->Pcurrentbasefunc==127)) basefuncmodula
xywh {500 285 25 15} labelsize 13 minimum -63 maximum 63 step 1
code0 {o->value(oscil->Pbasefuncpar-64);}
}
+ Fl_Group basefuncmodulation {
+ xywh {579 276 150 25} box ENGRAVED_BOX
+ code0 {if ((oscil->Pcurrentbasefunc==0)||(oscil->Pcurrentbasefunc==127)) basefuncmodulation->deactivate();}
+ } {
+ Fl_Choice {} {
+ label {Mod.}
+ callback {oscil->Pbasefuncmodulation=(int) o->value();
+basefuncdisplaygroup->redraw();
+oscildisplaygroup->redraw();
+oldosc->redraw();}
+ tooltip {Base function modulation} xywh {609 281 50 15} down_box BORDER_BOX labelsize 10 textsize 10
+ code0 {o->value(oscil->Pbasefuncmodulation);}
+ } {
+ menuitem {} {
+ label None
+ xywh {50 50 100 20} labelfont 1 labelsize 10
+ }
+ menuitem {} {
+ label Rev
+ xywh {60 60 100 20} labelfont 1 labelsize 10
+ }
+ menuitem {} {
+ label Sine
+ xywh {70 70 100 20} labelfont 1 labelsize 10
+ }
+ menuitem {} {
+ label Pow selected
+ xywh {80 80 100 20} labelfont 1 labelsize 10
+ }
+ }
+ Fl_Dial {} {
+ callback {oscil->Pbasefuncmodulationpar1=(int)o->value();
+basefuncdisplaygroup->redraw();
+oscildisplaygroup->redraw();
+oldosc->redraw();}
+ tooltip {Oscillator's modulation parameter 1} xywh {669 281 15 15} maximum 127 step 1
+ code0 {o->value(oscil->Pbasefuncmodulationpar1);}
+ class WidgetPDial
+ }
+ Fl_Dial {} {
+ callback {oscil->Pbasefuncmodulationpar2=(int)o->value();
+basefuncdisplaygroup->redraw();
+oscildisplaygroup->redraw();
+oldosc->redraw();}
+ tooltip {Oscillator's modulation parameter 2} xywh {689 281 15 15} maximum 127 step 1
+ code0 {o->value(oscil->Pbasefuncmodulationpar2);}
+ class WidgetPDial
+ }
+ Fl_Dial {} {
+ callback {oscil->Pbasefuncmodulationpar3=(int)o->value();
+basefuncdisplaygroup->redraw();
+oscildisplaygroup->redraw();
+oldosc->redraw();}
+ tooltip {Oscillator's modulation parameter 3} xywh {709 281 15 15} maximum 127 step 1
+ code0 {o->value(oscil->Pbasefuncmodulationpar3);}
+ class WidgetPDial
+ }
+ }
}
Fl_Choice {} {
label {Mag.Type}
@@ -718,60 +776,6 @@ oldosc->redraw();}
code0 {for (int i=0;i<MAX_AD_HARMONICS;i++){h[i]=new ADOscilharmonic(0,0,20,o->h(),"");h[i]->init(oscil,i,oscildisplaygroup,oldosc,master);}}
} {}
}
- Fl_Group basefuncmodulation {
- xywh {580 278 150 25} box ENGRAVED_BOX
- code0 {if ((oscil->Pcurrentbasefunc==0)||(oscil->Pcurrentbasefunc==127)) basefuncmodulation->deactivate();}
- } {
- Fl_Choice {} {
- label {Mod.}
- callback {oscil->Pbasefuncmodulation=(int) o->value();
-basefuncdisplaygroup->redraw();
-oscildisplaygroup->redraw();
-oldosc->redraw();} open
- tooltip {Base function modulation} xywh {610 283 50 15} down_box BORDER_BOX labelsize 10 textsize 10
- code0 {o->value(oscil->Pbasefuncmodulation);}
- } {
- menuitem {} {
- label None
- xywh {45 45 100 20} labelfont 1 labelsize 10
- }
- menuitem {} {
- label Rev
- xywh {55 55 100 20} labelfont 1 labelsize 10
- }
- menuitem {} {
- label Sine
- xywh {65 65 100 20} labelfont 1 labelsize 10
- }
- }
- Fl_Dial {} {
- callback {oscil->Pbasefuncmodulationpar1=(int)o->value();
-basefuncdisplaygroup->redraw();
-oscildisplaygroup->redraw();
-oldosc->redraw();}
- tooltip {Oscillator's modulation parameter 1} xywh {670 283 15 15} maximum 127 step 1
- code0 {o->value(oscil->Pbasefuncmodulationpar1);}
- class WidgetPDial
- }
- Fl_Dial {} {
- callback {oscil->Pbasefuncmodulationpar2=(int)o->value();
-basefuncdisplaygroup->redraw();
-oscildisplaygroup->redraw();
-oldosc->redraw();}
- tooltip {Oscillator's modulation parameter 2} xywh {690 283 15 15} maximum 127 step 1
- code0 {o->value(oscil->Pbasefuncmodulationpar2);}
- class WidgetPDial
- }
- Fl_Dial {} {
- callback {oscil->Pbasefuncmodulationpar3=(int)o->value();
-basefuncdisplaygroup->redraw();
-oscildisplaygroup->redraw();
-oldosc->redraw();} selected
- tooltip {Oscillator's modulation parameter 3} xywh {710 283 15 15} maximum 127 step 1
- code0 {o->value(oscil->Pbasefuncmodulationpar3);}
- class WidgetPDial
- }
- }
Fl_Choice {} {
label Normalize
callback {oscil->Pnormalizemethod=(int) o->value();}
@@ -824,7 +828,7 @@ oldosc->redraw();}
class WidgetPDial
}
}
- Fl_Group {} {open
+ Fl_Group {} {
xywh {675 405 75 65} box ENGRAVED_BOX
} {
Fl_Counter harmonicshiftcounter {