..
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#ifndef VOICE
|
||||
#define VOICE
|
||||
|
||||
#include <cstdint>
|
||||
#include <numbers>
|
||||
#include <cmath>
|
||||
|
||||
#include "../include/envelope.hpp"
|
||||
#include "../include/oscillator.hpp"
|
||||
|
||||
class Voice{
|
||||
public:
|
||||
Voice(){
|
||||
note = 0;
|
||||
|
||||
active = false;
|
||||
}
|
||||
|
||||
void note_on(uint8_t note, uint8_t velocity);
|
||||
void note_off();
|
||||
|
||||
double generate();
|
||||
|
||||
bool is_active() const;
|
||||
|
||||
private:
|
||||
Envelope envelope;
|
||||
Oscillator oscillator;
|
||||
|
||||
uint8_t note;
|
||||
|
||||
bool active;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user