This commit is contained in:
2026-11-14 15:15:00 +06:00
parent 5818405474
commit b4629fe2d3
7 changed files with 90 additions and 18 deletions
+36
View File
@@ -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