home *** CD-ROM | disk | FTP | other *** search
/ PC Musician 2000 / PC_Musician_2000.iso / PCMUSIC / NOTATION / SILENCE / ENVELOPE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-09  |  1.1 KB  |  42 lines

  1. /*******************************************/
  2. /*  Envelope Class, Perry R. Cook, 1995-96 */ 
  3. /*  This is the base class for envelopes.  */
  4. /*  This one is capable of ramping state   */
  5. /*  from where it is to a target value by  */
  6. /*  a rate.  It also responds to simple    */
  7. /*  KeyOn and KeyOff messages, ramping to  */         
  8. /*  1.0 on keyon and to 0.0 on keyoff.     */
  9. /*  There are two tick (update value)      */
  10. /*  methods, one returns the value, and    */
  11. /*  other returns 0 if the envelope is at  */
  12. /*  the target value (the state bit).      */
  13. /*******************************************/
  14.  
  15. #if !defined(__Envelope_h)
  16. #define __Envelope_h
  17.  
  18. #include "Object.h"
  19.  
  20. class Envelope : public Object
  21. {
  22.   protected:  
  23.     MY_FLOAT value;
  24.     MY_FLOAT target;
  25.     MY_FLOAT rate;
  26.     int state;
  27.   public:
  28.     Envelope();
  29.     ~Envelope();
  30.     void keyOn();
  31.     void keyOff();
  32.     void setRate(MY_FLOAT aRate);
  33.     void setTime(MY_FLOAT aTime);
  34.     void setTarget(MY_FLOAT aTarget);
  35.     void setValue(MY_FLOAT aValue);
  36.     MY_FLOAT tick();
  37.     int informTick();
  38.     MY_FLOAT lastOut();
  39. };
  40.  
  41. #endif
  42.