From 2cf000fb7cbe653c2e96e0b3b8f3c1425401d3fc Mon Sep 17 00:00:00 2001 From: sanine Date: Sat, 3 Sep 2022 21:32:25 -0500 Subject: add looping --- examples/loop.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 examples/loop.c (limited to 'examples/loop.c') diff --git a/examples/loop.c b/examples/loop.c new file mode 100644 index 0000000..1be04a9 --- /dev/null +++ b/examples/loop.c @@ -0,0 +1,40 @@ +#include +#include +#include +#include + +#define PI 3.14159 + + +#define SAMPLE_RATE 44100 +#define N_CHANNELS 8 + +float f(float t) +{ + const int f0 = 440; + const int f1 = 880; + return ( t*f1 ) + ( (1-t)*f0 ); +} + +int main() +{ + float data[SAMPLE_RATE]; + for (long i=0; i