Home Information Classes Download Usage Mail List Requirements Links Tutorial
00001 /***************************************************/ 00016 /***************************************************/ 00017 00018 #ifndef STK_ADSR_H 00019 #define STK_ADSR_H 00020 00021 #include "Envelope.h" 00022 00023 class ADSR : public Envelope 00024 { 00025 public: 00026 00028 enum { ATTACK, DECAY, SUSTAIN, RELEASE, DONE }; 00029 00031 ADSR(void); 00032 00034 ~ADSR(void); 00035 00037 void keyOn(void); 00038 00040 void keyOff(void); 00041 00043 void setAttackRate(StkFloat rate); 00044 00046 void setDecayRate(StkFloat rate); 00047 00049 void setSustainLevel(StkFloat level); 00050 00052 void setReleaseRate(StkFloat rate); 00053 00055 void setAttackTime(StkFloat time); 00056 00058 void setDecayTime(StkFloat time); 00059 00061 void setReleaseTime(StkFloat time); 00062 00064 void setAllTimes(StkFloat aTime, StkFloat dTime, StkFloat sLevel, StkFloat rTime); 00065 00067 void setTarget(StkFloat target); 00068 00070 int getState(void) const; 00071 00073 void setValue(StkFloat value); 00074 00076 StkFloat tick(void); 00077 00079 StkFloat *tick( StkFloat *vector, unsigned int vectorSize ); 00080 00082 00088 StkFrames& tick( StkFrames& frames, unsigned int channel = 1 ); 00089 00090 protected: 00091 StkFloat attackRate_; 00092 StkFloat decayRate_; 00093 StkFloat sustainLevel_; 00094 StkFloat releaseRate_; 00095 }; 00096 00097 #endif
The Synthesis ToolKit in C++ (STK) |
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |