From 5a271f314cb0021fe73102390000052c698b0c11 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 20 Jan 2025 10:19:44 -0500 Subject: [PATCH] Update main.c try sin wave --- main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index e7903a0a..60c53e7f 100644 --- a/main.c +++ b/main.c @@ -1975,13 +1975,15 @@ void write_wave(int i, short int *buffer) else { if ((ctr - flip_ctr) < smaller) { -// buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); - buffer[ctr++] = (short int)(phase * sin_map[ctr % sin_samples] / 2); +// buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); + buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); +// buffer[ctr++] = (short int)(phase * sin_map[ctr % sin_samples] / 2); // if (ctr < 1000) printf("*"); } else -// buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); buffer[ctr++] = (short int)(amplitude * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); - buffer[ctr++] = (short int)(phase * sin_map[ctr % sin_samples]); +// buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); + buffer[ctr++] = (short int)(amplitude * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); +// buffer[ctr++] = (short int)(phase * sin_map[ctr % sin_samples]); } // if (ctr < 1000) printf("%d %d %d \n", ctr, i, buffer[ctr - 1]);