Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
comb.cpp
Go to the documentation of this file.
1 // Comb filter implementation
2//
3// Written by Jezar at Dreampoint, June 2000
4// http://www.dreampoint.co.uk
5// This code is public domain
6
7#include "comb.hpp"
8
9comb::comb()
10{
11 filterstore = 0;
12 bufidx = 0;
13}
14
15void comb::setbuffer(float *buf, int size)
16{
17 buffer = buf;
18 bufsize = size;
19}
20
21void comb::mute()
22{
23 for (int i=0; i<bufsize; i++)
24 buffer[i]=0;
25}
26
27void comb::setdamp(float val, int mode)
28{
29 damp1 = val; // original May 2000 damping
30 damp2 = 1-val;
31 if (mode == -1) // STK: https://github.com/thestk/stk/blob/master/src/FreeVerb.cpp
32 damp1 = -damp1;
33 else if (mode == 0) // VLC: https://github.com/videolan/vlc/blob/master/modules/audio_filter/spatializer/comb.hpp#L49
34 damp1 = 0;
35}
36
37float comb::getdamp()
38{
39 return damp1;
40}
41
42void comb::setfeedback(float val)
43{
44 feedback = val;
45}
46
47float comb::getfeedback()
48{
49 return feedback;
50}
51
52// ends
T size(T... args)