From 7855e55dec98303d28e8e07054b6521b0c4d2186 Mon Sep 17 00:00:00 2001 From: grz0zrg Date: Wed, 31 Mar 2021 21:05:23 +0200 Subject: [PATCH] fix fm --- src/constants.h | 2 -- src/main.c | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/constants.h b/src/constants.h index a652270..8ca9018 100644 --- a/src/constants.h +++ b/src/constants.h @@ -1,8 +1,6 @@ #ifndef _FAS_CONSTANTS_H_ #define _FAS_CONSTANTS_H_ - #define linearInterpolate(y1, y2, mu) (y1 * (1-mu) + y2 * mu) - #ifndef M_PI #define M_PI (3.141592653589) #endif diff --git a/src/main.c b/src/main.c index 0f1bdca..1cd1c22 100644 --- a/src/main.c +++ b/src/main.c @@ -1845,12 +1845,10 @@ static int audioCallback(float **inputBuffer, float **outputBuffer, unsigned lon double dummy_int_part; if ((n->previous_volume_l <= 0 && n->previous_volume_r <= 0) || trigger_note_on) { - resetOscillator(osc, k); - osc->pvalue[k] = 0; - osc->fp3[k][0] = modf(fabs(n->blue), &dummy_int_part); - osc->fp4[k][0] = floor(fabs(n->blue)) / 65536.0; + osc->fp3[k][0] = modf(fabs(n->pblue), &dummy_int_part); + osc->fp4[k][0] = floor(fabs(n->pblue)) / 65536.0; osc->fp4[k][3] = osc->fp4[k][2]; } @@ -1888,6 +1886,10 @@ static int audioCallback(float **inputBuffer, float **outputBuffer, unsigned lon osc->fp2[k][1] = fas_wavetable_size; } + if ((n->previous_volume_l <= 0 && n->previous_volume_r <= 0) || trigger_note_on) { + osc->fp4[k][3] = osc->fp4[k][2]; + } + osc->fp3[k][1] = osc->fp3[k][0]; osc->fp3[k][0] = modf(fabs(n->blue), &dummy_int_part);