Version 4.3.0

This commit is contained in:
Gary Scavone
2009-03-24 23:02:15 -04:00
committed by Stephen Sinclair
parent 2cbce2d8bd
commit 27d9b79dc7
271 changed files with 22219 additions and 8834 deletions

View File

@@ -19,12 +19,12 @@
to \e keyOn and \e keyOff messages by ramping to
1.0 on keyOn and to 0.0 on keyOff.
by Perry R. Cook and Gary P. Scavone, 1995 - 2005.
by Perry R. Cook and Gary P. Scavone, 1995 - 2007.
*/
/***************************************************/
#include "Asymp.h"
#include <math.h>
#include <cmath>
Asymp :: Asymp(void) : Envelope()
{
@@ -36,6 +36,14 @@ Asymp :: ~Asymp(void)
{
}
void Asymp :: sampleRateChanged( StkFloat newRate, StkFloat oldRate )
{
if ( !ignoreSampleRateChange_ ) {
StkFloat tau = -1.0 / ( std::log( factor_ ) * oldRate );
factor_ = std::exp( -1.0 / ( tau * newRate ) );
}
}
void Asymp :: keyOn(void)
{
Envelope::keyOn();
@@ -56,7 +64,7 @@ void Asymp :: setTau(StkFloat tau)
return;
}
factor_ = exp( -1.0 / ( tau * Stk::sampleRate() ) );
factor_ = std::exp( -1.0 / ( tau * Stk::sampleRate() ) );
constant_ = ( 1.0 - factor_ ) * target_;
}
@@ -68,8 +76,8 @@ void Asymp :: setTime(StkFloat time)
return;
}
StkFloat tau = -time / log( TARGET_THRESHOLD );
factor_ = exp( -1.0 / ( tau * Stk::sampleRate() ) );
StkFloat tau = -time / std::log( TARGET_THRESHOLD );
factor_ = std::exp( -1.0 / ( tau * Stk::sampleRate() ) );
constant_ = ( 1.0 - factor_ ) * target_;
}