30 lines
430 B
C
30 lines
430 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
struct delay {
|
|
uint64_t duration;
|
|
float feedback;
|
|
float mix;
|
|
|
|
uint64_t buf_idx;
|
|
size_t buf_capacity;
|
|
float * buf;
|
|
};
|
|
|
|
void delay_init(
|
|
struct delay * delay
|
|
);
|
|
|
|
void delay_set_time(
|
|
struct delay * delay,
|
|
uint64_t new_duration
|
|
);
|
|
|
|
void delay_process(
|
|
struct delay * delay,
|
|
size_t frame_size,
|
|
float const * in,
|
|
float * out
|
|
);
|