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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
#ifndef ENVELOPE_H
#define ENVELOPE_H
class Envelope
{
public:
Envelope();
~Envelope();
void
init(
float sample_rate,
EnvelopeParams * envpars,
float basefreq);
void relasekey();
float envout();
float envout_dB();
bool finished();
private:
int envpoints;
int envsustain;
float envdt[MAX_ENVELOPE_POINTS];
float envval[MAX_ENVELOPE_POINTS];
float m_stretch;
bool m_linear;
int currentpoint;
bool m_forced_release;
bool m_key_released;
bool m_finished;
float t;
float inct;
float envoutval;
};
#endif
|