85 |
* @param Propagation - defines from which level the wave starts and which direction it grows with growing oscillator depth |
* @param Propagation - defines from which level the wave starts and which direction it grows with growing oscillator depth |
86 |
* @param pEventPool - reference to an event pool which will be used to allocate Event objects |
* @param pEventPool - reference to an event pool which will be used to allocate Event objects |
87 |
*/ |
*/ |
88 |
LFO(float Min, float Max, propagation_t Propagation, T_Manipulator* pManipulator, RTELMemoryPool<Event>* pEventPool) { |
LFO(float Min, float Max, propagation_t Propagation, T_Manipulator* pManipulator, Pool<Event>* pEventPool) { |
89 |
this->Propagation = Propagation; |
this->Propagation = Propagation; |
90 |
this->pEvents = new RTEList<Event>(pEventPool); |
this->pEvents = new RTList<Event>(pEventPool); |
91 |
this->ExtController = 0; |
this->ExtController = 0; |
92 |
this->Min = Min; |
this->Min = Min; |
93 |
this->Max = Max; |
this->Max = Max; |
106 |
* this audio fragment cycle by the audio engine |
* this audio fragment cycle by the audio engine |
107 |
*/ |
*/ |
108 |
void Process(uint Samples) { |
void Process(uint Samples) { |
109 |
Event* pCtrlEvent = pEvents->first(); |
RTList<Event>::Iterator itCtrlEvent = pEvents->first(); |
110 |
int iSample = TriggerDelay; |
int iSample = TriggerDelay; |
111 |
while (iSample < Samples) { |
while (iSample < Samples) { |
112 |
int process_break = Samples; |
int process_break = Samples; |
113 |
if (pCtrlEvent && pCtrlEvent->FragmentPos() <= process_break) process_break = pCtrlEvent->FragmentPos(); |
if (itCtrlEvent && itCtrlEvent->FragmentPos() <= process_break) process_break = itCtrlEvent->FragmentPos(); |
114 |
|
|
115 |
if (Coeff > 0.0f) { // level going up |
if (Coeff > 0.0f) { // level going up |
116 |
while (iSample < process_break && Level <= CurrentMax) { |
while (iSample < process_break && Level <= CurrentMax) { |
152 |
} |
} |
153 |
} |
} |
154 |
|
|
155 |
if (pCtrlEvent) { |
if (itCtrlEvent) { |
156 |
RecalculateCoeff(pCtrlEvent->Param.CC.Value); |
RecalculateCoeff(itCtrlEvent->Param.CC.Value); |
157 |
pCtrlEvent = pEvents->next(); |
++itCtrlEvent; |
158 |
} |
} |
159 |
} |
} |
160 |
TriggerDelay = 0; |
TriggerDelay = 0; |
223 |
* |
* |
224 |
* @param pEvent - control change event of external controller |
* @param pEvent - control change event of external controller |
225 |
*/ |
*/ |
226 |
inline void SendEvent(Event* pEvent) { |
inline void SendEvent(Pool<Event>::Iterator itEvent) { |
227 |
if (ExtController && pEvent->FragmentPos() >= this->TriggerDelay) pEvents->alloc_assign(*pEvent); |
if (ExtController && itEvent->FragmentPos() >= this->TriggerDelay && !pEvents->poolIsEmpty()) *pEvents->allocAppend() = *itEvent; |
228 |
} |
} |
229 |
|
|
230 |
/** |
/** |
235 |
} |
} |
236 |
|
|
237 |
protected: |
protected: |
238 |
RTEList<Event>* pEvents; |
RTList<Event>* pEvents; |
239 |
propagation_t Propagation; |
propagation_t Propagation; |
240 |
int TriggerDelay; |
int TriggerDelay; |
241 |
float Min; |
float Min; |