Files
osc/include/voice.hpp
T

37 lines
531 B
C++
Raw Normal View History

2026-11-14 15:15:00 +06:00
#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