File: Envelope.h

package info (click to toggle)
between 6%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,532 kB
  • sloc: cpp: 28,110; php: 718; ansic: 638; objc: 245; sh: 236; makefile: 97; perl: 67
file content (45 lines) | stat: -rw-r--r-- 1,220 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45


class Envelope {
    public:
        

        /**
         * Constructs an envelope.
         *
         * All parameters are in range 0..1, and sum of the three time
         * parameters must be <= 1.
         *
         * @param inMaxNoteLengthInGridSteps the maximum note length to
         *   cover.  Exact envelopes will be generated for notes up
         *   to this length.
         * @param inGridStepDurationInSamples the number of samples
         *   per grid step. 
         */ 
        Envelope( double inAttackTime, double inDecayTime, 
                  double inSustainLevel, double inReleaseTime,
                  int inMaxNoteLengthInGridSteps,
                  int inGridStepDurationInSamples );
        
        ~Envelope();

        

        /**
         * Gets an evenlope for a given note length.
         *
         * @return an evelope of values in [0,1] that can be indexed by
         *   sample number.  Will be destroyed when this class is destroyed.
         */
        double *getEnvelope( int inNoteLengthInGridSteps );
        


    private:
        
        int mNumComputedEnvelopes;
        
        int *mEvelopeLengths;
        
        double **mComputedEnvelopes;
    };