1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added some missing math constants to the Javascript parser, and a constant MathConstants::sqrt2

This commit is contained in:
jules 2018-01-09 15:15:33 +00:00
parent 78b0ab6442
commit 7326a37795
6 changed files with 30 additions and 15 deletions

View file

@ -203,14 +203,14 @@ void ResamplingAudioSource::createLowPass (const double frequencyRatio)
const double n = 1.0 / std::tan (MathConstants<double>::pi * jmax (0.001, proportionalRate));
const double nSquared = n * n;
const double c1 = 1.0 / (1.0 + std::sqrt (2.0) * n + nSquared);
const double c1 = 1.0 / (1.0 + MathConstants<double>::sqrt2 * n + nSquared);
setFilterCoefficients (c1,
c1 * 2.0f,
c1,
1.0,
c1 * 2.0 * (1.0 - nSquared),
c1 * (1.0 - std::sqrt (2.0) * n + nSquared));
c1 * (1.0 - MathConstants<double>::sqrt2 * n + nSquared));
}
void ResamplingAudioSource::setFilterCoefficients (double c1, double c2, double c3, double c4, double c5, double c6)