Jamoma API  0.6.0.a19
TTHighMidLowShelf.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspFilterLib
4  *
5  * @brief #TTHighMidLowShelf is a High-Mid-Low shelf filter
6  *
7  * @details ported by Nils Peters 2009, from the PD external hml_shelf~ by Thomas Musil. WARNING: Possible license violation! Please refrain from using this until this has been sorted out, as we might have to remove this filter unit.
8  *
9  * @authors Thomas Musil, Nils Peters, Trond Lossius
10  *
11  * @copyright NOTE: This might be in violation of the LGPL license of the iemlib as noted in this issue: https://github.com/jamoma/JamomaCore/issues/204. Most likely we have to remove this from the library.
12  * Copyright © 2010, Thomas Musil @n
13  * This code is licensed under the terms of the "New BSD License" @n
14  * http://creativecommons.org/licenses/BSD/
15  */
16 
17 
18 #ifndef _TT_HIMIDLOW_H_
19 #define _TT_HIMIDLOW_H_
20 
21 #include "TTDSP.h"
22 
23 
24 /** High-Mid-Low shelf filter. */
27 
28 protected:
29 
30  TTFloat64 mFrequencyLm, mFrequencyMh, mGainL, mGainM, mGainH;///< filter parameter
31  TTFloat64 mA0, mA1, mA2, mB1, mB2; ///< filter coefficients
32  TTSampleVector mX1;
33  TTSampleVector mX2;
34  TTSampleVector mX0;
35  TTFloat64 mFmid;
36 
37 
38  /** Receives notifications when there are changes to the inherited
39  mMaxNumChannels attribute. This allocates memory for xm1, xm2, ym1, and ym2
40  so that each channel's previous values are remembered. */
41  TTErr updateMaxNumChannels(const TTValue& oldMaxNumChannels, TTValue&);
42 
43  /** Receives notifications when there are changes to the inherited
44  sr attribute. */
45  TTErr updateSampleRate(const TTValue& oldSampleRate, TTValue&);
46  TTErr clear();
47  TTErr calculateCoefficients();
48 
49  /** Standard audio processing method as used by TTBlue objects. */
51 
52  /** y = f(x) */
53  TTErr calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt channel);
54 
55  /** Setter for the filter attribute. */
56  TTErr setGainL(const TTValue& value);
57  TTErr setGainM(const TTValue& value);
58  TTErr setGainH(const TTValue& value);
59  TTErr setFrequencyLm(const TTValue& value);
60  TTErr setFrequencyMh(const TTValue& value);
61 
62 
63  /** Unit Tests
64  @param returnedTestInfo Used to return test information
65  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
66  */
67  virtual TTErr test(TTValue& returnedTestInfo);
68 
69 };
70 
71 #endif // _HIMIDLOW_H_
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Standard audio processing method as used by TTBlue objects.
Jamoma DSP Library.
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
TTErr calculateValue(const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt channel)
y = f(x)
TTErr updateSampleRate(const TTValue &oldSampleRate, TTValue &)
Receives notifications when there are changes to the inherited sr attribute.
std::vector< TTSampleValue > TTSampleVector
A TTSampleVector is simply a pointer to the first of an array of TTSampleValues.
Definition: TTBase.h:233
virtual TTErr test(TTValue &returnedTestInfo)
Unit Tests.
TTErr setGainL(const TTValue &value)
Setter for the filter attribute.
TTFloat64 mB2
filter coefficients
A simple container for an array of TTAudioSignal pointers.
long TTPtrSizedInt
An integer that is the same size as a pointer.
Definition: TTBase.h:240
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
High-Mid-Low shelf filter.
TTErr updateMaxNumChannels(const TTValue &oldMaxNumChannels, TTValue &)
Receives notifications when there are changes to the inherited mMaxNumChannels attribute.
TTFloat64 mGainH
filter parameter
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34