19 #define thisTTClass TTAllpass1
20 #define thisTTClassName "allpass.1"
21 #define thisTTClassTags "dspFilterLib, audio, processor, filter, allpass"
23 #ifdef TT_PLATFORM_WIN
46 setAttributeValue(kTTSym_maxNumChannels, initialMaxNumChannels);
47 setAttributeValue(
TT(
"linearGain"), 1.0);
48 setAttributeValue(
TT(
"delayMax"), 100.0);
49 setAttributeValue(
TT(
"delay"), 0.0);
54 TTAllpass1::~TTAllpass1()
66 if (newDelayMaxInSamples) {
74 for (TTDelayBufferIter buffer =
mFeedback.begin(); buffer !=
mFeedback.end(); ++buffer) {
84 void TTAllpass1::reset()
88 for (TTDelayBufferIter buffer =
mFeedback.begin(); buffer !=
mFeedback.end(); ++buffer)
111 for_each(
mFeedback.begin(),
mFeedback.end(), std::mem_fun_ref(&TTDelayBuffer::clear));
188 #pragma mark dsp routines
209 y = x1 + ((x - y1) * alpha);
215 *feedbackBuffer->mWritePointer = y;
218 feedforwardBuffer->mReadPointer++;
219 feedforwardBuffer->mWritePointer++;
220 feedbackBuffer->mReadPointer++;
221 feedbackBuffer->mWritePointer++;
224 feedforwardBuffer->wrapForward();
225 feedbackBuffer->wrapForward();
242 for (channel=0; channel<numchannels; channel++) {
245 vs = in.getVectorSizeAsInt();
250 calculateValue(*inSample, *outSample, buffers);
TTFloat64 TTDecibelsToLinearGain(TTFloat64 value)
Convert decibels into linear ampliude.
std::uint16_t TTUInt16
16 bit unsigned integer
TTFloat64 TTLinearGainToDecibels(const TTFloat64 value)
Convert linear amplitude into deciBels.
TTErr setDelay(const TTValue &newValue)
Attribute accessor.
TTDelayBufferVector mFeedback
fb buffers for each channel
TTErr setDelayMaxInSamples(const TTValue &newValue)
Attribute Accessor.
TTFloat64 mDelayMax
Maximum delay time in milliseconds (how long is the buffer?)
TTErr clear()
This algorithm uses an IIR filter, meaning that it relies on feedback.
std::uint64_t TTUInt64
64 bit unsigned integer
TTChannelCount mMaxNumChannels
This is the maximum number of channels that can be guaranteed to work.
TTErr setLinearGain(const TTValue &newValue)
Attribute accessor.
TTSampleValuePtr mWritePointer
"record" pointer for buffer
TTErr setDelayMax(const TTValue &newValue)
Attribute Accessor.
TTUInt32 mDelayMaxInSamples
size of the delay buffers
#define setProcessMethod(methodName)
A convenience macro to be used by subclasses for setting the process method.
TTFloat64 mGain
Attribute: gain in db.
TTDelayBufferVector mFeedforward
ff buffers for each channel
double TTFloat64
64 bit floating point number
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
TTUInt32 mDelayInSamples
Delay time in samples (internal)
TTErr setGain(const TTValue &newValue)
Attribute accessor.
TTSampleValuePtr mReadPointer
"playback" pointer
static TTChannelCount getMinChannelCount(const TTAudioSignal &signal1, const TTAudioSignal &signal2)
Use this class method to determine the least number of channels the two signals have in common...
The TTAudioSignal class represents N vectors of audio samples for M channels.
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...
64-bit signed integer, ragne is −9,223,372,036,854,775,808 through 9,223,372,036,854,775,807
A simple container for an array of TTAudioSignal pointers.
void clear()
Clear all values from the vector, leaving with size of 0.
TTFloat64 mDelay
Attribute: delay time in milliseconds.
TTFloat64 mLinearGain
Attribute: linear gain coefficient.
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...
TTFloat64 srMill
1/1000 of the current sample rate (samples per millisecond)
TTErr setDelayInSamples(const TTValue &newValue)
Attribute Accessor.
#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.
TTFloat64 srInv
1.0 over the current sample rate (inverse)
TTAllpass1 is a first order allpass filter
void resize(size_type n)
Change the number of elements.
TTErr init(TTUInt64 newDelayMaxInSamples)
Internal initialization of buffers and pointers etc.
TTFloat64 TTSampleValue
A value representing a single audio sample.
[doxygenAppendixC_copyExample]
TTDelayBuffer is a container object that holds some audio in a chunk of memory, with accessors for us...
#define addUpdates(updateName)
An 'update' is a message sent to a subclass instance from its parent class.