Files
osc/src/voice.cpp
T

22 lines
418 B
C++
Raw Normal View History

2026-11-14 15:15:00 +06:00
#include "../include/voice.hpp"
void Voice::note_on(uint8_t note, uint8_t velocity){
uint8_t current_note = note;
oscillator.frequency = 440.0*std::pow(2.0,( (static_cast<int>(note)-69)/12.0 ));
// oscillator.amplitude =
envelope.note_on();
active = true;
}
void Voice::note_off(){
envelope.note_off();
}
/*
double Voice::generate(){
}*/
const bool Voice::is_active(){
return active;
}