| 216 | // Templated on the struct type so we don't need friend access. |
| 217 | template <typename CombT> |
| 218 | inline float processCombImpl(CombT& c, float in, |
| 219 | float feedback, float damp1, float damp2, |
| 220 | int activeLen) |
| 221 | { |
| 222 | const float out = c.buffer[c.index]; |
| 223 | c.lpfState = out * damp2 + c.lpfState * damp1; |
| 224 | c.buffer[c.index] = in + c.lpfState * feedback; |
| 225 | c.index = (c.index + 1) % activeLen; |
| 226 | return out; |
| 227 | } |
| 228 | |
| 229 | // Process one sample through a Schroeder allpass. Feedback fixed at 0.5. |
| 230 | template <typename ApT> |