~pbatch/sndkit

sndkit/examples/ex1.c -rw-r--r-- 557 bytes
d868124fPaul Batchelor removed prerequisites from suffix rule to comply with POSIX make 4 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <math.h>
#include <stdio.h>
#include "patchwerk.h"
#include "core.h"
#include "wavout/wavout.h"
#include "sine/sine.h"

int main(int argc, char *argv[])
{
    sk_core *core;
    unsigned int n;
    unsigned int nblocks;

    core = sk_core_new(44100);

    nblocks = sk_core_seconds_to_blocks(core, 10);

    sk_core_constant(core, 440);
    sk_core_constant(core, 0.5);
    sk_node_sine(core);

    sk_node_wavout(core, "test.wav");

    for (n = 0; n < nblocks; n++) {
        sk_core_compute(core);
    }

    sk_core_del(core);
    return 0;
}