Browse Source

Replace pow(2, x) with dsp::approxExp2_taylor5.

tags/v1.2.1
Andrew Belt 4 years ago
parent
commit
93cd07de61
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      src/LFO.cpp
  2. +1
    -1
      src/VCO.cpp

+ 1
- 1
src/LFO.cpp View File

@@ -15,7 +15,7 @@ struct LowFrequencyOscillator {

void setPitch(T pitch) {
pitch = simd::fmin(pitch, 10.f);
freq = simd::pow(2.f, pitch);
freq = dsp::approxExp2_taylor5(pitch + 30) / 1073741824;
}
void setPulseWidth(T pw) {
const T pwMin = 0.01f;


+ 1
- 1
src/VCO.cpp View File

@@ -52,7 +52,7 @@ struct VoltageControlledOscillator {
T sinValue = 0.f;

void setPitch(T pitch) {
freq = dsp::FREQ_C4 * simd::pow(2.f, pitch);
freq = dsp::FREQ_C4 * dsp::approxExp2_taylor5(pitch + 30) / 1073741824;
}

void setPulseWidth(T pulseWidth) {


Loading…
Cancel
Save