21 #define thisTTClass TTBandrejectButterworth2
22 #define thisTTClassName "bandreject.butterworth.2"
23 #define thisTTClassTags "dspFilterLib, audio, processor, filter, notch, butterworth"
43 setAttributeValue(kTTSym_maxNumChannels, arguments);
44 setAttributeValue(
TT(
"frequency"), 1000.0);
45 setAttributeValue(
TT(
"q"), 50.0);
52 TTBandrejectButterworth2::~TTBandrejectButterworth2()
76 TTErr TTBandrejectButterworth2::clear()
89 calculateCoefficients();
94 TTErr TTBandrejectButterworth2::setQ(
const TTValue& newValue)
97 calculateCoefficients();
102 void TTBandrejectButterworth2::calculateCoefficients()
111 mA0 = 1.0 / (1.0 + mC);
112 mA1 = -2.0 * mA0 * mD;
115 mB2 = mA0 * (1.0 - mC);
122 y = mA0*(x +
mX2[channel]) + mA1*(
mX1[channel] -
mY1[channel]) -
mB2*
mY2[channel];
124 mX2[channel] =
mX1[channel];
126 mY2[channel] =
mY1[channel];
TTBandrejectButterworth2 is a second-order Butterworth bandpass filter.
TTChannelCount mMaxNumChannels
This is the maximum number of channels that can be guaranteed to work.
TTErr updateMaxNumChannels(const TTValue &oldMaxNumChannels, TTValue &)
Receives notifications when there are changes to the inherited mMaxNumChannels attribute.
TTFOUNDATION_EXPORT const TTFloat64 kTTTwoPi
Pre-calculated value of pi * 2.
#define setProcessMethod(methodName)
A convenience macro to be used by subclasses for setting the process method.
TTSampleVector mY2
Output sample n-2.
double TTFloat64
64 bit floating point number
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
TTErr calculateValue(const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt channel)
Standard single value calculate method as used by DSP objects.
#define setCalculateMethod(methodName)
A convenience macro to be used by subclasses for setting the calculate method.
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Standard audio processing method as used by TTBlue objects.
TTFloat64 mFrequency
filter cutoff frequency
#define addAttributeProperty(attributeName, propertyName, initialValue)
A convenience macro to be used for registering properties of attributes.
TTFloat64 mB2
filter coefficients.
TTFloat64 mQ
filter resonance
TTSampleVector mX1
Input sample n-1.
A simple container for an array of TTAudioSignal pointers.
TTSampleVector mX2
Input sample n-2.
long TTPtrSizedInt
An integer that is the same size as a pointer.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
#define addAttributeWithSetter(name, type)
A convenience macro to be used by subclasses for registering attributes with a custom setter...
#define addMessage(name)
A convenience macro to be used by subclasses for registering messages.
TTErr setFrequency(const TTValue &value)
Setter for the frequency attribute.
TTFOUNDATION_EXPORT const TTFloat64 kTTPi
[doxygenAppendixC_constExample]
TTSampleVector mY1
Output sample n-1.
[doxygenAppendixC_copyExample]
#define addUpdates(updateName)
An 'update' is a message sent to a subclass instance from its parent class.
TTUInt32 sr
Current sample rate being used by this object.