commit 8dd6dbeb534214e16050f567c2804ef00ca2b028
parent 8c6f2cfc88a9ebad8846c675102e483b533ae6c4
Author: Daniel Sheeler <[email protected]>
Date: Sun, 17 Mar 2019 09:44:29 -0500
Check for old lfo freq and convert to new Hz range
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/Params/LFOParams.cpp b/src/Params/LFOParams.cpp
@@ -37,7 +37,7 @@ static const rtosc::Ports _ports = {
rOptions(ad_global_amp, ad_global_freq, ad_global_filter,
ad_voice_amp, ad_voice_freq, ad_voice_filter, unspecified),
"location of the filter"),
- rParamF(freq, rShort("freq"), rUnit(HZ), rLog(0.078,85.25),
+ rParamF(freq, rShort("freq"), rUnit(HZ), rLog(0.0775679,85.25),
rDefaultDepends(loc),
rPreset(ad_global_amp, 6.49), // 80
rPreset(ad_global_freq, 3.71), // 70
@@ -221,7 +221,11 @@ void LFOParams::add2XML(XMLwrapper& xml)
void LFOParams::getfromXML(XMLwrapper& xml)
{
- freq = xml.getparreal("freq", freq, 0.078f, 85.25f);
+ if (xml.fileversion() < version_type(3, 0, 4)) {
+ freq = (powf(2.0f, 10.0f * xml.getparreal("freq", freq, 0.0f, 1.0f)) -1) / 12.0;
+ } else {
+ freq = xml.getparreal("freq", freq);
+ }
Pintensity = xml.getpar127("intensity", Pintensity);
Pstartphase = xml.getpar127("start_phase", Pstartphase);
PLFOtype = xml.getpar127("lfo_type", PLFOtype);