17 #ifndef __TT_AUDIO_SIGNAL_H__
18 #define __TT_AUDIO_SIGNAL_H__
20 #include "TTFoundation.h"
85 TTErr setMaxNumChannels(
const TTValue& newMaxNumChannels);
88 void setSampleRate(
const TTUInt32& newSampleRate)
90 mSampleRate = newSampleRate;
123 return mSampleVectors[channel][sampleNumber];
128 return ((
TTFloat32)mSampleVectors[channel][sampleNumber]);
142 mVectorSize = newVectorSize;
149 mVectorSize = newVectorSize;
161 allocWithVectorSize(newVectorSize);
163 mVectorSize = newVectorSize;
170 mNumChannels = TTClip<TTChannelCount>(newNumChannels, 0, mMaxNumChannels);
176 mNumChannels = TTClip<TTChannelCount>(newNumChannels, 0, mMaxNumChannels);
191 return mIsLocallyOwned;
227 for (
TTUInt32 channel=0; channel<mNumChannels; channel++)
228 memset(mSampleVectors[channel], 0,
sizeof(
TTSampleValue) * mVectorSize);
245 for (
int n=0; n<mVectorSize; n++)
246 mSampleVectors[channel][n] = aFillValue;
279 if (signal1.mNumChannels > signal2.mNumChannels)
280 return signal2.mNumChannels;
282 return signal1.mNumChannels;
299 if (signal2.mNumChannels < numChannels)
300 numChannels = signal2.mNumChannels;
301 if (signal3.mNumChannels < numChannels)
302 numChannels = signal3.mNumChannels;
325 short channelCount = getMaxChannelCount(*
this, rightHandValue);
328 if (channelCount > mMaxNumChannels)
329 allocWithNewChannelCount(channelCount);
331 mNumChannels = channelCount;
332 if (channelCount > rightHandValue.mMaxNumChannels)
333 channelCount = rightHandValue.mMaxNumChannels;
335 for (channel=0; channel<channelCount; channel++) {
337 outSample = mSampleVectors[channel];
339 if (mVectorSize > rightHandValue.mVectorSize)
340 vs = rightHandValue.mVectorSize;
345 (*outSample) = (*outSample) + (*inSample);
357 if (rightHandValue.mMaxNumChannels > mMaxNumChannels)
358 setMaxNumChannels(rightHandValue.mMaxNumChannels);
359 mNumChannels = rightHandValue.mNumChannels;
360 mSampleRate = rightHandValue.mSampleRate;
362 setVectorSizeWithInt(rightHandValue.mVectorSize);
376 #endif // __TT_AUDIO_SIGNAL_H__
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
std::uint16_t TTUInt16
16 bit unsigned integer
The Jamoma Object Base Class.
TTDataObjectBase is the base class for all data generating and processing objects.
double TTFloat64
64 bit floating point number
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
TTDSP_EXPORT const TTChannelCount kTTMaxChannelsPossible
The maximum number of audio channels that Jamoma DSP (and AudioGraph) is able to deal with...
TTErr clear()
Zero out all of the sample values in the audio signal.
float TTFloat32
32 bit floating point number
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...
Something went wrong, but what exactly is not known. Typically used for context-specific problems...
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
std::uint32_t TTUInt32
32 bit unsigned integer
static TTErr copy(const TTAudioSignal &source, TTAudioSignal &dest, TTChannelCount channelOffset=0)
Copy the audio from one signal into another.
static TTChannelCount getMinChannelCount(const TTAudioSignal &signal1, const TTAudioSignal &signal2, const TTAudioSignal &signal3)
Use this class method to determine the least number of channels the specified signals have in common...
Provides a common way of representing composite values.
TTFloat64 TTSampleValue
A value representing a single audio sample.
[doxygenAppendixC_copyExample]
unsigned char TTUInt8
8 bit unsigned integer (char)