Jamoma API  0.6.0.a19
TTFreeHandFunction.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspFunctionLib
4  *
5  * @brief #TTFreeHandFunction Unit for Jamoms DSP
6  *
7  * @details A piecewise function unit that allows to load a function unit per defined domain. @n
8  * The default configuration is a linear function for X[0::1], Y[0::1] domain. @n
9  * Setup the curveList attribute to change the configuration. @n
10  * For example setting curveList to the < 0.3 0.6 exponential base 0.5 1. 1. logarithm base 0.8 > value @n
11  * you will imply the following behavior :
12  * - if x belongs to [0::0.3] domain, it will use the exponential function and the result will belong to [0.::0.6] domain.
13  * - if x belongs to ]0.3::1.] domain, it will use the logarithm function and the result will belong to ]0.6::1.] domain.
14  *
15  * @authors Théo de la Hogue, Trond Lossius
16  *
17  * @copyright Copyright © 2013 by Théo de la Hogue @n
20  */
21
22
23 #ifndef __FREEHANDFUNCTION_H__
24 #define __FREEHANDFUNCTION_H__
25
26 #include "TTDSP.h"
27
28
29 /** A piecewise function unit that allows to load a function unit per defined domain
30  */
33
34 private:
35  TTBoolean locked; // true if the function is changing
36
37 protected:
38
39  TTList mPoints; // all points coordinate (X [0::1], Y [min::max])
40  TTList mFunctions; // all functions for each section (nb sections = nb points - 1)
41
42
43  /** Get all points and functions as a list of < x y function parameterName parameterValue > */
44  TTErr getCurveList(TTValue& value);
45
46  /** Set all points and functions using a list of < x y function parameterName parameterValue > */
47  TTErr setCurveList(const TTValue& value);
48
49  /** Clear all functions */
50  TTErr Clear();
51
52  /** y = f(x) for a single value */
53  inline TTErr calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt data);
54
55  /** A standard audio processing method as used by Jamoma DSP objects.*/
57
58  /** Unit Tests */
59  virtual TTErr test(TTValue& returnedTestInfo);
60
61 };
62
63
64 #endif // __FREEHANDFUNCTION_H__
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
A piecewise function unit that allows to load a function unit per defined domain. ...
TTErr Clear()
Clear all functions.
TTAudioObjectBase is the base class for all audio generating and processing objects in Jamoma DSP...
Jamoma DSP Library.
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
TTErr calculateValue(const TTFloat64 &x, TTFloat64 &y, TTPtrSizedInt data)
y = f(x) for a single value
TTErr setCurveList(const TTValue &value)
Set all points and functions using a list of < x y function parameterName parameterValue > ...
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 getCurveList(TTValue &value)
Get all points and functions as a list of < x y function parameterName parameterValue > ...
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
virtual TTErr test(TTValue &returnedTestInfo)
Unit Tests.
TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
A standard audio processing method as used by Jamoma DSP objects.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34