ft2-clone

Fasttracker 2 clone
Log | Files | Refs | README | LICENSE

commit 7631018400739f8f20f36d8f038d93ef028fae0a
parent f319b4220729767576919045a46376249ddff67e
Author: Olav Sørensen <olav.sorensen@live.no>
Date:   Wed,  5 Mar 2025 12:51:38 +0100

Update ft2_smpfx.c

Diffstat:
Msrc/ft2_smpfx.c | 8++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/ft2_smpfx.c b/src/ft2_smpfx.c @@ -315,15 +315,11 @@ void pbSfxSine(void) return; } - const double delta = 2.0 * M_PI / lastWaveLength; - double phase = 0.0; + const double dMul = (2.0 * M_PI) / lastWaveLength; int16_t *ptr16 = (int16_t *)s->dataPtr; for (int32_t i = 0; i < newLength; i++) - { - *ptr16++ = (int16_t)(INT16_MAX * sin(phase)); - phase += delta; - } + *ptr16++ = (int16_t)(INT16_MAX * sin(i * dMul)); s->loopLength = newLength; s->flags |= LOOP_FORWARD;