guitfx/delay.h

28 lines
421 B
C
Raw Normal View History

2024-12-08 15:57:19 +01:00
#pragma once
#include <stddef.h>
2025-02-17 18:06:56 +01:00
#include <stdint.h>
2024-12-08 15:57:19 +01:00
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;
2025-02-17 18:06:56 +01:00
float* buf;
2024-12-08 15:57:19 +01:00
};
void delay_init(
2025-02-17 18:06:56 +01:00
struct delay* delay);
2024-12-08 15:57:19 +01:00
2024-12-08 16:40:53 +01:00
void delay_set_time(
2025-02-17 18:06:56 +01:00
struct delay* delay,
uint64_t new_duration);
2024-12-08 16:40:53 +01:00
2024-12-08 15:57:19 +01:00
void delay_process(
2025-02-17 18:06:56 +01:00
struct delay* delay,
2024-12-08 15:57:19 +01:00
size_t frame_size,
2025-02-17 18:06:56 +01:00
float const* in,
float* out);