Pārlūkot izejas kodu

Merge pull request #166 from FrankBoesing/patch-2

Optimize CPU Usage
dds
Paul Stoffregen pirms 8 gadiem
vecāks
revīzija
c9c3384ba2
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. +2
    -1
      effect_chorus.cpp

+ 2
- 1
effect_chorus.cpp Parādīt failu

@@ -101,6 +101,7 @@ void AudioEffectChorus::update(void)
block = receiveWritable(0);
if(block) {
bp = block->data;
uint32_t tmp = delay_length/(num_chorus - 1) - 1;
for(int i = 0;i < AUDIO_BLOCK_SAMPLES;i++) {
l_circ_idx++;
if(l_circ_idx >= delay_length) {
@@ -111,7 +112,7 @@ void AudioEffectChorus::update(void)
c_idx = l_circ_idx;
for(int k = 0; k < num_chorus; k++) {
sum += l_delayline[c_idx];
if(num_chorus > 1)c_idx -= delay_length/(num_chorus - 1) - 1;
if(num_chorus > 1)c_idx -= tmp;
if(c_idx < 0) {
c_idx += delay_length;
}

Notiek ielāde…
Atcelt
Saglabāt