[refactor]: trigger-process-release therms
This commit is contained in:
@@ -10,7 +10,7 @@ struct ADSRParameters {
|
||||
float release_time;
|
||||
};
|
||||
|
||||
enum ADSRState { Off, Attack, Decay, Sustain, Release };
|
||||
enum ADSRState { sOff, sAttack, sDecay, sSustain, sRelease };
|
||||
|
||||
class ADSR : public Effect {
|
||||
private:
|
||||
@@ -28,8 +28,8 @@ class ADSR : public Effect {
|
||||
ADSR(/* args */);
|
||||
ADSR(ADSRParameters param);
|
||||
~ADSR();
|
||||
void OnSetNote() override;
|
||||
void OnUnsetNote() override;
|
||||
void Trigger() override;
|
||||
void Release() override;
|
||||
// void RetriggerState() override;
|
||||
void Process(std::vector<float>& samples) override;
|
||||
void Reset();
|
||||
|
||||
@@ -6,8 +6,8 @@ class Effect {
|
||||
public:
|
||||
Effect(/* args */){};
|
||||
~Effect(){};
|
||||
virtual void OnSetNote(){};
|
||||
virtual void OnUnsetNote(){};
|
||||
virtual void Trigger(){};
|
||||
virtual void Release(){};
|
||||
// virtual void RetriggerState(){};
|
||||
virtual void Process(std::vector<float>& samples){};
|
||||
};
|
||||
|
||||
@@ -25,9 +25,9 @@ class Synth {
|
||||
public:
|
||||
Synth(/* args */);
|
||||
~Synth();
|
||||
void TriggerNote(Note input);
|
||||
void ProduceSound();
|
||||
void StopSound();
|
||||
void Trigger(Note input);
|
||||
void Process();
|
||||
void Release();
|
||||
void AddOscillator();
|
||||
void AddEffect(Effect* fx);
|
||||
const std::vector<float>& GetOutSignal() { return m_out_signal; }
|
||||
|
||||
Reference in New Issue
Block a user