начал работу над envelope

This commit is contained in:
2026-11-12 22:37:00 +06:00
parent e4c2134e5b
commit a92de417b5
4 changed files with 110 additions and 6 deletions
+42
View File
@@ -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