diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-11-22 16:30:19 +0100 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-11-22 16:30:19 +0100 |
commit | 533aa1816b2c90b3935504b489e03e6ef87038a6 (patch) | |
tree | 09140f39264c2939a5eb2683d05827894f62dac3 /examples/sinewave.c | |
parent | eda1d8c0bf70fc582a02b32df82d600b8b1cbe25 (diff) | |
download | reduced_system_layer-533aa1816b2c90b3935504b489e03e6ef87038a6.zip |
Update audio
Diffstat (limited to 'examples/sinewave.c')
-rwxr-xr-x | examples/sinewave.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/sinewave.c b/examples/sinewave.c index 59d1161..e45f71e 100755 --- a/examples/sinewave.c +++ b/examples/sinewave.c @@ -73,15 +73,15 @@ i32 main(i32 argc, c8 **argv) { .graceful_exit = 1, }; - f64 frequency = 440. * 4; + f64 frequency = 440. * 6; for (i64 i = 0; i < AUDIO_SAMPLE_RATE; ++i) { f64 t = ((f64) i) / AUDIO_SAMPLE_RATE; f64 x = sin(t * frequency); - if (t < .1) - x *= t / .1; - if (t > .7) - x *= (1. - t) / .3; + if (t < .005) + x *= t / .005; + if (t > .1) + x *= (1. - t) / .9; frames[i * 2] = (f32) x * .5; frames[i * 2 + 1] = (f32) x * .5; } |