Use M_PI instead of PI.

This commit is contained in:
Reece H. Dunn
2016-01-18 07:01:19 +00:00
parent 188dd8084c
commit 4b61d38551
3 changed files with 6 additions and 11 deletions
+4 -4
View File
@@ -182,9 +182,9 @@ static void flutter(klatt_frame_ptr frame)
fla = (double)kt_globals.f0_flutter / 50;
flb = (double)kt_globals.original_f0 / 100;
flc = sin(PI*12.7*time_count); // because we are calling flutter() more frequently, every 2.9mS
fld = sin(PI*7.1*time_count);
fle = sin(PI*4.7*time_count);
flc = sin(M_PI*12.7*time_count); // because we are calling flutter() more frequently, every 2.9mS
fld = sin(M_PI*7.1*time_count);
fle = sin(M_PI*4.7*time_count);
delta_f0 = fla * flb * (flc + fld + fle) * 10;
frame->F0hz10 = frame->F0hz10 + (long)delta_f0;
time_count++;
@@ -436,7 +436,7 @@ void KlattReset(int control)
// Full reset
kt_globals.FLPhz = (950 * kt_globals.samrate) / 10000;
kt_globals.BLPhz = (630 * kt_globals.samrate) / 10000;
kt_globals.minus_pi_t = -PI / kt_globals.samrate;
kt_globals.minus_pi_t = -M_PI / kt_globals.samrate;
kt_globals.two_pi_t = -2.0 * kt_globals.minus_pi_t;
setabc(kt_globals.FLPhz, kt_globals.BLPhz, &(kt_globals.rsn[RLP]));
}
-3
View File
@@ -34,9 +34,6 @@ extern "C"
#define SAMPLED 3
#define SAMPLED2 4
#define PI 3.1415927
/* typedef's that need to be exported */
typedef long flag;
+2 -4
View File
@@ -53,8 +53,6 @@
#include "sintab.h"
#define PI 3.1415927
#define PI2 6.283185307
#define N_WAV_BUF 10
voice_t *wvoice;
@@ -661,7 +659,7 @@ void WavegenInit(int rate, int wavemult_fact)
// wavemult table has preset values for 22050 Hz, we only need to
// recalculate them if we have a different sample rate
for (ix = 0; ix < wavemult_max; ix++) {
x = 127*(1.0 - cos(PI2*ix/wavemult_max));
x = 127*(1.0 - cos((M_PI*2)*ix/wavemult_max));
wavemult[ix] = (int)x;
}
}
@@ -923,7 +921,7 @@ void InitBreath(void)
{
int ix;
minus_pi_t = -PI / samplerate;
minus_pi_t = -M_PI / samplerate;
two_pi_t = -2.0 * minus_pi_t;
for (ix = 0; ix < N_PEAKS; ix++)