From bb7930cf9c0adf8e64b1245655ada2ec1d5910ef Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 3 Mar 2013 16:08:53 +0200 Subject: MT-32: Avoid using sinf() (which is C99) in favor of sin() --- audio/softsynth/mt32/LegacyWaveGenerator.cpp | 6 +++--- audio/softsynth/mt32/Tables.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'audio') diff --git a/audio/softsynth/mt32/LegacyWaveGenerator.cpp b/audio/softsynth/mt32/LegacyWaveGenerator.cpp index 139c89295f..d315fb431b 100644 --- a/audio/softsynth/mt32/LegacyWaveGenerator.cpp +++ b/audio/softsynth/mt32/LegacyWaveGenerator.cpp @@ -172,7 +172,7 @@ float LA32WaveGenerator::generateNextSample(const Bit32u ampVal, const Bit16u pi // Correct resAmp for cutoff in range 50..66 if ((cutoffVal >= 128.0f) && (cutoffVal < 144.0f)) { - resAmp *= sinf(FLOAT_PI * (cutoffVal - 128.0f) / 32.0f); + resAmp *= sin(FLOAT_PI * (cutoffVal - 128.0f) / 32.0f); } // Produce filtered square wave with 2 cosine waves on slopes @@ -222,7 +222,7 @@ float LA32WaveGenerator::generateNextSample(const Bit32u ampVal, const Bit16u pi } // Resonance sine WG - resSample *= sinf(FLOAT_PI * relWavePos / cosineLen); + resSample *= sin(FLOAT_PI * relWavePos / cosineLen); // Resonance sine amp float resAmpFadeLog2 = -0.125f * resAmpDecayFactor * (relWavePos / cosineLen); // seems to be exact @@ -243,7 +243,7 @@ float LA32WaveGenerator::generateNextSample(const Bit32u ampVal, const Bit16u pi // To ensure the output wave has no breaks, two different windows are appied to the beginning and the ending of the resonance sine segment if (relWavePos < 0.5f * cosineLen) { - float syncSine = sinf(FLOAT_PI * relWavePos / cosineLen); + float syncSine = sin(FLOAT_PI * relWavePos / cosineLen); if (relWavePos < 0.0f) { // The window is synchronous square sine here resAmpFade *= syncSine * syncSine; diff --git a/audio/softsynth/mt32/Tables.cpp b/audio/softsynth/mt32/Tables.cpp index ffd784a4b4..743820b1f8 100644 --- a/audio/softsynth/mt32/Tables.cpp +++ b/audio/softsynth/mt32/Tables.cpp @@ -82,7 +82,7 @@ Tables::Tables() { // There is a logarithmic sine table inside the LA32 chip. The table contains 13-bit integer values. for (int i = 1; i < 512; i++) { - logsin9[i] = Bit16u(0.5f - LOG2F(sinf((i + 0.5f) / 1024.0f * FLOAT_PI)) * 1024.0f); + logsin9[i] = Bit16u(0.5f - LOG2F(sin((i + 0.5f) / 1024.0f * FLOAT_PI)) * 1024.0f); } // The very first value is clamped to the maximum possible 13-bit integer -- cgit v1.2.3