Jamoma API  0.6.0.a19
TTBounceEaseOutFunction.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspFunctionLib
4  *
5  * @brief #TTBounceEaseOutFunction Unit for Jamoms DSP
6  *
7  * @details @n
8  * @n
9  * Derived from Sam Hocevar's public domain C/C++ implementation of
10  * Robert Penner easing functions
11  *
12  * @authors Trond Lossius
13  *
14  * @copyright Copyright © 2014 by Trond Lossius @n
15  * This code is licensed under the terms of the "New BSD License" @n
16  * http://creativecommons.org/licenses/BSD/
17  */
18 
19 
21 
22 #define thisTTClass TTBounceEaseOutFunction
23 #define thisTTClassName "easeOutBounce"
24 #define thisTTClassTags "dspFunctionLib, audio, processor, function"
25 
26 
27 TT_AUDIO_CONSTRUCTOR
28 {
29  setProcessMethod(processAudio);
30  setCalculateMethod(calculateValue);
31 }
32 
33 
34 TTBounceEaseOutFunction::~TTBounceEaseOutFunction()
35 {
36  ;
37 }
38 
39 
41 {
42  if (x < 4/11.0)
43  {
44  y = (121 * x * x)/16.0;
45  }
46  else if (x < 8/11.0)
47  {
48  y = (363/40.0 * x * x) - (99/10.0 * x) + 17/5.0;
49  }
50  else if (x < 9/10.0)
51  {
52  y = (4356/361.0 * x * x) - (35442/1805.0 * x) + 16061/1805.0;
53  }
54  else
55  {
56  y = (54/5.0 * x * x) - (513/25.0 * x) + 268/25.0;
57  }
58  return kTTErrNone;
59 }
60 
61 
63 {
64  TT_WRAP_CALCULATE_METHOD(calculateValue);
65 }
66 
#define setProcessMethod(methodName)
A convenience macro to be used by subclasses for setting the process method.
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
#define setCalculateMethod(methodName)
A convenience macro to be used by subclasses for setting the calculate method.
TTErr calculateValue(const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt data)
y = f(x) for a single value
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
A standard audio processing method as used by TTBlue objects.
A simple container for an array of TTAudioSignal pointers.
long TTPtrSizedInt
An integer that is the same size as a pointer.
Definition: TTBase.h:240
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
No Error.
Definition: TTBase.h:343
TTBounceEaseOutFunction Unit for Jamoms DSP