..
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user