git ssb

0+

cel / foostudio



Tree: 6cd4730c51cbbdc9bcc196a95d8dd12dba65eef3

Files: 6cd4730c51cbbdc9bcc196a95d8dd12dba65eef3 / tune.c

392 bytesRaw
1#include <math.h>
2#include <malloc.h>
3#include "tune.h"
4#include "foobuf.h"
5
6float play(void *obj, double time, float in)
7{
8 struct {
9 struct foobuf *buf;
10 } *state = obj;
11 struct_init(&state);
12 foobuf_init(&state->buf, 48000);
13
14 float out = in*0.5 + foobuf_read(state->buf, 0)*0.5;
15 foobuf_write(state->buf, out);
16 return out;
17
18 // return sin(2. * M_PI * time * 440.) * 0.25 + in * 0.75;
19}
20

Built with git-ssb-web