Sound Design Toolkit  075
Physically informed sound synthesis for everyday sounds
SDTFilters.h
Go to the documentation of this file.
1 
8 #ifndef SDT_FILTERS_H
9 #define SDT_FILTERS_H
10 
16 typedef struct SDTOnePole SDTOnePole;
17 
20 extern SDTOnePole *SDTOnePole_new();
21 
24 extern void SDTOnePole_free(SDTOnePole *x);
25 
28 extern void SDTOnePole_setFeedback(SDTOnePole *x, double f);
29 
32 extern void SDTOnePole_lowpass(SDTOnePole *x, double f);
33 
36 extern void SDTOnePole_highpass(SDTOnePole *x, double f);
37 
42 extern double SDTOnePole_dsp(SDTOnePole *x, double in);
43 
51 typedef struct SDTAllPass SDTAllPass;
52 
55 extern SDTAllPass *SDTAllPass_new();
56 
59 extern void SDTAllPass_free(SDTAllPass *x);
60 
63 extern void SDTAllPass_setFeedback(SDTAllPass *x, double f);
64 
69 extern double SDTAllPass_dsp(SDTAllPass *x, double in);
70 
78 typedef struct SDTEnvelope SDTEnvelope;
79 
83 
86 extern void SDTEnvelope_free(SDTEnvelope *x);
87 
90 extern void SDTEnvelope_setAttack(SDTEnvelope *x, double a);
91 
94 extern void SDTEnvelope_setRelease(SDTEnvelope *x, double r);
95 
100 extern double SDTEnvelope_dsp(SDTEnvelope *x, double in);
101 
109 typedef struct SDTTwoPoles SDTTwoPoles;
110 
113 extern SDTTwoPoles *SDTTwoPoles_new();
114 
117 extern void SDTTwoPoles_free(SDTTwoPoles *x);
118 
121 extern void SDTTwoPoles_lowpass(SDTTwoPoles *x, double fc);
122 
125 extern void SDTTwoPoles_highpass(SDTTwoPoles *x, double fc);
126 
130 extern void SDTTwoPoles_resonant(SDTTwoPoles *x, double fc, double q);
131 
136 extern double SDTTwoPoles_dsp(SDTTwoPoles *x, double in);
137 
145 typedef struct SDTAverage SDTAverage;
146 
150 extern SDTAverage *SDTAverage_new(long size);
151 
154 extern void SDTAverage_free(SDTAverage *x);
155 
158 extern void SDTAverage_setWindow(SDTAverage *x, unsigned int i);
159 
164 extern double SDTAverage_dsp(SDTAverage *x, double in);
165 
173 typedef struct SDTDelay SDTDelay;
174 
178 extern SDTDelay *SDTDelay_new(long maxDelay);
179 
182 extern void SDTDelay_free(SDTDelay *x);
183 
185 extern void SDTDelay_clear(SDTDelay *x);
186 
191 extern void SDTDelay_setDelay(SDTDelay *x, double f);
192 
197 extern double SDTDelay_dsp(SDTDelay *x, double in);
198 
209 typedef struct SDTComb SDTComb;
210 
215 extern SDTComb *SDTComb_new(long maxXDelay, long maxYDelay);
216 
219 extern void SDTComb_free(SDTComb *x);
220 
223 extern void SDTComb_setXDelay(SDTComb *x, double f);
224 
227 extern void SDTComb_setYDelay(SDTComb *x, double f);
228 
231 extern void SDTComb_setXYDelay(SDTComb *x, double f);
232 
235 extern void SDTComb_setXGain(SDTComb *x, double f);
236 
239 extern void SDTComb_setYGain(SDTComb *x, double f);
240 
243 extern void SDTComb_setXYGain(SDTComb *x, double f);
244 
249 extern double SDTComb_dsp(SDTComb *x, double in);
250 
260 typedef struct SDTWaveguide SDTWaveguide;
261 
265 extern SDTWaveguide *SDTWaveguide_new(int maxDelay);
266 
269 extern void SDTWaveguide_free(SDTWaveguide *x);
270 
273 extern double SDTWaveguide_getFwdOut(SDTWaveguide *x);
274 
277 extern double SDTWaveguide_getRevOut(SDTWaveguide *x);
278 
281 extern void SDTWaveguide_setDelay(SDTWaveguide *x, double f);
282 
289 extern void SDTWaveguide_setFwdFeedback(SDTWaveguide *x, double f);
290 
297 extern void SDTWaveguide_setRevFeedback(SDTWaveguide *x, double f);
298 
301 extern void SDTWaveguide_setFwdDamping(SDTWaveguide *x, double f);
302 
305 extern void SDTWaveguide_setRevDamping(SDTWaveguide *x, double f);
306 
313 extern void SDTWaveguide_dsp(SDTWaveguide *x, double fwdIn, double revIn);
314 
317 #endif
318 
void SDTWaveguide_free(SDTWaveguide *x)
Object destructor.
void SDTComb_free(SDTComb *x)
Object destructor.
void SDTEnvelope_free(SDTEnvelope *x)
Object destructor.
SDTTwoPoles * SDTTwoPoles_new()
Object constructor.
void SDTWaveguide_setRevDamping(SDTWaveguide *x, double f)
Sets the frequency damping on the left side.
struct SDTAverage SDTAverage
Opaque data structure for a moving average filter object.
Definition: SDTFilters.h:145
void SDTTwoPoles_free(SDTTwoPoles *x)
Object destructor.
void SDTWaveguide_setDelay(SDTWaveguide *x, double f)
Sets the length of the waveguide, in samples.
double SDTWaveguide_getRevOut(SDTWaveguide *x)
Reads the output signal coming from the left side of the waveguide.
SDTDelay * SDTDelay_new(long maxDelay)
Object constructor.
SDTAverage * SDTAverage_new(long size)
Object constructor.
void SDTWaveguide_setFwdDamping(SDTWaveguide *x, double f)
Sets the frequency damping on the right side.
void SDTAllPass_setFeedback(SDTAllPass *x, double f)
Sets the feedback coefficient.
void SDTComb_setXDelay(SDTComb *x, double f)
Sets the delay time for the feed forward section.
void SDTWaveguide_setFwdFeedback(SDTWaveguide *x, double f)
Sets the feedback on the right side. Determines how much energy gets fed back into the system after t...
void SDTComb_setXYGain(SDTComb *x, double f)
Sets the gain for both sections.
struct SDTComb SDTComb
Opaque data structure representing a comb filter object.
Definition: SDTFilters.h:209
void SDTWaveguide_setRevFeedback(SDTWaveguide *x, double f)
Sets the feedback on the left side. Determines how much energy gets fed back into the system after th...
struct SDTEnvelope SDTEnvelope
Opaque data structure for an envelope tracker object.
Definition: SDTFilters.h:78
double SDTEnvelope_dsp(SDTEnvelope *x, double in)
Signal processing routine. Call this function at sample rate to compute the filtered signal...
SDTEnvelope * SDTEnvelope_new()
Object constructor.
void SDTOnePole_lowpass(SDTOnePole *x, double f)
Puts the filter in lowpass mode, at the given cutoff frequency.
double SDTAverage_dsp(SDTAverage *x, double in)
Signal processing routine. Call this function at sample rate to compute the filtered signal...
void SDTTwoPoles_lowpass(SDTTwoPoles *x, double fc)
Puts the filter in lowpass mode, at the given cutoff frequency.
double SDTWaveguide_getFwdOut(SDTWaveguide *x)
Reads the output signal coming from the right side of the waveguide.
void SDTAverage_setWindow(SDTAverage *x, unsigned int i)
Sets the averaging window.
double SDTAllPass_dsp(SDTAllPass *x, double in)
Signal processing routine. Call this function at sample rate to compute the filtered signal...
struct SDTTwoPoles SDTTwoPoles
Opaque data structure for a two poles filter object.
Definition: SDTFilters.h:109
void SDTAverage_free(SDTAverage *x)
Object destructor.
void SDTDelay_setDelay(SDTDelay *x, double f)
Sets the delay time. Fractional values are allowed. The delay time can be continuously changed over t...
void SDTDelay_clear(SDTDelay *x)
Clears the buffer, therefore silencing the delayed signal.
struct SDTWaveguide SDTWaveguide
Opaque data structure representing a digital waveguide object.
Definition: SDTFilters.h:260
SDTComb * SDTComb_new(long maxXDelay, long maxYDelay)
Object constructor.
void SDTEnvelope_setAttack(SDTEnvelope *x, double a)
Sets the attack time.
struct SDTDelay SDTDelay
Opaque data structure for a delay line object.
Definition: SDTFilters.h:173
void SDTComb_setYDelay(SDTComb *x, double f)
Sets the delay time for the feedback section.
void SDTDelay_free(SDTDelay *x)
Object destructor.
void SDTOnePole_setFeedback(SDTOnePole *x, double f)
Manually sets the alpha coefficient.
double SDTOnePole_dsp(SDTOnePole *x, double in)
Signal processing routine. Call this function at sample rate to compute the filtered signal...
struct SDTAllPass SDTAllPass
Opaque data structure for an allpass filter object.
Definition: SDTFilters.h:51
double SDTTwoPoles_dsp(SDTTwoPoles *x, double in)
Signal processing routine. Call this function at sample rate to compute the filtered signal...
SDTAllPass * SDTAllPass_new()
Object constructor.
void SDTComb_setXGain(SDTComb *x, double f)
Sets the gain for the feed forward section.
void SDTEnvelope_setRelease(SDTEnvelope *x, double r)
Sets the release time.
void SDTOnePole_highpass(SDTOnePole *x, double f)
Puts the filter in highpass mode, at the given cutoff frequency.
void SDTTwoPoles_resonant(SDTTwoPoles *x, double fc, double q)
Puts the filter in resonant bandpass mode, at the given center frequency and Q.
SDTOnePole * SDTOnePole_new()
Object constructor.
double SDTComb_dsp(SDTComb *x, double in)
Signal processing routine. Call this function at sample rate to output the filtered signal...
void SDTTwoPoles_highpass(SDTTwoPoles *x, double fc)
Puts the filter in highpass mode, at the given cutoff frequency.
void SDTAllPass_free(SDTAllPass *x)
Object destructor.
struct SDTOnePole SDTOnePole
Opaque data structure for a one pole filter object.
Definition: SDTFilters.h:16
double SDTDelay_dsp(SDTDelay *x, double in)
Signal processing routine. Call this function at sample rate to output the delayed signal...
void SDTComb_setYGain(SDTComb *x, double f)
Sets the gain for the feedback section.
SDTWaveguide * SDTWaveguide_new(int maxDelay)
Object constructor.
void SDTOnePole_free(SDTOnePole *x)
Object destructor.
void SDTComb_setXYDelay(SDTComb *x, double f)
Sets the delay time for both sections.
void SDTWaveguide_dsp(SDTWaveguide *x, double fwdIn, double revIn)
Signal processing routine. Call this function at sample rate to compute the output samples...