Initial source commit
This commit is contained in:
commit
f1384c11ee
335 changed files with 52715 additions and 0 deletions
45
gamma256/gameSource/Envelope.h
Normal file
45
gamma256/gameSource/Envelope.h
Normal file
|
@ -0,0 +1,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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue