#include #include #include "tune.h" #include "foobuf.h" float play(void *obj, double time, float in) { struct { struct foobuf *buf; } *state = obj; struct_init(&state); foobuf_init(&state->buf, 48000); float out = in*0.5 + foobuf_read(state->buf, 0)*0.5; foobuf_write(state->buf, out); return out; // return sin(2. * M_PI * time * 440.) * 0.25 + in * 0.75; }