Jamoma API  0.6.0.a19
TTTrajectory.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup dspTrajectoryLib
4  *
5  * @brief A generalized Trajectory generator wrapper object for Jamoma DSP
6  *
7  * @details This file wraps TrajectoyLib for Max.
8  *
9  * @authors Nils Peters, Tim Place
10  *
11  * @copyright Copyright © 2009 by Nils Peters @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 #include "TTTrajectory.h"
17 
18 #define thisTTClass TTTrajectory
19 #define thisTTClassName "trajectory"
20 #define thisTTClassTags "trajectory"
21 
22 
23 TT_AUDIO_CONSTRUCTOR,
24  mActualTrajectoryObject(NULL),
25  mPhasor("phasor"),
26  mPhasorOutputSignal(1),
27  mRamp("ramp"),
28  mRampOutputSignal(1)
29 
30 {
31  extendAttribute(TT("frequency"), mPhasor.instance(), TT("frequency"));
32 
33  mPhasor.set("gain", TTLinearGainToDecibels(2)); // factor 2 in [dB]
34  mRamp.set("mode", "sample");
35 
43  addAttributeWithSetter(Mode, kTypeSymbol); // FIXME: this should be a charactestring
44 
45  setAttributeValue(TT("mode"), TT("phasor"));
46  setAttributeValue(TT("type"), TT("linear.2D"));
47  setAttributeValue(TT("a"), 2.0);
48  setAttributeValue(TT("b"), 0.0);
49  setAttributeValue(TT("c"), 0.0);
50  setAttributeValue(TT("deltaX"), kTTHalfPi);
51  setAttributeValue(TT("deltaY"), 0.0);
52  setAttributeValue(TT("deltaZ"), 0.0);
53 
54  addMessageWithArguments(getTypes);
55  addMessageWithArguments(getCurrentAttributeNames);
56  addMessageWithArguments(getCurrentType);
58  addUpdates(SampleRate);
59  addMessage(reset);
60 
61  //setProcessMethod(processAudio);
62 }
63 
64 
65 // Destructor
66 TTTrajectory::~TTTrajectory()
67 {
68 }
TTFloat64 TTLinearGainToDecibels(const TTFloat64 value)
Convert linear amplitude into deciBels.
Symbol type.
Definition: TTBase.h:282
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
Definition: TTSymbol.h:155
64-bit floating point
Definition: TTBase.h:272
#define addMessageWithArguments(name)
A convenience macro to be used by subclasses for registering messages.
Definition: TTMessage.h:27
A generalized Trajectory generator wrapper object for Jamoma DSP.
TTFOUNDATION_EXPORT const TTFloat64 kTTHalfPi
Pre-calculated value of pi/2.
Definition: TTBase.cpp:28
#define addAttributeWithSetter(name, type)
A convenience macro to be used by subclasses for registering attributes with a custom setter...
Definition: TTAttribute.h:47
#define addMessage(name)
A convenience macro to be used by subclasses for registering messages.
Definition: TTMessage.h:19
#define addUpdates(updateName)
An 'update' is a message sent to a subclass instance from its parent class.
Definition: TTMessage.h:44