mirror of
https://github.com/thestk/stk
synced 2026-01-12 12:31:53 +00:00
Version 4.3.0
This commit is contained in:
committed by
Stephen Sinclair
parent
2cbce2d8bd
commit
27d9b79dc7
@@ -9,7 +9,7 @@
|
||||
\e keyOff messages, 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.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -21,6 +21,7 @@ Envelope :: Envelope(void) : Generator()
|
||||
value_ = 0.0;
|
||||
rate_ = 0.001;
|
||||
state_ = 0;
|
||||
Stk::addSampleRateAlert( this );
|
||||
}
|
||||
|
||||
Envelope :: Envelope ( const Envelope& e )
|
||||
@@ -29,10 +30,12 @@ Envelope :: Envelope ( const Envelope& e )
|
||||
value_ = 0.0;
|
||||
rate_ = 0.001;
|
||||
state_ = 0;
|
||||
Stk::addSampleRateAlert( this );
|
||||
}
|
||||
|
||||
Envelope :: ~Envelope(void)
|
||||
{
|
||||
Stk::removeSampleRateAlert( this );
|
||||
}
|
||||
|
||||
Envelope& Envelope :: operator= ( const Envelope& e )
|
||||
@@ -47,6 +50,12 @@ Envelope& Envelope :: operator= ( const Envelope& e )
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Envelope :: sampleRateChanged( StkFloat newRate, StkFloat oldRate )
|
||||
{
|
||||
if ( !ignoreSampleRateChange_ )
|
||||
rate_ = oldRate * rate_ / newRate;
|
||||
}
|
||||
|
||||
void Envelope :: keyOn(void)
|
||||
{
|
||||
target_ = 1.0;
|
||||
|
||||
Reference in New Issue
Block a user