leaf-filters.h
1 /*==============================================================================
2 
3  leaf-filters.h
4  Created: 20 Jan 2017 12:01:10pm
5  Author: Michael R Mulshine
6 
7  ==============================================================================*/
8 
9 #ifndef LEAF_FILTERS_H_INCLUDED
10 #define LEAF_FILTERS_H_INCLUDED
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16  //==============================================================================
17 
18 #include "leaf-math.h"
19 #include "leaf-mempool.h"
20 #include "leaf-delay.h"
21 #include "leaf-tables.h"
22 
31  //==============================================================================
32 
67  typedef struct _tAllpass
68  {
69 
70  tMempool mempool;
71 
72  float gain;
73 
74  tLinearDelay delay;
75 
76  float lastOut;
77  } _tAllpass;
78 
79  typedef _tAllpass* tAllpass;
80 
81  void tAllpass_init (tAllpass* const, float initDelay, uint32_t maxDelay, LEAF* const leaf);
82  void tAllpass_initToPool (tAllpass* const, float initDelay, uint32_t maxDelay, tMempool* const);
83  void tAllpass_free (tAllpass* const);
84 
85  float tAllpass_tick (tAllpass* const, float input);
86  void tAllpass_setGain (tAllpass* const, float gain);
87  void tAllpass_setDelay (tAllpass* const, float delay);
88 
89 
90  //==============================================================================
91 
142  typedef struct _tOnePole
143  {
144 
145  tMempool mempool;
146  float gain;
147  float a0,a1;
148  float b0,b1;
149  float lastIn, lastOut;
150  } _tOnePole;
151 
152  typedef _tOnePole* tOnePole;
153 
154  void tOnePole_init (tOnePole* const, float thePole, LEAF* const leaf);
155  void tOnePole_initToPool (tOnePole* const, float thePole, tMempool* const);
156  void tOnePole_free (tOnePole* const);
157 
158  float tOnePole_tick (tOnePole* const, float input);
159  void tOnePole_setB0 (tOnePole* const, float b0);
160  void tOnePole_setA1 (tOnePole* const, float a1);
161  void tOnePole_setPole (tOnePole* const, float thePole);
162  void tOnePole_setFreq (tOnePole* const, float freq);
163  void tOnePole_setCoefficients(tOnePole* const, float b0, float a1);
164  void tOnePole_setGain (tOnePole* const, float gain);
165 
166  //==============================================================================
167 
218  typedef struct _tTwoPole
219  {
220 
221  tMempool mempool;
222 
223  float gain;
224  float a0, a1, a2;
225  float b0;
226 
227  float radius, frequency;
228  int normalize;
229 
230  float lastOut[2];
231  } _tTwoPole;
232 
233  typedef _tTwoPole* tTwoPole;
234 
235  void tTwoPole_init (tTwoPole* const, LEAF* const leaf);
236  void tTwoPole_initToPool (tTwoPole* const, tMempool* const);
237  void tTwoPole_free (tTwoPole* const);
238 
239  float tTwoPole_tick (tTwoPole* const, float input);
240  void tTwoPole_setB0 (tTwoPole* const, float b0);
241  void tTwoPole_setA1 (tTwoPole* const, float a1);
242  void tTwoPole_setA2 (tTwoPole* const, float a2);
243  void tTwoPole_setResonance (tTwoPole* const, float freq, float radius, int normalize);
244  void tTwoPole_setCoefficients(tTwoPole* const, float b0, float a1, float a2);
245  void tTwoPole_setGain (tTwoPole* const, float gain);
246 
247  //==============================================================================
248 
299  typedef struct _tOneZero
300  {
301 
302  tMempool mempool;
303  float gain;
304  float b0,b1;
305  float lastIn, lastOut, frequency;
306  } _tOneZero;
307 
308  typedef _tOneZero* tOneZero;
309 
310  void tOneZero_init (tOneZero* const, float theZero, LEAF* const leaf);
311  void tOneZero_initToPool (tOneZero* const, float theZero, tMempool* const);
312  void tOneZero_free (tOneZero* const);
313 
314  float tOneZero_tick (tOneZero* const, float input);
315  void tOneZero_setB0 (tOneZero* const, float b0);
316  void tOneZero_setB1 (tOneZero* const, float b1);
317  void tOneZero_setZero (tOneZero* const, float theZero);
318  void tOneZero_setCoefficients(tOneZero* const, float b0, float b1);
319  void tOneZero_setGain (tOneZero* const, float gain);
320  float tOneZero_getPhaseDelay (tOneZero *f, float frequency);
321 
322  //==============================================================================
323 
375  typedef struct _tTwoZero
376  {
377 
378  tMempool mempool;
379 
380  float gain;
381  float b0, b1, b2;
382 
383  float frequency, radius;
384 
385  float lastIn[2];
386  } _tTwoZero;
387 
388  typedef _tTwoZero* tTwoZero;
389 
390  void tTwoZero_init (tTwoZero* const, LEAF* const leaf);
391  void tTwoZero_initToPool (tTwoZero* const, tMempool* const);
392  void tTwoZero_free (tTwoZero* const);
393 
394  float tTwoZero_tick (tTwoZero* const, float input);
395  void tTwoZero_setB0 (tTwoZero* const, float b0);
396  void tTwoZero_setB1 (tTwoZero* const, float b1);
397  void tTwoZero_setB2 (tTwoZero* const, float b2);
398  void tTwoZero_setNotch (tTwoZero* const, float frequency, float radius);
399  void tTwoZero_setCoefficients(tTwoZero* const, float b0, float b1, float b2);
400  void tTwoZero_setGain (tTwoZero* const, float gain);
401 
402  //==============================================================================
403 
460  typedef struct _tPoleZero
461  {
462 
463  tMempool mempool;
464 
465  float gain;
466  float a0,a1;
467  float b0,b1;
468 
469  float lastIn, lastOut;
470  } _tPoleZero;
471 
472  typedef _tPoleZero* tPoleZero;
473 
474  void tPoleZero_init (tPoleZero* const, LEAF* const leaf);
475  void tPoleZero_initToPool (tPoleZero* const, tMempool* const);
476  void tPoleZero_free (tPoleZero* const);
477 
478  float tPoleZero_tick (tPoleZero* const, float input);
479  void tPoleZero_setB0 (tPoleZero* const, float b0);
480  void tPoleZero_setB1 (tPoleZero* const, float b1);
481  void tPoleZero_setA1 (tPoleZero* const, float a1);
482  void tPoleZero_setCoefficients (tPoleZero* const, float b0, float b1, float a1);
483  void tPoleZero_setAllpass (tPoleZero* const, float coeff);
484  void tPoleZero_setBlockZero (tPoleZero* const, float thePole);
485  void tPoleZero_setGain (tPoleZero* const, float gain);
486 
487  //==============================================================================
488 
553  typedef struct _tBiQuad
554  {
555 
556  tMempool mempool;
557 
558  float gain;
559  float a0, a1, a2;
560  float b0, b1, b2;
561 
562  float lastIn[2];
563  float lastOut[2];
564 
565  float frequency, radius;
566  int normalize;
567  } _tBiQuad;
568 
569  typedef _tBiQuad* tBiQuad;
570 
571  void tBiQuad_init (tBiQuad* const, LEAF* const leaf);
572  void tBiQuad_initToPool (tBiQuad* const, tMempool* const);
573  void tBiQuad_free (tBiQuad* const);
574 
575  float tBiQuad_tick (tBiQuad* const, float input);
576  void tBiQuad_setB0 (tBiQuad* const, float b0);
577  void tBiQuad_setB1 (tBiQuad* const, float b1);
578  void tBiQuad_setB2 (tBiQuad* const, float b2);
579  void tBiQuad_setA1 (tBiQuad* const, float a1);
580  void tBiQuad_setA2 (tBiQuad* const, float a2);
581  void tBiQuad_setNotch (tBiQuad* const, float freq, float radius);
582  void tBiQuad_setResonance (tBiQuad* const, float freq, float radius, int normalize);
583  void tBiQuad_setCoefficients(tBiQuad* const, float b0, float b1, float b2, float a1, float a2);
584  void tBiQuad_setGain (tBiQuad* const, float gain);
585 
586  //==============================================================================
587 
626  typedef enum SVFType
627  {
628  SVFTypeHighpass = 0,
629  SVFTypeLowpass,
630  SVFTypeBandpass,
631  SVFTypeNotch,
632  SVFTypePeak,
633  SVFTypeLowShelf,
634  SVFTypeHighShelf
635  } SVFType;
636 
637  typedef struct _tSVF
638  {
639 
640  tMempool mempool;
641  SVFType type;
642  float cutoff, Q;
643  float ic1eq,ic2eq;
644  float g,k,a1,a2,a3,cH,cB,cL,cBK;
645  } _tSVF;
646 
647  typedef _tSVF* tSVF;
648 
649  void tSVF_init (tSVF* const, SVFType type, float freq, float Q, LEAF* const leaf);
650  void tSVF_initToPool (tSVF* const, SVFType type, float freq, float Q, tMempool* const);
651  void tSVF_free (tSVF* const);
652 
653  float tSVF_tick (tSVF* const, float v0);
654  void tSVF_setFreq (tSVF* const, float freq);
655  void tSVF_setQ (tSVF* const, float Q);
656  void tSVF_setFreqAndQ (tSVF* const svff, float freq, float Q);
657 
658  //==============================================================================
659 
694  typedef struct _tEfficientSVF
695  {
696 
697  tMempool mempool;
698  SVFType type;
699  float cutoff, Q;
700  float ic1eq,ic2eq;
701  float g,k,a1,a2,a3;
702  } _tEfficientSVF;
703 
704  typedef _tEfficientSVF* tEfficientSVF;
705 
706  void tEfficientSVF_init (tEfficientSVF* const, SVFType type, uint16_t input, float Q, LEAF* const leaf);
707  void tEfficientSVF_initToPool (tEfficientSVF* const, SVFType type, uint16_t input, float Q, tMempool* const);
708  void tEfficientSVF_free (tEfficientSVF* const);
709 
710  float tEfficientSVF_tick (tEfficientSVF* const, float v0);
711  void tEfficientSVF_setFreq (tEfficientSVF* const, uint16_t controlFreq);
712  void tEfficientSVF_setQ (tEfficientSVF* const, float Q);
713 
714  //==============================================================================
715 
750  typedef struct _tHighpass
751  {
752 
753  tMempool mempool;
754  float xs, ys, R;
755  float frequency;
756  } _tHighpass;
757 
758  typedef _tHighpass* tHighpass;
759 
760  void tHighpass_init (tHighpass* const, float freq, LEAF* const leaf);
761  void tHighpass_initToPool (tHighpass* const, float freq, tMempool* const);
762  void tHighpass_free (tHighpass* const);
763 
764  float tHighpass_tick (tHighpass* const, float x);
765  void tHighpass_setFreq (tHighpass* const, float freq);
766  float tHighpass_getFreq (tHighpass* const);
767 
768  //==============================================================================
769 
814 #define NUM_SVF_BW 16
815  typedef struct _tButterworth
816  {
817  tMempool mempool;
818 
819  float gain;
820  int order;
821  int numSVF;
822 
823  tSVF* svf;
824 
825  float f1,f2;
826  } _tButterworth;
827 
828  typedef _tButterworth* tButterworth;
829 
830  void tButterworth_init (tButterworth* const, int N, float f1, float f2, LEAF* const leaf);
831  void tButterworth_initToPool (tButterworth* const, int N, float f1, float f2, tMempool* const);
832  void tButterworth_free (tButterworth* const);
833 
834  float tButterworth_tick (tButterworth* const, float input);
835  void tButterworth_setF1 (tButterworth* const, float in);
836  void tButterworth_setF2 (tButterworth* const, float in);
837  void tButterworth_setFreqs (tButterworth* const, float f1, float f2);
838 
839  //==============================================================================
840 
867  typedef struct _tFIR
868  {
869 
870  tMempool mempool;
871  float* past;
872  float* coeff;
873  int numTaps;
874  } _tFIR;
875 
876  typedef _tFIR* tFIR;
877 
878  void tFIR_init (tFIR* const, float* coeffs, int numTaps, LEAF* const leaf);
879  void tFIR_initToPool (tFIR* const, float* coeffs, int numTaps, tMempool* const);
880  void tFIR_free (tFIR* const);
881 
882  float tFIR_tick (tFIR* const, float input);
883 
884 
885  //==============================================================================
886 
913  typedef struct _tMedianFilter
914  {
915 
916  tMempool mempool;
917  float* val;
918  int* age;
919  int m;
920  int size;
921  int middlePosition;
922  int last;
923  int pos;
924  } _tMedianFilter;
925 
926  typedef _tMedianFilter* tMedianFilter;
927 
928  void tMedianFilter_init (tMedianFilter* const, int size, LEAF* const leaf);
929  void tMedianFilter_initToPool (tMedianFilter* const, int size, tMempool* const);
930  void tMedianFilter_free (tMedianFilter* const);
931 
932  float tMedianFilter_tick (tMedianFilter* const, float input);
933 
934 
997  typedef enum VZFilterType
998  {
999  Highpass = 0,
1000  Lowpass,
1001  BandpassSkirt,
1002  BandpassPeak,
1003  BandReject,
1004  Bell,
1005  Lowshelf,
1006  Highshelf,
1007  Morph,
1008  Bypass,
1009  Allpass
1010  } VZFilterType;
1011 
1012 
1013  typedef struct _tVZFilter
1014  {
1015 
1016  tMempool mempool;
1017 
1018  VZFilterType type;
1019  // state:
1020  float s1, s2;
1021 
1022  // filter coefficients:
1023  float g; // embedded integrator gain
1024  float R2; // twice the damping coefficient (R2 == 2*R == 1/Q)
1025  float h; // factor for feedback (== 1/(1+2*R*g+g*g))
1026  float cL, cB, cH; // coefficients for low-, band-, and highpass signals
1027 
1028  // parameters:
1029  float fc; // characteristic frequency
1030  float G; // gain
1031  float invG; //1/gain
1032  float B; // bandwidth (in octaves)
1033  float m; // morph parameter (0...1)
1034 
1035  float sr; //local sampling rate of filter (may be different from leaf sr if oversampled)
1036  float inv_sr;
1037  } _tVZFilter;
1038 
1039  typedef _tVZFilter* tVZFilter;
1040 
1041  void tVZFilter_init (tVZFilter* const, VZFilterType type, float freq, float Q, LEAF* const leaf);
1042  void tVZFilter_initToPool (tVZFilter* const, VZFilterType type, float freq, float Q, tMempool* const);
1043  void tVZFilter_free (tVZFilter* const);
1044 
1045  void tVZFilter_setSampleRate (tVZFilter* const, float sampleRate);
1046  float tVZFilter_tick (tVZFilter* const, float input);
1047  float tVZFilter_tickEfficient (tVZFilter* const vf, float in);
1048  void tVZFilter_calcCoeffs (tVZFilter* const);
1049  void tVZFilter_calcCoeffsEfficientBP (tVZFilter* const);
1050  void tVZFilter_setBandwidth (tVZFilter* const, float bandWidth);
1051  void tVZFilter_setFreq (tVZFilter* const, float freq);
1052  void tVZFilter_setFreqAndBandwidth (tVZFilter* const vf, float freq, float bw);
1053  void tVZFilter_setFreqAndBandwidthEfficientBP (tVZFilter* const vf, float freq, float bw);
1054  void tVZFilter_setGain (tVZFilter* const, float gain);
1055 
1056  void tVZFilter_setType (tVZFilter* const, VZFilterType type);
1057  float tVZFilter_BandwidthToR (tVZFilter* const vf, float B);
1058  float tVZFilter_BandwidthToREfficientBP(tVZFilter* const vf, float B);
1059 
1094  //diode ladder filter
1095  typedef struct _tDiodeFilter
1096  {
1097 
1098  tMempool mempool;
1099  float f;
1100  float r;
1101  float Vt;
1102  float n;
1103  float gamma;
1104  float zi;
1105  float g0inv;
1106  float g1inv;
1107  float g2inv;
1108  float s0, s1, s2, s3;
1109  } _tDiodeFilter;
1110 
1111  typedef _tDiodeFilter* tDiodeFilter;
1112 
1113  void tDiodeFilter_init (tDiodeFilter* const, float freq, float Q, LEAF* const leaf);
1114  void tDiodeFilter_initToPool (tDiodeFilter* const, float freq, float Q, tMempool* const);
1115  void tDiodeFilter_free (tDiodeFilter* const);
1116 
1117  float tDiodeFilter_tick (tDiodeFilter* const, float input);
1118  void tDiodeFilter_setFreq (tDiodeFilter* const vf, float cutoff);
1119  void tDiodeFilter_setQ (tDiodeFilter* const vf, float resonance);
1120 
1121 
1122 #ifdef __cplusplus
1123 }
1124 #endif
1125 
1126 #endif // LEAF_FILTERS_H_INCLUDED
1127 
1128 //==============================================================================
1129 
1130 
tBiQuad_setB1
void tBiQuad_setB1(tBiQuad *const, float b1)
Definition: leaf-filters.c:706
tOnePole_setFreq
void tOnePole_setFreq(tOnePole *const, float freq)
Definition: leaf-filters.c:131
tBiQuad_setB0
void tBiQuad_setB0(tBiQuad *const, float b0)
Definition: leaf-filters.c:700
tOnePole_setA1
void tOnePole_setA1(tOnePole *const, float a1)
Definition: leaf-filters.c:111
tBiQuad_free
void tBiQuad_free(tBiQuad *const)
Free a tBiQuad from its mempool.
Definition: leaf-filters.c:626
tDiodeFilter_init
void tDiodeFilter_init(tDiodeFilter *const, float freq, float Q, LEAF *const leaf)
Initialize a tDiodeFilter to the default mempool of a LEAF instance.
Definition: leaf-filters.c:1545
tTwoZero_setNotch
void tTwoZero_setNotch(tTwoZero *const, float frequency, float radius)
Definition: leaf-filters.c:431
tBiQuad_tick
float tBiQuad_tick(tBiQuad *const, float input)
Definition: leaf-filters.c:633
tOneZero_tick
float tOneZero_tick(tOneZero *const, float input)
Definition: leaf-filters.c:314
tVZFilter_setGain
void tVZFilter_setGain(tVZFilter *const, float gain)
Definition: leaf-filters.c:1496
tTwoZero_setB2
void tTwoZero_setB2(tTwoZero *const, float b2)
tTwoPole_setA2
void tTwoPole_setA2(tTwoPole *const, float a2)
Definition: leaf-filters.c:220
tOnePole_setCoefficients
void tOnePole_setCoefficients(tOnePole *const, float b0, float a1)
Definition: leaf-filters.c:141
tOnePole_setB0
void tOnePole_setB0(tOnePole *const, float b0)
Definition: leaf-filters.c:105
tTwoZero_tick
float tTwoZero_tick(tTwoZero *const, float input)
Definition: leaf-filters.c:418
tOnePole_init
void tOnePole_init(tOnePole *const, float thePole, LEAF *const leaf)
Initialize a tOnePole to the default mempool of a LEAF instance.
Definition: leaf-filters.c:78
tOneZero_free
void tOneZero_free(tOneZero *const)
Free a tOneZero from its mempool.
Definition: leaf-filters.c:307
tButterworth_setF1
void tButterworth_setF1(tButterworth *const, float in)
Definition: leaf-filters.c:1088
tFIR_tick
float tFIR_tick(tFIR *const, float input)
Definition: leaf-filters.c:1149
tFIR_init
void tFIR_init(tFIR *const, float *coeffs, int numTaps, LEAF *const leaf)
Initialize a tFIR to the default mempool of a LEAF instance.
Definition: leaf-filters.c:1124
tOnePole_setGain
void tOnePole_setGain(tOnePole *const, float gain)
Definition: leaf-filters.c:149
tEfficientSVF_free
void tEfficientSVF_free(tEfficientSVF *const)
Free a tEfficientSVF from its mempool.
Definition: leaf-filters.c:927
tPoleZero_initToPool
void tPoleZero_initToPool(tPoleZero *const, tMempool *const)
Initialize a tPoleZero to a specified mempool.
Definition: leaf-filters.c:495
tHighpass_tick
float tHighpass_tick(tHighpass *const, float x)
Definition: leaf-filters.c:1020
tSVF_free
void tSVF_free(tSVF *const)
Free a tSVF from its mempool.
Definition: leaf-filters.c:840
tOnePole_initToPool
void tOnePole_initToPool(tOnePole *const, float thePole, tMempool *const)
Initialize a tOnePole to a specified mempool.
Definition: leaf-filters.c:83
tVZFilter_setBandwidth
void tVZFilter_setBandwidth(tVZFilter *const, float bandWidth)
Definition: leaf-filters.c:1460
tVZFilter_calcCoeffs
void tVZFilter_calcCoeffs(tVZFilter *const)
Definition: leaf-filters.c:1342
tAllpass_tick
float tAllpass_tick(tAllpass *const, float input)
Definition: leaf-filters.c:64
tBiQuad_setGain
void tBiQuad_setGain(tBiQuad *const, float gain)
Definition: leaf-filters.c:740
tPoleZero_setA1
void tPoleZero_setA1(tPoleZero *const, float a1)
Definition: leaf-filters.c:528
tTwoZero_free
void tTwoZero_free(tTwoZero *const)
Free a tTwoZero from its mempool.
Definition: leaf-filters.c:411
tSVF_setFreqAndQ
void tSVF_setFreqAndQ(tSVF *const svff, float freq, float Q)
Definition: leaf-filters.c:889
tBiQuad_setA1
void tBiQuad_setA1(tBiQuad *const, float a1)
Definition: leaf-filters.c:718
tOneZero_setB1
void tOneZero_setB1(tOneZero *const, float b1)
Definition: leaf-filters.c:344
tEfficientSVF_initToPool
void tEfficientSVF_initToPool(tEfficientSVF *const, SVFType type, uint16_t input, float Q, tMempool *const)
Initialize a tEfficientSVF to a specified mempool.
Definition: leaf-filters.c:909
tTwoPole_setResonance
void tTwoPole_setResonance(tTwoPole *const, float freq, float radius, int normalize)
Definition: leaf-filters.c:227
tBiQuad_setB2
void tBiQuad_setB2(tBiQuad *const, float b2)
Definition: leaf-filters.c:712
tBiQuad_setNotch
void tBiQuad_setNotch(tBiQuad *const, float freq, float radius)
Definition: leaf-filters.c:676
tPoleZero_init
void tPoleZero_init(tPoleZero *const, LEAF *const leaf)
Initialize a tPoleZero to the default mempool of a LEAF instance.
Definition: leaf-filters.c:490
tSVF_tick
float tSVF_tick(tSVF *const, float v0)
Definition: leaf-filters.c:847
tHighpass_initToPool
void tHighpass_initToPool(tHighpass *const, float freq, tMempool *const)
Initialize a tHighpass to a specified mempool.
Definition: leaf-filters.c:981
tButterworth_setF2
void tButterworth_setF2(tButterworth *const, float in)
Definition: leaf-filters.c:1098
tHighpass_setFreq
void tHighpass_setFreq(tHighpass *const, float freq)
Definition: leaf-filters.c:1003
tDiodeFilter_setQ
void tDiodeFilter_setQ(tDiodeFilter *const vf, float resonance)
Definition: leaf-filters.c:1682
tTwoZero_init
void tTwoZero_init(tTwoZero *const, LEAF *const leaf)
Initialize a tTwoZero to the default mempool of a LEAF instance.
Definition: leaf-filters.c:395
tSVF_setQ
void tSVF_setQ(tSVF *const, float Q)
Definition: leaf-filters.c:878
tPoleZero_setCoefficients
void tPoleZero_setCoefficients(tPoleZero *const, float b0, float b1, float a1)
Definition: leaf-filters.c:540
tMedianFilter_tick
float tMedianFilter_tick(tMedianFilter *const, float input)
Definition: leaf-filters.c:1199
tOneZero_setGain
void tOneZero_setGain(tOneZero *const, float gain)
Definition: leaf-filters.c:357
tAllpass_initToPool
void tAllpass_initToPool(tAllpass *const, float initDelay, uint32_t maxDelay, tMempool *const)
Initialize a tAllpass to a specified mempool.
Definition: leaf-filters.c:29
tPoleZero_setAllpass
void tPoleZero_setAllpass(tPoleZero *const, float coeff)
Definition: leaf-filters.c:554
tVZFilter_setFreqAndBandwidth
void tVZFilter_setFreqAndBandwidth(tVZFilter *const vf, float freq, float bw)
Definition: leaf-filters.c:1474
tDiodeFilter_free
void tDiodeFilter_free(tDiodeFilter *const)
Free a tDiodeFilter from its mempool.
Definition: leaf-filters.c:1574
tTwoPole_setA1
void tTwoPole_setA1(tTwoPole *const, float a1)
Definition: leaf-filters.c:214
tPoleZero_setGain
void tPoleZero_setGain(tPoleZero *const, float gain)
Definition: leaf-filters.c:584
tBiQuad_setCoefficients
void tBiQuad_setCoefficients(tBiQuad *const, float b0, float b1, float b2, float a1, float a2)
Definition: leaf-filters.c:730
tBiQuad_setA2
void tBiQuad_setA2(tBiQuad *const, float a2)
Definition: leaf-filters.c:724
tOneZero_init
void tOneZero_init(tOneZero *const, float theZero, LEAF *const leaf)
Initialize a tOneZero to the default mempool of a LEAF instance.
Definition: leaf-filters.c:290
tSVF_initToPool
void tSVF_initToPool(tSVF *const, SVFType type, float freq, float Q, tMempool *const)
Initialize a tSVF to a specified mempool.
Definition: leaf-filters.c:775
tTwoPole_init
void tTwoPole_init(tTwoPole *const, LEAF *const leaf)
Initialize a tTwoPole to the default mempool of a LEAF instance.
Definition: leaf-filters.c:169
tSVF_init
void tSVF_init(tSVF *const, SVFType type, float freq, float Q, LEAF *const leaf)
Initialize a tSVF to the default mempool of a LEAF instance.
Definition: leaf-filters.c:764
tEfficientSVF_init
void tEfficientSVF_init(tEfficientSVF *const, SVFType type, uint16_t input, float Q, LEAF *const leaf)
Initialize a tEfficientSVF to the default mempool of a LEAF instance.
Definition: leaf-filters.c:904
tOneZero_setB0
void tOneZero_setB0(tOneZero *const, float b0)
Definition: leaf-filters.c:337
tMedianFilter_init
void tMedianFilter_init(tMedianFilter *const, int size, LEAF *const leaf)
Initialize a tMedianFilter to the default mempool of a LEAF instance.
Definition: leaf-filters.c:1166
tTwoZero_setGain
void tTwoZero_setGain(tTwoZero *const, float gain)
Definition: leaf-filters.c:476
tTwoZero_setB1
void tTwoZero_setB1(tTwoZero *const, float b1)
Definition: leaf-filters.c:462
tMedianFilter_initToPool
void tMedianFilter_initToPool(tMedianFilter *const, int size, tMempool *const)
Initialize a tMedianFilter to a specified mempool.
Definition: leaf-filters.c:1171
tOnePole_free
void tOnePole_free(tOnePole *const)
Free a tOnePole from its mempool.
Definition: leaf-filters.c:98
tButterworth_initToPool
void tButterworth_initToPool(tButterworth *const, int N, float f1, float f2, tMempool *const)
Initialize a tButterworth to a specified mempool.
Definition: leaf-filters.c:1041
tDiodeFilter_initToPool
void tDiodeFilter_initToPool(tDiodeFilter *const, float freq, float Q, tMempool *const)
Initialize a tDiodeFilter to a specified mempool.
Definition: leaf-filters.c:1550
tOneZero_initToPool
void tOneZero_initToPool(tOneZero *const, float theZero, tMempool *const)
Initialize a tOneZero to a specified mempool.
Definition: leaf-filters.c:295
tBiQuad_setResonance
void tBiQuad_setResonance(tBiQuad *const, float freq, float radius, int normalize)
Definition: leaf-filters.c:650
tDiodeFilter_tick
float tDiodeFilter_tick(tDiodeFilter *const, float input)
Definition: leaf-filters.c:1595
tFIR_initToPool
void tFIR_initToPool(tFIR *const, float *coeffs, int numTaps, tMempool *const)
Initialize a tFIR to a specified mempool.
Definition: leaf-filters.c:1129
tVZFilter_initToPool
void tVZFilter_initToPool(tVZFilter *const, VZFilterType type, float freq, float Q, tMempool *const)
Initialize a tVZFilter to a specified mempool.
Definition: leaf-filters.c:1245
tVZFilter_free
void tVZFilter_free(tVZFilter *const)
Free a tVZFilter from its mempool.
Definition: leaf-filters.c:1266
tTwoPole_tick
float tTwoPole_tick(tTwoPole *const, float input)
Definition: leaf-filters.c:195
tPoleZero_setB0
void tPoleZero_setB0(tPoleZero *const, float b0)
Definition: leaf-filters.c:516
tOneZero_setZero
void tOneZero_setZero(tOneZero *const, float theZero)
Definition: leaf-filters.c:326
tOneZero_getPhaseDelay
float tOneZero_getPhaseDelay(tOneZero *f, float frequency)
Definition: leaf-filters.c:363
tTwoPole_setCoefficients
void tTwoPole_setCoefficients(tTwoPole *const, float b0, float a1, float a2)
Definition: leaf-filters.c:256
tVZFilter_tickEfficient
float tVZFilter_tickEfficient(tVZFilter *const vf, float in)
Definition: leaf-filters.c:1310
tVZFilter_tick
float tVZFilter_tick(tVZFilter *const, float input)
Definition: leaf-filters.c:1279
tButterworth_free
void tButterworth_free(tButterworth *const)
Free a tButterworth from its mempool.
Definition: leaf-filters.c:1067
tPoleZero_free
void tPoleZero_free(tPoleZero *const)
Free a tPoleZero from its mempool.
Definition: leaf-filters.c:509
tBiQuad_initToPool
void tBiQuad_initToPool(tBiQuad *const, tMempool *const)
Initialize a tBiQuad to a specified mempool.
Definition: leaf-filters.c:609
tHighpass_init
void tHighpass_init(tHighpass *const, float freq, LEAF *const leaf)
Initialize a tHighpass to the default mempool of a LEAF instance.
Definition: leaf-filters.c:976
tEfficientSVF_setQ
void tEfficientSVF_setQ(tEfficientSVF *const, float Q)
Definition: leaf-filters.c:964
tOnePole_setPole
void tOnePole_setPole(tOnePole *const, float thePole)
Definition: leaf-filters.c:118
tTwoZero_initToPool
void tTwoZero_initToPool(tTwoZero *const, tMempool *const)
Initialize a tTwoZero to a specified mempool.
Definition: leaf-filters.c:400
tOnePole_tick
float tOnePole_tick(tOnePole *const, float input)
Definition: leaf-filters.c:155
tAllpass_free
void tAllpass_free(tAllpass *const)
Free a tAllpass from its mempool.
Definition: leaf-filters.c:42
tHighpass_getFreq
float tHighpass_getFreq(tHighpass *const)
Definition: leaf-filters.c:1013
tPoleZero_setBlockZero
void tPoleZero_setBlockZero(tPoleZero *const, float thePole)
Definition: leaf-filters.c:569
tVZFilter_init
void tVZFilter_init(tVZFilter *const, VZFilterType type, float freq, float Q, LEAF *const leaf)
Initialize a tVZFilter to the default mempool of a LEAF instance.
Definition: leaf-filters.c:1240
tTwoZero_setCoefficients
void tTwoZero_setCoefficients(tTwoZero *const, float b0, float b1, float b2)
Definition: leaf-filters.c:468
tVZFilter_setFreq
void tVZFilter_setFreq(tVZFilter *const, float freq)
Definition: leaf-filters.c:1466
tAllpass_init
void tAllpass_init(tAllpass *const, float initDelay, uint32_t maxDelay, LEAF *const leaf)
Initialize a tAllpass to the default mempool of a LEAF instance.
Definition: leaf-filters.c:24
tEfficientSVF_tick
float tEfficientSVF_tick(tEfficientSVF *const, float v0)
Definition: leaf-filters.c:934
tBiQuad_init
void tBiQuad_init(tBiQuad *const, LEAF *const leaf)
Initialize a tBiQuad to the default mempool of a LEAF instance.
Definition: leaf-filters.c:604
tTwoPole_initToPool
void tTwoPole_initToPool(tTwoPole *const, tMempool *const)
Initialize a tTwoPole to a specified mempool.
Definition: leaf-filters.c:174
tPoleZero_setB1
void tPoleZero_setB1(tPoleZero *const, float b1)
Definition: leaf-filters.c:522
tVZFilter_setType
void tVZFilter_setType(tVZFilter *const, VZFilterType type)
Definition: leaf-filters.c:1513
tVZFilter_setSampleRate
void tVZFilter_setSampleRate(tVZFilter *const, float sampleRate)
Definition: leaf-filters.c:1272
tDiodeFilter_setFreq
void tDiodeFilter_setFreq(tDiodeFilter *const vf, float cutoff)
Definition: leaf-filters.c:1673
tMedianFilter_free
void tMedianFilter_free(tMedianFilter *const)
Free a tMedianFilter from its mempool.
Definition: leaf-filters.c:1190
tSVF_setFreq
void tSVF_setFreq(tSVF *const, float freq)
Definition: leaf-filters.c:866
tFIR_free
void tFIR_free(tFIR *const)
Free a tFIR from its mempool.
Definition: leaf-filters.c:1141
tTwoPole_setGain
void tTwoPole_setGain(tTwoPole *const, float gain)
Definition: leaf-filters.c:264
LEAF
Struct for an instance of LEAF.
Definition: leaf-global.h:31
tHighpass_free
void tHighpass_free(tHighpass *const)
Free a tHighpass from its mempool.
Definition: leaf-filters.c:996
tButterworth_setFreqs
void tButterworth_setFreqs(tButterworth *const, float f1, float f2)
Definition: leaf-filters.c:1110
tTwoPole_free
void tTwoPole_free(tTwoPole *const)
Free a tTwoPole from its mempool.
Definition: leaf-filters.c:188
tAllpass_setDelay
void tAllpass_setDelay(tAllpass *const, float delay)
Definition: leaf-filters.c:50
tButterworth_tick
float tButterworth_tick(tButterworth *const, float input)
Definition: leaf-filters.c:1078
tOneZero_setCoefficients
void tOneZero_setCoefficients(tOneZero *const, float b0, float b1)
Definition: leaf-filters.c:350
tTwoPole_setB0
void tTwoPole_setB0(tTwoPole *const, float b0)
Definition: leaf-filters.c:208
tEfficientSVF_setFreq
void tEfficientSVF_setFreq(tEfficientSVF *const, uint16_t controlFreq)
Definition: leaf-filters.c:954
tAllpass_setGain
void tAllpass_setGain(tAllpass *const, float gain)
Definition: leaf-filters.c:57
tPoleZero_tick
float tPoleZero_tick(tPoleZero *const, float input)
Definition: leaf-filters.c:590
tVZFilter_BandwidthToR
float tVZFilter_BandwidthToR(tVZFilter *const vf, float B)
Definition: leaf-filters.c:1520
tTwoZero_setB0
void tTwoZero_setB0(tTwoZero *const, float b0)
Definition: leaf-filters.c:456