2024-12-08 15:57:19 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
struct delay {
|
|
|
|
uint64_t duration;
|
|
|
|
float feedback;
|
|
|
|
float mix;
|
|
|
|
|
|
|
|
uint64_t buf_idx;
|
2024-12-08 16:40:53 +01:00
|
|
|
size_t buf_capacity;
|
2024-12-08 15:57:19 +01:00
|
|
|
float * buf;
|
|
|
|
};
|
|
|
|
|
|
|
|
void delay_init(
|
|
|
|
struct delay * delay
|
|
|
|
);
|
|
|
|
|
2024-12-08 16:40:53 +01:00
|
|
|
void delay_set_time(
|
|
|
|
struct delay * delay,
|
|
|
|
uint64_t new_duration
|
|
|
|
);
|
|
|
|
|
2024-12-08 15:57:19 +01:00
|
|
|
void delay_process(
|
|
|
|
struct delay * delay,
|
|
|
|
size_t frame_size,
|
|
|
|
float const * in,
|
|
|
|
float * out
|
|
|
|
);
|