cleanup
This commit is contained in:
@@ -78,18 +78,9 @@ void Synth::process(float* out, uint32_t nFrames, uint32_t sampleRate) {
|
||||
bool triggered = false;
|
||||
bool once = false;
|
||||
|
||||
for (uint32_t i = 0; i < nFrames; i++) {
|
||||
// some things need to be done only once per buffer instead of once per sample
|
||||
|
||||
// updates internal buffered parameters for smoothing
|
||||
for(auto& p : params_) p.update(); // TODO: profile this
|
||||
|
||||
// assemble float array of parameters so that its easier for voices to retrieve
|
||||
float params[PARAM_COUNT] = {0.0f};
|
||||
for(int i = 0; i < PARAM_COUNT; i++) {
|
||||
params[i] = params_[i].current;
|
||||
} // maybe take this outside the loop if performance is an issue
|
||||
|
||||
// find the lowest voice for scope triggering
|
||||
// find the lowest active voice for scope triggering
|
||||
int lowestVoice = 0;
|
||||
float lowestFreq = 100000.0f;
|
||||
for(int i = 0; i < voices_.size(); i++) {
|
||||
@@ -101,6 +92,17 @@ void Synth::process(float* out, uint32_t nFrames, uint32_t sampleRate) {
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < nFrames; i++) {
|
||||
|
||||
// updates internal buffered parameters for smoothing
|
||||
for(auto& p : params_) p.update(); // TODO: profile this
|
||||
|
||||
// assemble float array of parameters so that its easier for voices to retrieve
|
||||
float params[PARAM_COUNT] = {0.0f};
|
||||
for(int i = 0; i < PARAM_COUNT; i++) {
|
||||
params[i] = params_[i].current;
|
||||
} // maybe take this outside the loop if performance is an issue
|
||||
|
||||
// foreach voice, process...
|
||||
float mix = 0.0f;
|
||||
for(int i = 0; i < voices_.size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user