59 |
* @param ExtControlValue - new external controller value |
* @param ExtControlValue - new external controller value |
60 |
*/ |
*/ |
61 |
inline void update(const uint16_t& ExtControlValue) { |
inline void update(const uint16_t& ExtControlValue) { |
62 |
const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF... |
//const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF... |
63 |
const float max = this->InternalDepth + ExtControlValue * this->ExtControlDepthCoeff; |
const float max = this->InternalDepth + ExtControlValue * this->ExtControlDepthCoeff; |
64 |
if (RANGE == range_unsigned) { |
if (RANGE == range_unsigned) { |
65 |
normalizer = max / 2.0f; |
normalizer = max / 2.0f; |
92 |
|
|
93 |
uiLevel = 0; |
uiLevel = 0; |
94 |
} |
} |
95 |
|
|
96 |
|
/** |
97 |
|
* @param phase 0 to 360 degrees |
98 |
|
*/ |
99 |
|
void setPhase(float phase) { |
100 |
|
if (phase < 0) phase = 0; |
101 |
|
if (phase > 360) phase = 360; |
102 |
|
phase /= 360.0f; |
103 |
|
const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF... |
104 |
|
uiLevel = intLimit * phase; |
105 |
|
} |
106 |
|
|
107 |
|
void setFrequency(float Frequency, unsigned int SampleRate) { |
108 |
|
const unsigned int intLimit = (unsigned int) -1; // all 0xFFFF... |
109 |
|
float r = Frequency / (float) SampleRate; // frequency alteration quotient |
110 |
|
c = (int) (intLimit * r); |
111 |
|
} |
112 |
|
|
113 |
protected: |
protected: |
114 |
unsigned int uiLevel; |
unsigned int uiLevel; |