diff options
Diffstat (limited to 'intern/audaspace/FX')
-rw-r--r-- | intern/audaspace/FX/AUD_ButterworthFactory.cpp | 10 | ||||
-rw-r--r-- | intern/audaspace/FX/AUD_DelayReader.cpp | 4 | ||||
-rw-r--r-- | intern/audaspace/FX/AUD_HighpassFactory.cpp | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/intern/audaspace/FX/AUD_ButterworthFactory.cpp b/intern/audaspace/FX/AUD_ButterworthFactory.cpp index 5edca302ece..af1a5af97df 100644 --- a/intern/audaspace/FX/AUD_ButterworthFactory.cpp +++ b/intern/audaspace/FX/AUD_ButterworthFactory.cpp @@ -53,11 +53,11 @@ void AUD_ButterworthFactory::recalculateCoefficients(AUD_SampleRate rate, float omega = 2 * tan(m_frequency * M_PI / rate); float o2 = omega * omega; float o4 = o2 * o2; - float x1 = o2 + 2 * BWPB41 * omega + 4; - float x2 = o2 + 2 * BWPB42 * omega + 4; - float y1 = o2 - 2 * BWPB41 * omega + 4; - float y2 = o2 - 2 * BWPB42 * omega + 4; - float o228 = 2 * o2 - 8; + float x1 = o2 + 2.0f * (float)BWPB41 * omega + 4.0f; + float x2 = o2 + 2.0f * (float)BWPB42 * omega + 4.0f; + float y1 = o2 - 2.0f * (float)BWPB41 * omega + 4.0f; + float y2 = o2 - 2.0f * (float)BWPB42 * omega + 4.0f; + float o228 = 2.0f * o2 - 8.0f; float norm = x1 * x2; a.push_back(1); a.push_back((x1 + x2) * o228 / norm); diff --git a/intern/audaspace/FX/AUD_DelayReader.cpp b/intern/audaspace/FX/AUD_DelayReader.cpp index 903e043af01..0e9833cd07f 100644 --- a/intern/audaspace/FX/AUD_DelayReader.cpp +++ b/intern/audaspace/FX/AUD_DelayReader.cpp @@ -33,8 +33,8 @@ AUD_DelayReader::AUD_DelayReader(AUD_Reference<AUD_IReader> reader, float delay) : AUD_EffectReader(reader), - m_delay(int(delay * reader->getSpecs().rate)), - m_remdelay(int(delay * reader->getSpecs().rate)) + m_delay(int((AUD_SampleRate)delay * reader->getSpecs().rate)), + m_remdelay(int((AUD_SampleRate)delay * reader->getSpecs().rate)) { } diff --git a/intern/audaspace/FX/AUD_HighpassFactory.cpp b/intern/audaspace/FX/AUD_HighpassFactory.cpp index 41070842596..b56be8942ff 100644 --- a/intern/audaspace/FX/AUD_HighpassFactory.cpp +++ b/intern/audaspace/FX/AUD_HighpassFactory.cpp @@ -48,8 +48,8 @@ void AUD_HighpassFactory::recalculateCoefficients(AUD_SampleRate rate, std::vector<float> &b, std::vector<float> &a) { - float w0 = 2 * M_PI * m_frequency / rate; - float alpha = sin(w0) / (2 * m_Q); + float w0 = 2.0 * M_PI * (AUD_SampleRate)m_frequency / rate; + float alpha = (float)(sin(w0) / (2.0 * (double)m_Q)); float norm = 1 + alpha; float c = cos(w0); a.push_back(1); |