начал работу над envelope
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#ifndef ENVELOPE
|
||||
#define ENVELOPE
|
||||
|
||||
#include "../include/synth.hpp"
|
||||
|
||||
enum class Condition{
|
||||
Idle,
|
||||
Attack,
|
||||
Decay,
|
||||
Sustain,
|
||||
Release
|
||||
};
|
||||
|
||||
class Envelope{
|
||||
|
||||
public:
|
||||
Envelope(Synth& synth) : synth_(synth){
|
||||
condition = Condition::Idle;
|
||||
attack = 0.0;
|
||||
decay = 0.0;
|
||||
sustain = 0.0;
|
||||
release = 0.0;
|
||||
amplitude = 0.0;
|
||||
phase = 0.0;
|
||||
};
|
||||
void note_on();
|
||||
void note_off();
|
||||
double process();
|
||||
|
||||
private:
|
||||
Condition condition;
|
||||
Synth& synth_;
|
||||
|
||||
double attack;
|
||||
double decay;
|
||||
double sustain;
|
||||
double release;
|
||||
double amplitude;
|
||||
double phase;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user