zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 0e3d5ef06ee9edd39b5f71532d30e576cfff89e6
parent a18a406965e788bb60e1b6908f22819358bbda7b
Author: Johannes Lorenz <j.git@lorenz-ho.me>
Date:   Sat, 15 Apr 2023 19:37:51 +0200

Minor fixes when loading strange savefiles

Diffstat:
Msrc/Effects/Distortion.cpp | 2+-
Msrc/Effects/Phaser.cpp | 2+-
Msrc/Misc/Part.cpp | 2++
Msrc/Params/SUBnoteParameters.cpp | 2++
4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/Effects/Distortion.cpp b/src/Effects/Distortion.cpp @@ -302,7 +302,7 @@ void Distortion::changepar(int npar, unsigned char value) Pstereo = (value > 1) ? 1 : value; break; case 10: - Pprefiltering = value; + Pprefiltering = (value!=0); break; case 11: Pfuncpar = value; diff --git a/src/Effects/Phaser.cpp b/src/Effects/Phaser.cpp @@ -507,7 +507,7 @@ void Phaser::changepar(int npar, unsigned char value) setdistortion(value); break; case 14: - Panalog = value; + Panalog = (value!=0); break; } } diff --git a/src/Misc/Part.cpp b/src/Misc/Part.cpp @@ -1454,6 +1454,8 @@ void Part::getfromXMLinstrument(XMLwrapper& xml) Pefxroute[nefx], 0, NUM_PART_EFX); + if(Pefxroute[nefx]>2) // fix for broken savefiles + Pefxroute[nefx]=2; partefx[nefx]->setdryonly(Pefxroute[nefx] == 2); Pefxbypass[nefx] = xml.getparbool("bypass", Pefxbypass[nefx]); xml.exitbranch(); diff --git a/src/Params/SUBnoteParameters.cpp b/src/Params/SUBnoteParameters.cpp @@ -578,6 +578,8 @@ void SUBnoteParameters::getfromXML(XMLwrapper& xml) if (upgrade_3_0_3) { int vol = xml.getpar127("volume", 0); Volume = -60.0f * ( 1.0f - vol / 96.0f); + if(Volume == -0.f) + Volume = 0.f; } else { Volume = xml.getparreal("volume", Volume); }