62 using NumericType =
typename SampleTypeHelpers::ElementType<SampleType>::Type;
70 [[
deprecated (
"The classes in the StateVariableFilter namespace are deprecated. you should "
71 "use the equivalent functionality in the StateVariableTPTFilter class.")]]
75 [[
deprecated (
"The classes in the StateVariableFilter namespace are deprecated. you should "
76 "use the equivalent functionality in the StateVariableTPTFilter class.")]]
105 template <
typename ProcessContext>
106 void process (
const ProcessContext&
context)
noexcept
108 static_assert (std::is_same_v<typename ProcessContext::SampleType, SampleType>,
109 "The sample-type of the filter must match the sample-type supplied to this process callback");
126 default: jassertfalse;
129 return SampleType{0};
137 y[2] = (
sample - s1 * state.R2 - s1 * state.g - s2) * state.h;
139 y[1] = y[2] * state.g + s1;
140 s1 = y[2] * state.g + y[1];
142 y[0] = y[1] * state.g + s2;
143 s2 = y[1] * state.g + y[0];
145 return isBypassed ?
sample : y[
static_cast<size_t> (type)];
149 void processBlock (
const SampleType* input, SampleType* output,
size_t n)
noexcept
153 for (
size_t i = 0 ; i < n; ++i)
156 #if JUCE_DSP_ENABLE_SNAP_TO_ZERO
163 template <
bool isBypassed,
typename ProcessContext>
164 void processInternal (
const ProcessContext&
context)
noexcept
166 auto&& inputBlock =
context.getInputBlock();
167 auto&& outputBlock =
context.getOutputBlock();
171 jassert (inputBlock.getNumChannels() == 1);
172 jassert (outputBlock.getNumChannels() == 1);
174 auto n = inputBlock.getNumSamples();
175 auto*
src = inputBlock .getChannelPointer (0);
176 auto*
dst = outputBlock.getChannelPointer (0);
183 default: jassertfalse;
188 std::array<SampleType, 3> y;
192 JUCE_LEAK_DETECTOR (
Filter)