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
+21
View File
@@ -0,0 +1,21 @@
#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;
}