Home Information Classes Download Usage Mail List Requirements Links Tutorial

# ADSR.h

    00001 /***************************************************/
    00016 /***************************************************/
    00017
    00018 #if !defined(__ADSR_H)
    00019 #define __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(MY_FLOAT aRate);
    00044
    00046   void setDecayRate(MY_FLOAT aRate);
    00047
    00049   void setSustainLevel(MY_FLOAT aLevel);
    00050
    00052   void setReleaseRate(MY_FLOAT aRate);
    00053
    00055   void setAttackTime(MY_FLOAT aTime);
    00056
    00058   void setDecayTime(MY_FLOAT aTime);
    00059
    00061   void setReleaseTime(MY_FLOAT aTime);
    00062
    00064   void setAllTimes(MY_FLOAT aTime, MY_FLOAT dTime, MY_FLOAT sLevel, MY_FLOAT rTime);
    00065
    00067   void setTarget(MY_FLOAT aTarget);
    00068
    00070   int getState(void) const;
    00071
    00073   void setValue(MY_FLOAT aValue);
    00074
    00076   MY_FLOAT tick(void);
    00077
    00079   MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
    00080
    00081  protected:
    00082   MY_FLOAT attackRate;
    00083   MY_FLOAT decayRate;
    00084   MY_FLOAT sustainLevel;
    00085   MY_FLOAT releaseRate;
    00086 };
    00087
    00088 #endif

The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.