17 #ifndef __TT_AUDIO_OBJECT_BASE_H__
18 #define __TT_AUDIO_OBJECT_BASE_H__
53 #define setProcessMethod(methodName) setProcess((TTProcessMethod)& thisTTClass ::methodName )
59 #define setCalculateMethod(methodName) setCalculate((TTCalculateMethod)& thisTTClass ::methodName )
62 #define TT_WRAP_CALCULATE_METHOD(methodName) \
63 TTAudioSignal& in = inputs->getSignal(0); \
64 TTAudioSignal& out = outputs->getSignal(0); \
66 TTSampleValue* inSample; \
67 TTSampleValue* outSample; \
68 TTChannelCount numchannels = TTAudioSignal::getMinChannelCount(in, out); \
69 TTPtrSizedInt channel; \
71 for (channel=0; channel<numchannels; channel++) { \
72 inSample = in.mSampleVectors[channel]; \
73 outSample = out.mSampleVectors[channel]; \
74 vs = in.getVectorSizeAsInt(); \
77 methodName (*inSample, *outSample, channel); \
137 TTErr resetBenchmarking();
165 if (newMaxNumChannels > mMaxNumChannels)
183 if (newSampleRate && newSampleRate != sr)
231 return process(*in, *out);
245 return process(*out);
262 return process(*in1, *in2, *out1, *out2);
278 return process(*in1, *in2, *out);
374 logMessage(
"No Tests have been written for this class -- please supply a test method.\n");
395 return(20.0 * (log10(value)));
408 return(pow(10., (value / 20.)));
440 long candidate, last, i, isPrime;
448 if (candidate % 2 == 0)
454 for (i=3; (i <= last) && isPrime; i+=2) {
455 if ((candidate % i) == 0)
474 value = value * 0.001 * aSampleRate;
476 value = (value / aSampleRate) * 1000.0;
482 #endif // __TT_AUDIO_OBJECT_BASE_H__
TTFloat64 TTDecibelsToLinearGain(TTFloat64 value)
Convert decibels into linear ampliude.
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
TTFloat64 TTLinearGainToDecibels(const TTFloat64 value)
Convert linear amplitude into deciBels.
The Jamoma Object Base Class.
TTCalculateMethod currentCalculateMethod
This function pointer always points to the current calculate routine.
TTFloat64 accumulatedProcessingCalls
The number of times the process method has been called (for benchmarking)
TTObject inputArray
If the process method is passed a signal, rather than an array of signals, we wrap the signal in this...
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
TTChannelCount mMaxNumChannels
This is the maximum number of channels that can be guaranteed to work.
TTErr logMessage(TTImmutableCString fmtstring,...)
Log messages scoped to this object instance.
TTProcessMethod processMethod
This function pointer points to the active (non-bypass) processing routine.
Create and use Jamoma object instances.
TTFloat64 startProcessingTime
The time at which this object's process method was last invoked (for benchmarking) ...
Base class for all first-class Jamoma objects.
TTProcessMethod currentProcessMethod
This function pointer always points to the current processing routine.
TTBoolean attrBypass
Are we bypassing the processMethod?
TTFloat64 accumulatedProcessingTime
The amount of time spent in this object's process method (for benchmarking)
TTErr setAttributeValue(const TTSymbol name, TTValue &value)
Set an attribute value for an object.
TTFloat64 TTDeviate(TTFloat64 value, TTFloat64 aSampleRate=1.0)
An idiosyncratic utility for slightly randomizing a number.
double TTFloat64
64 bit floating point number
TTObject outputArray
If the process method is passed a signal, rather than an array of signals, we wrap the signal in this...
TTFloat64 TTLinearGainToMidi(TTFloat64 value)
Convert linear amplitude into midi.
void * TTPtr
A generic pointer.
TTFOUNDATION_EXPORT const TTFloat64 kTTGainMidiPowerInv
Invverse power constant used when calculating MID gain.
TTAudioObjectBase * TTAudioObjectBasePtr
Pointer to a TTAudioObjectBase.
TTBoolean attrMute
Mute the processMethod.
TTCalculateMethod calculateMethod
This function pointer points to the active (non-bypass) calculate routine.
TTErr(TTAudioObjectBase::* TTProcessMethod)(TTAudioSignalArrayPtr in, TTAudioSignalArrayPtr out)
A type that can be used to store a pointer to a process method (which calculates a vector of samples)...
float TTFloat32
32 bit floating point number
TTErr adaptMaxNumChannels(const TTChannelCount newMaxNumChannels)
Increase the maxNumChannels attribute, if neccessary.
Container for an array of TTAudioSignal pointers.
TTErr(TTAudioObjectBase::* TTCalculateMethod)(const TTFloat64 &x, TTFloat64 &y, TTPtr data)
A type that can be used to store a pointer to a calculate method (which calculates a single sample)...
The TTAudioSignal class represents N vectors of audio samples for M channels.
TTBoolean unused
Old var that is not used anymore, but we want to keep the struct size the same.
Represents M channels containing N vectors of audio samples.
TTUInt32 TTPrime(TTUInt32 value)
Generate the next prime number higher than the value passed in.
TTUInt16 TTChannelCount
Data type used when counting the number of channels in multi-channel audio signals and processes...
TTFloat64 TTMidiToLinearGain(TTFloat64 value)
Convert midi into linear amplitude.
A simple container for an array of TTAudioSignal pointers.
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
TTFloat64 srMill
1/1000 of the current sample rate (samples per millisecond)
TTFloat64 srInv
1.0 over the current sample rate (inverse)
virtual TTErr test(TTValue &)
Default (empty) template for unit tests.
TTFOUNDATION_EXPORT const TTFloat64 kTTGainMidiPower
Power constant used when calculating MID gain.
TTErr setSampleRate(const TTUInt32 &newSampleRate)
Convenience method for updating the sample-rate.
Provides a common way of representing composite values.
[doxygenAppendixC_copyExample]
Wrap TTAudioSignal instances for convenience.
TTUInt32 sr
Current sample rate being used by this object.