guitfx/sust.h

32 lines
529 B
C

#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 );
void sust_resize( struct sust * sust, size_t new_len );
void sust_swap( struct sust * sust );
void sust_process(
struct sust * sust,
size_t frame_size,
float const * in,
float * out
);