~ubuntu-branches/ubuntu/oneiric/muse/oneiric

« back to all changes in this revision

Viewing changes to synti/stklib/Envelope.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2002-04-23 17:28:23 UTC
  • Revision ID: james.westby@ubuntu.com-20020423172823-w8yplzr81a759xa3
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
  virtual ~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