2024-12-08 20:02:05 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
enum sust_mode {
|
|
|
|
MODE_Sustain = 0,
|
|
|
|
MODE_Sostenuto = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sust {
|
|
|
|
enum sust_mode mode;
|
|
|
|
bool playing;
|
|
|
|
|
|
|
|
size_t start_idx;
|
|
|
|
size_t idx;
|
|
|
|
size_t buf_len;
|
|
|
|
float * record_buf;
|
|
|
|
float * play_buf;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void sust_init( struct sust * sust );
|
2024-12-13 12:59:33 +01:00
|
|
|
void sust_resize( struct sust * sust, size_t new_len );
|
2024-12-08 20:02:05 +01:00
|
|
|
void sust_swap( struct sust * sust );
|
|
|
|
|
|
|
|
void sust_process(
|
|
|
|
struct sust * sust,
|
|
|
|
size_t frame_size,
|
|
|
|
float const * in,
|
|
|
|
float * out
|
|
|
|
);
|