Skip to content

Commit

Permalink
fix fm
Browse files Browse the repository at this point in the history
  • Loading branch information
grz0zrg committed Mar 31, 2021
1 parent 8511ccc commit 7855e55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/constants.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 6 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 7855e55

Please sign in to comment.