22 #define thisTTClass TTBalance
23 #define thisTTClassName "balance"
24 #define thisTTClassTags "dspEffectsLib, audio, processor, dynamics"
42 setAttributeValue(kTTSym_maxNumChannels, initialMaxNumChannels);
43 setAttributeValue(
TT(
"frequency"), 10.0);
48 TTBalance::~TTBalance()
96 b1 = 2*a0*( 1 - c*c );
125 for (channel=0; channel<numChannels; channel++) {
130 vs = in.getVectorSizeAsInt();
134 tempxA = *inSampleA++;
135 absTempxA = fabs(tempxA);
136 tempxB = *inSampleB++;
137 absTempxB = fabs(tempxB);
139 tempyA = a0*absTempxA + a1*xm1A[channel] + a2*xm2A[channel] - b1*ym1A[channel] -
b2*
ym2A[channel];
140 TTZeroDenormal(tempyA);
141 tempyB = a0*absTempxB + a1*xm1B[channel] + a2*xm2B[channel] - b1*ym1B[channel] -
b2*
ym2B[channel];
142 TTZeroDenormal(tempyB);
145 *outSample++ = tempxA * (tempyB/tempyA);
149 xm2A[channel] = xm1A[channel];
150 xm1A[channel] = absTempxA;
151 ym2A[channel] = ym1A[channel];
152 ym1A[channel] = tempyA;
153 xm2B[channel] = xm1B[channel];
154 xm1B[channel] = absTempxB;
155 ym2B[channel] = ym1B[channel];
156 ym1B[channel] = tempyB;
TTErr clear()
This algorithm depends on the use of an IIR filter, meaning that it relies on feedback.
std::uint16_t TTUInt16
16 bit unsigned integer
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Standard audio processing method as used by TTBlue objects.
TTChannelCount mMaxNumChannels
This is the maximum number of channels that can be guaranteed to work.
#define setProcessMethod(methodName)
A convenience macro to be used by subclasses for setting the process method.
double TTFloat64
64 bit floating point number
static TTChannelCount getNumChannels(const TTAudioSignal &signal)
Use this class method to determine the number of channels of an input or output signal.
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
TTErr updateMaxNumChannels(const TTValue &oldMaxNumChannels, TTValue &)
Receives notifications when there are changes to the inherited maxNumChannels attribute.
TTErr setFrequency(const TTValue &value)
Setter for the frequency attribute.
TTSampleVector ym2B
previous input and output values of signal to be compared with
TTSampleVector ym2A
previous input and output values of signal to be balanced
The TTAudioSignal class represents N vectors of audio samples for M channels.
TTFOUNDATION_EXPORT const TTFloat64 kTTSqrt2
Pre-calculated square-root of 2 (1.4142).
TTSampleValue ** mSampleVectors
An array of pointers to the first sample in each vector. Declared Public for fast access...
TTUInt16 TTChannelCount
Data type used when counting the number of channels in multi-channel audio signals and processes...
A simple container for an array of TTAudioSignal pointers.
TTBalance balance the gain level according to a side band signal.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
TTErr updateSampleRate(const TTValue &oldSampleRate, TTValue &)
Receives notifications when there are changes to the inherited sr attribute.
#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.
TTFOUNDATION_EXPORT const TTFloat64 kTTPi
[doxygenAppendixC_constExample]
TTFloat64 TTSampleValue
A value representing a single audio sample.
[doxygenAppendixC_copyExample]
TTFloat64 mFrequency
filter cutoff frequency of inherent lowpass filter
TTFloat64 b2
filter coefficients
#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.