commit 0307ed829c01d52007d32ef4f921d9905662d262 parent 8fc81e1784aebf7e27a503073803ac2ba05925ad Author: fundamental <[email protected]> Date: Sat, 1 May 2010 17:07:02 -0400 APhaser: Now volume is set properly Diffstat:
M | src/Effects/APhaser.cpp | | | 8 | +++++++- |
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/Effects/APhaser.cpp b/src/Effects/APhaser.cpp @@ -201,6 +201,7 @@ void Analog_Phaser::out(const Stereo<REALTYPE *> &input) } //cout << fb << ' ' << input.l()[i] - lxn << endl; + //cout << "input" << input.l()[i] << "output:" << lxn << endl; fbl = lxn * fb; fbr = rxn * fb; @@ -260,7 +261,12 @@ void Analog_Phaser::setvolume(unsigned char Pvolume) cout << "setting volume" << (int) Pvolume << endl; this->Pvolume = Pvolume; // outvolume is needed in calling program - outvolume = (float)Pvolume / 127.0f; + if(insertion == 0) { + outvolume = pow(0.01, (1.0 - Pvolume / 127.0)) * 4.0; + volume = 1.0; + } + else + volume = outvolume = Pvolume / 127.0; }; void Analog_Phaser::setdistortion(unsigned char Pdistortion)