104 |
* |
* |
105 |
* @param Samples - total number of sample points to be rendered in |
* @param Samples - total number of sample points to be rendered in |
106 |
* this audio fragment cycle by the audio engine |
* this audio fragment cycle by the audio engine |
107 |
|
* @returns true if modulation is active (LFO depth <> 0.0) |
108 |
*/ |
*/ |
109 |
void Process(uint Samples) { |
bool Process(uint Samples) { |
110 |
RTList<Event>::Iterator itCtrlEvent = pEvents->first(); |
RTList<Event>::Iterator itCtrlEvent = pEvents->first(); |
111 |
int iSample = TriggerDelay; |
int iSample = TriggerDelay; |
112 |
|
bool result; |
113 |
while (iSample < Samples) { |
while (iSample < Samples) { |
114 |
int process_break = Samples; |
int process_break = Samples; |
115 |
if (itCtrlEvent && itCtrlEvent->FragmentPos() <= process_break) process_break = itCtrlEvent->FragmentPos(); |
if (itCtrlEvent && itCtrlEvent->FragmentPos() <= process_break) process_break = itCtrlEvent->FragmentPos(); |
124 |
Coeff = -Coeff; // invert direction |
Coeff = -Coeff; // invert direction |
125 |
Level += 2.0f * Coeff; |
Level += 2.0f * Coeff; |
126 |
} |
} |
127 |
|
result = true; // modulation active |
128 |
} |
} |
129 |
else if (Coeff < 0.0f) { // level going down |
else if (Coeff < 0.0f) { // level going down |
130 |
while (iSample < process_break && Level >= CurrentMin) { |
while (iSample < process_break && Level >= CurrentMin) { |
136 |
Coeff = -Coeff; // invert direction |
Coeff = -Coeff; // invert direction |
137 |
Level += 2.0f * Coeff; |
Level += 2.0f * Coeff; |
138 |
} |
} |
139 |
|
result = true; // modulation active |
140 |
} |
} |
141 |
else { // no modulation at all (Coeff = 0.0) |
else { // no modulation at all (Coeff = 0.0) |
142 |
switch (Propagation) { |
switch (Propagation) { |
154 |
pManipulator->ApplyLevel(Level, iSample); |
pManipulator->ApplyLevel(Level, iSample); |
155 |
iSample++; |
iSample++; |
156 |
} |
} |
157 |
|
result = false; // modulation inactive |
158 |
} |
} |
159 |
|
|
160 |
if (itCtrlEvent) { |
if (itCtrlEvent) { |
164 |
} |
} |
165 |
TriggerDelay = 0; |
TriggerDelay = 0; |
166 |
pEvents->clear(); |
pEvents->clear(); |
167 |
|
return result; |
168 |
} |
} |
169 |
|
|
170 |
/** |
/** |