guitfx/gate.h

29 lines
451 B
C
Raw Permalink Normal View History

2025-01-12 05:08:18 +01:00
#pragma once
#include <stdbool.h>
2025-02-17 18:06:56 +01:00
#include <stddef.h>
#include <stdint.h>
2025-01-12 05:08:18 +01:00
struct gate {
2025-02-17 18:06:56 +01:00
float threshold;
bool enable_calibration;
2025-01-12 05:08:18 +01:00
2025-02-17 18:06:56 +01:00
unsigned block_size;
unsigned cur_block_count;
float cur_block_sum;
float last_block_sum;
2025-01-12 05:08:18 +01:00
2025-02-17 18:06:56 +01:00
bool is_active;
float cur_gain;
2025-02-17 18:06:56 +01:00
float attack;
float release;
2025-01-12 05:08:18 +01:00
};
void gate_init();
void gate_process(
2025-02-17 18:06:56 +01:00
struct gate* gate,
size_t frame_size,
float const* in,
float* out);