commit 31970325bb90ca414a7e2ec0da2d11692157e3cd
parent fd422cd3c4d7019825917b48f741c9fb7615b64a
Author: Christopher A. Oliver <[email protected]>
Date: Tue, 27 Oct 2015 20:05:33 -0400
Make Fade-in pop suppression user tunable.
Diffstat:
5 files changed, 35 insertions(+), 13 deletions(-)
diff --git a/src/Params/ADnoteParameters.cpp b/src/Params/ADnoteParameters.cpp
@@ -223,6 +223,7 @@ static const Ports globalPorts = {
rParamZyn(PVolume, "volume control"),
rParamZyn(PAmpVelocityScaleFunction, "Volume Velocity Control"),
+ rParamZyn(Fadein_adjustment, "Adjustment for anti-pop strategy."),
rParamZyn(PPunchStrength, "Punch Strength"),
rParamZyn(PPunchTime, "UNKNOWN"),
rParamZyn(PPunchStretch, "How Punch changes with note frequency"),
@@ -348,6 +349,7 @@ void ADnoteGlobalParam::defaults()
PAmpVelocityScaleFunction = 64;
AmpEnvelope->defaults();
AmpLfo->defaults();
+ Fadein_adjustment = FADEIN_ADJUSTMENT_SCALE;
PPunchStrength = 0;
PPunchTime = 60;
PPunchStretch = 64;
@@ -712,6 +714,7 @@ void ADnoteGlobalParam::add2XML(XMLwrapper *xml)
xml->addpar("volume", PVolume);
xml->addpar("panning", PPanning);
xml->addpar("velocity_sensing", PAmpVelocityScaleFunction);
+ xml->addpar("fadein_adjustment", Fadein_adjustment);
xml->addpar("punch_strength", PPunchStrength);
xml->addpar("punch_time", PPunchTime);
xml->addpar("punch_stretch", PPunchStretch);
@@ -788,6 +791,7 @@ void ADnoteGlobalParam::getfromXML(XMLwrapper *xml)
PAmpVelocityScaleFunction = xml->getpar127("velocity_sensing",
PAmpVelocityScaleFunction);
+ Fadein_adjustment = xml->getpar127("fadein_adjustment", Fadein_adjustment);
PPunchStrength = xml->getpar127("punch_strength", PPunchStrength);
PPunchTime = xml->getpar127("punch_time", PPunchTime);
PPunchStretch = xml->getpar127("punch_stretch", PPunchStretch);
@@ -982,6 +986,7 @@ void ADnoteGlobalParam::paste(ADnoteGlobalParam &a)
copy(PPanning);
copy(PAmpVelocityScaleFunction);
+ copy(Fadein_adjustment);
copy(PPunchStrength);
copy(PPunchTime);
copy(PPunchStretch);
diff --git a/src/Params/ADnoteParameters.h b/src/Params/ADnoteParameters.h
@@ -30,6 +30,8 @@ enum FMTYPE {
NONE, MORPH, RING_MOD, PHASE_MOD, FREQ_MOD, PITCH_MOD
};
+#define FADEIN_ADJUSTMENT_SCALE 20
+
/*****************************************************************/
/* GLOBAL PARAMETERS */
/*****************************************************************/
@@ -79,6 +81,9 @@ struct ADnoteGlobalParam {
LFOParams *AmpLfo;
+ /* Adjustment factor for anti-pop fadein */
+ unsigned char Fadein_adjustment;
+
unsigned char PPunchStrength, PPunchTime, PPunchStretch,
PPunchVelocitySensing;
diff --git a/src/Synth/ADnote.cpp b/src/Synth/ADnote.cpp
@@ -69,6 +69,9 @@ ADnote::ADnote(ADnoteParameters *pars_, SynthParams &spars)
pars.GlobalPar.
PFilterVelocityScaleFunction) - 1);
+ NoteGlobalPar.Fadein_adjustment =
+ pars.GlobalPar.Fadein_adjustment / (float)FADEIN_ADJUSTMENT_SCALE;
+ NoteGlobalPar.Fadein_adjustment *= NoteGlobalPar.Fadein_adjustment;
if(pars.GlobalPar.PPunchStrength != 0) {
NoteGlobalPar.Punch.Enabled = 1;
NoteGlobalPar.Punch.t = 1.0f; //start from 1.0f and to 0.0f
@@ -1101,6 +1104,7 @@ inline void ADnote::fadein(float *smps) const
float tmp = (synth.buffersize_f - 1.0f) / (zerocrossings + 1) / 3.0f;
if(tmp < 8.0f)
tmp = 8.0f;
+ tmp *= NoteGlobalPar.Fadein_adjustment;
int n;
F2I(tmp, n); //how many samples is the fade-in
diff --git a/src/Synth/ADnote.h b/src/Synth/ADnote.h
@@ -144,6 +144,7 @@ class ADnote:public SynthNote
Envelope *AmpEnvelope;
LFO *AmpLfo;
+ float Fadein_adjustment;
struct {
int Enabled;
float initialvalue, dt, t;
diff --git a/src/UI/ADnoteUI.fl b/src/UI/ADnoteUI.fl
@@ -690,6 +690,12 @@ voiceonbutton->redraw();} open
code0 {o->init("Unison_phase_randomness");}
class Fl_Osc_Dial
}
+ Fl_Dial {} {
+ label Stereo
+ tooltip {Stereo Spread} xywh {322 555 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
+ code0 {o->init("Unison_stereo_spread");}
+ class Fl_Osc_Dial
+ }
}
}
Fl_Group {} {
@@ -717,7 +723,7 @@ voiceonbutton->redraw();} open
} {}
Fl_Dial {} {
label Pan
- tooltip {Panning (leftmost is Random)} xywh {210 60 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
+ tooltip {Panning (leftmost is Random)} xywh {212 65 30 30} box ROUND_UP_BOX labelsize 10 maximum 127 step 1
code0 {o->init("PPanning");}
class Fl_Osc_Dial
}
@@ -856,12 +862,6 @@ bypassfiltercheckbutton->redraw();}
label {Pink Noise}
xywh {150 430 300 65} labelfont 1 labelsize 50 labelcolor 212 hide
}
- Fl_Dial {} {
- label Stereo
- tooltip {Stereo Spread} xywh {327 560 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
- code0 {o->init("Unison_stereo_spread");}
- class Fl_Osc_Dial
- }
Fl_Counter {} {
label Unison selected
tooltip {Unison size} xywh {20 568 65 18} labelfont 1 align 5 minimum 1 maximum 64 step 1 value 1 textfont 1 textsize 11
@@ -1046,27 +1046,34 @@ class ADnoteUI {open : {public PresetsUI_}
code0 {o->init("PPanning");}
class Fl_Osc_Dial
}
+ Fl_Dial {} {
+ label De-pop selected
+ tooltip {Pop suppression} xywh {208 228 20 20} type Float labelsize 10 maximum 127 step 1 textfont 1 textsize 11
+ code0 {o->init("Fadein_adjustment");}
+ class Fl_Osc_Dial
+ }
+
Fl_Dial pstr {
label {P.Str.}
- tooltip {Punch Strength} xywh {125 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
+ tooltip {Punch Strength} xywh {78 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
code0 {o->init("PPunchStrength");}
class Fl_Osc_Dial
}
Fl_Dial pt {
label {P.t.}
- tooltip {Punch Time (duration)} xywh {155 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
+ tooltip {Punch Time (duration)} xywh {108 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
code0 {o->init("PPunchTime");}
class Fl_Osc_Dial
}
Fl_Dial pstc {
label {P.Stc.}
- tooltip {Punch Stretch} xywh {185 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
+ tooltip {Punch Stretch} xywh {138 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
code0 {o->init("PPunchStretch");}
class Fl_Osc_Dial
}
Fl_Dial pvel {
label {P.Vel.}
- tooltip {Punch Velocity Sensing} xywh {215 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
+ tooltip {Punch Velocity Sensing} xywh {168 237 25 25} box ROUND_UP_BOX labelsize 10 align 1 maximum 127 step 1
code0 {o->init("PPunchVelocitySensing");}
class Fl_Osc_Dial
}
@@ -1084,7 +1091,7 @@ class ADnoteUI {open : {public PresetsUI_}
} {}
Fl_Check_Button rndgrp {
label {Rnd Grp}
- 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
+ tooltip {How the Harmonic Amplitude is applied to voices that use the same oscillator} xywh {7 241 65 18} down_box DOWN_BOX labelsize 11
code0 {o->init("Hrandgrouping");}
class Fl_Osc_Check
}
@@ -1115,7 +1122,7 @@ class ADnoteUI {open : {public PresetsUI_}
}
Fl_Check_Button stereo {
label Stereo
- xywh {5 230 65 35} down_box DOWN_BOX labelsize 11
+ xywh {7 223 65 18} down_box DOWN_BOX labelsize 11
code0 {o->init("PStereo");}
class Fl_Osc_Check
}