synththing-plusplus/src/utils/envelope.h

47 lines
764 B
C++

/*
* Filename: envelope.h
*
* Description:
*
*
* Version:
* Created: Fri Nov 1 00:22:22 2019
* Revision: None
* Author: Rachel Fae Fox (foxiepaws),fox@foxiepa.ws
*
*/
#ifndef _H_ENVELOPE
#define _H_ENVELOPE
class Envelope {
// these values are in samples.
public:
unsigned int attack;
unsigned int decay;
unsigned int release;
float sustain_level;
float max_level;
float min_level;
float level;
bool gate;
bool ar;
bool sustain;
Envelope();
float run();
private:
enum EnvState {_e_off,_e_attack, _e_attackrelease, _e_decay, _e_sustain,_e_release, _e_finished};
unsigned long int t;
EnvState envstate;
};
#endif
// Local Variables:
// mode: c++
// End: