61 using NumericType =
typename SampleTypeHelpers::ElementType<SampleType>::Type;
97 template <
typename ProcessContext>
98 void process (
const ProcessContext&
context)
noexcept
100 static_assert (std::is_same<typename ProcessContext::SampleType, SampleType>::value,
101 "The sample-type of the filter must match the sample-type supplied to this process callback");
118 default: jassertfalse;
121 return SampleType{0};
129 y[2] = (
sample - s1 * state.R2 - s1 * state.g - s2) * state.h;
131 y[1] = y[2] * state.g + s1;
132 s1 = y[2] * state.g + y[1];
134 y[0] = y[1] * state.g + s2;
135 s2 = y[1] * state.g + y[0];
137 return isBypassed ?
sample : y[
static_cast<size_t> (type)];
141 void processBlock (
const SampleType* input, SampleType* output,
size_t n)
noexcept
145 for (
size_t i = 0 ; i < n; ++i)
152 template <
bool isBypassed,
typename ProcessContext>
153 void processInternal (
const ProcessContext&
context)
noexcept
155 auto&& inputBlock =
context.getInputBlock();
156 auto&& outputBlock =
context.getOutputBlock();
160 jassert (inputBlock.getNumChannels() == 1);
161 jassert (outputBlock.getNumChannels() == 1);
163 auto n = inputBlock.getNumSamples();
164 auto*
src = inputBlock .getChannelPointer (0);
165 auto*
dst = outputBlock.getChannelPointer (0);
172 default: jassertfalse;
177 std::array<SampleType, 3> y;
181 JUCE_LEAK_DETECTOR (
Filter)