Fixes on FX and increase performances

pull/409/head
abscisys 2 years ago
parent a264fdf230
commit 4709fc3f81
  1. 15
      src/fx_chorus.cpp
  2. 2
      src/fx_components.cpp
  3. 4
      src/fx_components.h

@ -6,7 +6,7 @@
#define LFO2_MAX_FREQ 0.35f #define LFO2_MAX_FREQ 0.35f
Chorus::Chorus(float32_t sampling_rate) : Chorus::Chorus(float32_t sampling_rate) :
FXElement(sampling_rate), FXElement(sampling_rate, 1.18f),
engine_(sampling_rate, 0.0f), engine_(sampling_rate, 0.0f),
rate_(0.0f), rate_(0.0f),
depth_(0.0f), depth_(0.0f),
@ -56,19 +56,18 @@ void Chorus::processSample(float32_t inL, float32_t inR, float32_t& outL, float3
float32_t wet; float32_t wet;
// Sum L & R channel to send to chorus line. // Sum L & R channel to send to chorus line.
c.read(inL, 0.5f); c.read(inL + inR, 0.5f);
c.read(inR, 0.5f); c.writeAndLoad(line, 0.0f);
c.write(line, 0.0f);
c.interpolate(line, sin_1 * this->fullscale_depth_ + 1200, 0.5f); c.interpolate(line, sin_1 * this->fullscale_depth_ + 1200, 0.5f);
c.interpolate(line, sin_2 * this->fullscale_depth_ + 800, 0.5f); c.interpolate(line, sin_2 * this->fullscale_depth_ + 800, 0.5f);
c.write(wet, 0.0f); c.writeAndLoad(wet, 0.0f);
outL = wet; outL = wet * this->OutputLevelCorrector;
c.interpolate(line, cos_1 * this->fullscale_depth_ + 800, 0.5f); c.interpolate(line, cos_1 * this->fullscale_depth_ + 800, 0.5f);
c.interpolate(line, cos_2 * this->fullscale_depth_ + 1200, 0.5f); c.interpolate(line, cos_2 * this->fullscale_depth_ + 1200, 0.5f);
c.write(wet, 0.0f); c.writeAndLoad(wet, 0.0f);
outR = wet; outR = wet * this->OutputLevelCorrector;
} }
void Chorus::setRate(float32_t rate) void Chorus::setRate(float32_t rate)

@ -498,7 +498,7 @@ float32_t PerlinNoiseGenerator::getRate() const
return this->rate_; return this->rate_;
} }
float32_t PerlinNoiseGenerator::getCurrent() const float32_t PerlinNoiseGenerator::current() const
{ {
return this->current_; return this->current_;
} }

@ -150,7 +150,7 @@ public:
private: private:
static bool ClassInitializer(); static bool ClassInitializer();
static const size_t DataPointSize = 352800; static const size_t DataPointSize = 176400;
static const float32_t DeltaTime; static const float32_t DeltaTime;
static float32_t DataPoints[]; static float32_t DataPoints[];
@ -396,7 +396,7 @@ public:
void setRate(float32_t rate); void setRate(float32_t rate);
float32_t getRate() const; float32_t getRate() const;
float32_t getCurrent() const; float32_t current() const;
virtual void reset() override; virtual void reset() override;
float32_t process(); float32_t process();

Loading…
Cancel
Save