Version 4.2.0

This commit is contained in:
Gary Scavone
2009-03-24 23:02:14 -04:00
committed by Stephen Sinclair
parent cf06b7598b
commit a6381b9d38
281 changed files with 17152 additions and 12000 deletions

View File

@@ -11,12 +11,12 @@
envelope value reaches 0.0 in the
ADSR::RELEASE state.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
by Perry R. Cook and Gary P. Scavone, 1995 - 2004.
*/
/***************************************************/
#if !defined(__ADSR_H)
#define __ADSR_H
#ifndef STK_ADSR_H
#define STK_ADSR_H
#include "Envelope.h"
@@ -40,49 +40,58 @@ class ADSR : public Envelope
void keyOff(void);
//! Set the attack rate.
void setAttackRate(MY_FLOAT aRate);
void setAttackRate(StkFloat rate);
//! Set the decay rate.
void setDecayRate(MY_FLOAT aRate);
void setDecayRate(StkFloat rate);
//! Set the sustain level.
void setSustainLevel(MY_FLOAT aLevel);
void setSustainLevel(StkFloat level);
//! Set the release rate.
void setReleaseRate(MY_FLOAT aRate);
void setReleaseRate(StkFloat rate);
//! Set the attack rate based on a time duration.
void setAttackTime(MY_FLOAT aTime);
void setAttackTime(StkFloat time);
//! Set the decay rate based on a time duration.
void setDecayTime(MY_FLOAT aTime);
void setDecayTime(StkFloat time);
//! Set the release rate based on a time duration.
void setReleaseTime(MY_FLOAT aTime);
void setReleaseTime(StkFloat time);
//! Set sustain level and attack, decay, and release state rates based on time durations.
void setAllTimes(MY_FLOAT aTime, MY_FLOAT dTime, MY_FLOAT sLevel, MY_FLOAT rTime);
//! Set sustain level and attach, decay, and release time durations.
void setAllTimes(StkFloat aTime, StkFloat dTime, StkFloat sLevel, StkFloat rTime);
//! Set the target value.
void setTarget(MY_FLOAT aTarget);
void setTarget(StkFloat target);
//! Return the current envelope \e state (ATTACK, DECAY, SUSTAIN, RELEASE, DONE).
int getState(void) const;
//! Set to state = ADSR::SUSTAIN with current and target values of \e aValue.
void setValue(MY_FLOAT aValue);
void setValue(StkFloat value);
//! Return one envelope output value.
MY_FLOAT tick(void);
StkFloat tick(void);
//! Return \e vectorSize envelope outputs in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Compute \e vectorSize outputs and return them in \e vector.
StkFloat *tick( StkFloat *vector, unsigned int vectorSize );
//! Fill a channel of the StkFrames object with computed outputs.
/*!
The \c channel argument should be one or greater (the first
channel is specified by 1). An StkError will be thrown if the \c
channel argument is zero or it is greater than the number of
channels in the StkFrames object.
*/
StkFrames& tick( StkFrames& frames, unsigned int channel = 1 );
protected:
MY_FLOAT attackRate;
MY_FLOAT decayRate;
MY_FLOAT sustainLevel;
MY_FLOAT releaseRate;
StkFloat attackRate_;
StkFloat decayRate_;
StkFloat sustainLevel_;
StkFloat releaseRate_;
};
#endif