35 lines
533 B
C++
35 lines
533 B
C++
|
|
#include "Voice.hpp"
|
|
|
|
Voice::Voice(ConfigService* config, LoggerService* logger) :
|
|
config_(config), logger_(logger) {
|
|
|
|
instrument_ = Instrument(config_, logger_);
|
|
|
|
}
|
|
|
|
void Voice::noteOn(uint8_t midiNote, float velocity) {
|
|
|
|
note_ = midiNote;
|
|
instrument_.noteOn(noteToFrequency(midiNote), velocity);
|
|
|
|
}
|
|
|
|
void Voice::noteOff() {
|
|
|
|
instrument_.noteOff();
|
|
|
|
}
|
|
|
|
bool Voice::isActive() {
|
|
|
|
return instrument_.isActive();
|
|
|
|
}
|
|
|
|
float Voice::process(bool& scopeTrigger) {
|
|
|
|
return instrument_.process(scopeTrigger);
|
|
|
|
}
|