synththing/src/filters/svf.h

43 lines
820 B
C

/*
* Filename: svf.c
*
* Description:
*
*
* Version:
* Created: Wed Oct 30 00:00:40 2019
* Revision: None
* Author: Rachel Fae Fox (foxiepaws),fox@foxiepa.ws
*
*/
#ifndef _H_FILTERS_SVF
#define _H_FILTERS_SVF
#include <math.h>
#include <stdlib.h>
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
typedef enum DBO { _6dbo, _12dbo, _18dbo, _24dbo, _36dbo = 6, _48dbo } DBO;
typedef struct SVF {
float notch;
float low;
float high;
float band;
float drive;
float freq;
float q;
DBO dbo;
float out;
float(*damp)(struct SVF*);
float(*process)(struct SVF*,float in);
void(*reset)(struct SVF*);
} SVF;
float svf_damp(SVF *self);
float svf_process(SVF *self,float in);
void svf_reset(SVF* self);
SVF* svf_new(float freq,float q,float drive);
#endif