11 #define thisTTClass TTRamp
12 #define thisTTClassName "ramp"
13 #define thisTTClassTags "dspGeneratorLib, audio, generator"
17 , attrMode(
TT(
"vector")), attrCurrentValue(0), attrDestinationValue(0), step(0), direction(0)
20 registerAttribute(
TT(
"startValue"),
kTypeFloat64, &attrCurrentValue);
21 registerAttribute(
TT(
"destinationValue"),
kTypeFloat64, &attrDestinationValue);
27 setAttributeValue(
TT(
"mode"),
TT(
"vector"));
42 attrCurrentValue = attrDestinationValue;
59 attrCurrentValue = attrDestinationValue;
101 step = (attrDestinationValue - attrCurrentValue) /
double(
rampSamples - 1);
113 for (channel=0; channel<numchannels; channel++) {
115 *outSample = attrCurrentValue;
118 attrCurrentValue += (step * out.getVectorSizeAsInt());
119 if (attrCurrentValue <= attrDestinationValue) {
121 attrCurrentValue = attrDestinationValue;
137 for (channel=0; channel<numchannels; channel++) {
139 *outSample = attrCurrentValue;
142 attrCurrentValue += (step * out.getVectorSizeAsInt());
143 if (attrCurrentValue >= attrDestinationValue) {
145 attrCurrentValue = attrDestinationValue;
162 for (channel=0; channel<numchannels; channel++) {
163 vs = out.getVectorSizeAsInt();
166 *outSample++ = attrCurrentValue;
169 attrCurrentValue += step;
170 if (attrCurrentValue <= attrDestinationValue) {
172 attrCurrentValue = attrDestinationValue;
190 for (channel=0; channel<numchannels; channel++) {
191 vs = out.getVectorSizeAsInt();
194 *outSample++ = attrCurrentValue;
197 attrCurrentValue += step;
198 if (attrCurrentValue >= attrDestinationValue) {
200 attrCurrentValue = attrDestinationValue;
TTErr(TTObjectBase::* TTSetterMethod)(const TTAttribute &attribute, const TTValue &value)
A type that can be used to store a pointer to a message for an object.
std::uint16_t TTUInt16
16 bit unsigned integer
TTErr setRampTime(const TTValue &newValue)
Trigger a ramp with a time set in milliseconds.
TTSymbol attrMode
mode: sample_accurate or vector_accurate
TTFOUNDATION_EXPORT const TTFloat64 kTTAntiDenormalValue
Constant used by the ttantidenormal function.
TTErr processVectorAccurateUp(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Process method – This method is special! It only sets the first sample of the vector and does not us...
#define setProcessMethod(methodName)
A convenience macro to be used by subclasses for setting the process method.
TTErr RampTimeInSamples(const TTValue &newValue)
Trigger a ramp with a time set in samples.
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
TTFloat64 attrRampTime
ramp time in milliseconds
TTErr processSampleAccurateDown(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Process method.
float TTFloat32
32 bit floating point number
TTErr Stop()
Stop the current ramp.
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...
A simple container for an array of TTAudioSignal pointers.
void setStep()
Internal method called when the ramp is triggered (by setting the rampTime)
TTErr processVectorAccurateDown(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Process method – This method is special! It only sets the first sample of the vector and does not us...
TTBoolean direction
0 = ramp up, 1 = ramp down
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
TTErr processSampleAccurateUp(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
Process method.
#define addMessage(name)
A convenience macro to be used by subclasses for registering messages.
TTErr setMode(const TTValue &value)
Setter for the mode attribute.
void setupProcess()
Internal method for setting which process method to use.
TTFloat64 TTSampleValue
A value representing a single audio sample.
[doxygenAppendixC_copyExample]
TTUInt32 rampSamples
ramp time in samples
TTUInt32 sr
Current sample rate being used by this object.