You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
647 B

#include "synth/voice.h"
void Voice::reset() {
adsrAmp.reset();
adsrMod.reset();
}
void Voice::assign(Settings const * settings) {
this->settings = settings;
adsrAmp.assign(&settings->ampEnv);
adsrMod.assign(&settings->modEnv);
osc1.assign(&settings->osc1Mode);
osc2.assign(&settings->osc2Mode);
filter.assign(&settings->filter);
}
void Voice::noteOn(int note, float detune, float gain, float pan) {
this->note = note;
this->gain = gain;
this->detune = detune;
this->pan = pan;
adsrAmp.noteOn();
adsrMod.noteOn();
}
void Voice::noteOff() {
adsrAmp.noteOff();
adsrMod.noteOff();
}