Jamoma API  0.6.0.a19
Filter.cpp
1 // Filter.cpp
2 /***************************************************/
3 /*! \class Filter
4  \brief Filter class
5 
6  A generic biquad filter.
7 
8  Based on:
9  Biquad.h by Gary Scavone and Perry Cook, and
10  hml_shelf~.c by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006
11 
12  by Tristan Matthews and Nils Peters, 2007-2008.
13  */
14 /***************************************************/
15 
16 #include "Filter.h"
17 #include "Properties.h"
18 #include "TTBase.h"
19 
20 extern bool globWarningFlag;
21 extern bool globReportFlag;
22 
23 const double Filter::MAX_ = 1.0;
24 const double Filter::MIN_ = 0.0000001;
25 
27  sr_(kTTPi / Properties::SAMPLERATE)
28 {
29  this->clear(); // initialize buffer to 0's
30 }
31 
33 {
34  out_ = 0.0;
35 
36  for (int i = 0; i < ORDER_PLUS_ONE; i++)
37  in_[i] = 0.0;
38 }
39 
40 double Filter::percentToGain(double gain)
41 {
42  return exp(0.5 * log(1.0 - 0.01 * gain));
43 }
44 
static const double MAX_
Max gain value.
Definition: Filter.h:44
Jamoma's lowest-level base class and related infrastructure.
Filter()
Class constructor.
Definition: Filter.cpp:26
double percentToGain(double gainPercentage)
Convert percentage to linear gain.
Definition: Filter.cpp:40
static const double MIN_
Min gain value.
Definition: Filter.h:46
void clear()
Reinitialize filter's memory.
Definition: Filter.cpp:32
TTFOUNDATION_EXPORT const TTFloat64 kTTPi
[doxygenAppendixC_constExample]
Definition: TTBase.cpp:23