Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::SvfBankT< SampleType, Voices > Class Template Reference

Voices independent SvfT voices advanced together. More...

#include <svf_bank.hpp>

Public Types

using Filter = SvfT<SampleType>
using Mode = typename Filter::Mode

Public Member Functions

 SvfBankT ()
void configure (std::size_t voice, Mode mode, SampleType sample_rate, SampleType frequency, SampleType resonance)
 Install a coherent mode, rate, cutoff and resonance for one voice (SvfT::configure()).
void set_sample_rate (std::size_t voice, SampleType sample_rate)
void set_frequency (std::size_t voice, SampleType hz)
void set_resonance (std::size_t voice, SampleType q)
void set_mode (std::size_t voice, Mode mode)
Filter::Coefficients coefficients (std::size_t voice) const
 The voice's coefficients (SvfT::design() for its current settings).
void process (const SampleType *in, SampleType *out)
 Advance every voice by one sample: out[v] = voice v's output for in[v].
void process_voices (SampleType *const *buffers, std::size_t num_samples)
 Advance every voice by num_samples samples in place, one buffer per voice (buffers[v] holds voice v's input and receives its output).
void reset (std::size_t voice)
void reset ()

Static Public Attributes

static constexpr std::size_t voice_count = Voices

Detailed Description

template<typename SampleType = float, std::size_t Voices = 16>
class pulp::signal::SvfBankT< SampleType, Voices >

Voices independent SvfT voices advanced together.

Contract:

  • Each voice's output is bit-identical to an SvfT<SampleType> with the same mode, sample rate, frequency and resonance, driven with the same inputs through SvfT::process(SampleType) from the same reset state, including its per-sample denormal snap. Setters have SvfT's semantics: coefficients come from SvfT::design() and are recomputed by every rate, frequency or resonance change; a default-constructed voice has all-zero coefficients until one of them is set, as SvfT does.
  • Voices share nothing but storage, and each has its own mode.
  • process() advances every voice by one sample; process_voices() advances every voice by a block, one buffer per voice.

Why it is faster: the voices' state is held in structure-of-arrays form and every step is a loop over independent voices, which the compiler vectorizes; the per-voice mode becomes a per-lane select instead of a branch.

RT contract: storage is fixed-size; every member function allocates no memory.

Member Typedef Documentation

◆ Filter

template<typename SampleType = float, std::size_t Voices = 16>
using pulp::signal::SvfBankT< SampleType, Voices >::Filter = SvfT<SampleType>

◆ Mode

template<typename SampleType = float, std::size_t Voices = 16>
using pulp::signal::SvfBankT< SampleType, Voices >::Mode = typename Filter::Mode

Constructor & Destructor Documentation

◆ SvfBankT()

template<typename SampleType = float, std::size_t Voices = 16>
pulp::signal::SvfBankT< SampleType, Voices >::SvfBankT ( )
inline

Member Function Documentation

◆ coefficients()

template<typename SampleType = float, std::size_t Voices = 16>
Filter::Coefficients pulp::signal::SvfBankT< SampleType, Voices >::coefficients ( std::size_t voice) const
inline

The voice's coefficients (SvfT::design() for its current settings).

◆ configure()

template<typename SampleType = float, std::size_t Voices = 16>
void pulp::signal::SvfBankT< SampleType, Voices >::configure ( std::size_t voice,
Mode mode,
SampleType sample_rate,
SampleType frequency,
SampleType resonance )
inline

Install a coherent mode, rate, cutoff and resonance for one voice (SvfT::configure()).

◆ process()

template<typename SampleType = float, std::size_t Voices = 16>
void pulp::signal::SvfBankT< SampleType, Voices >::process ( const SampleType * in,
SampleType * out )
inline

Advance every voice by one sample: out[v] = voice v's output for in[v].

in and out may be the same array.

◆ process_voices()

template<typename SampleType = float, std::size_t Voices = 16>
void pulp::signal::SvfBankT< SampleType, Voices >::process_voices ( SampleType *const * buffers,
std::size_t num_samples )
inline

Advance every voice by num_samples samples in place, one buffer per voice (buffers[v] holds voice v's input and receives its output).

◆ reset() [1/2]

template<typename SampleType = float, std::size_t Voices = 16>
void pulp::signal::SvfBankT< SampleType, Voices >::reset ( )
inline

◆ reset() [2/2]

template<typename SampleType = float, std::size_t Voices = 16>
void pulp::signal::SvfBankT< SampleType, Voices >::reset ( std::size_t voice)
inline

◆ set_frequency()

template<typename SampleType = float, std::size_t Voices = 16>
void pulp::signal::SvfBankT< SampleType, Voices >::set_frequency ( std::size_t voice,
SampleType hz )
inline

◆ set_mode()

template<typename SampleType = float, std::size_t Voices = 16>
void pulp::signal::SvfBankT< SampleType, Voices >::set_mode ( std::size_t voice,
Mode mode )
inline

◆ set_resonance()

template<typename SampleType = float, std::size_t Voices = 16>
void pulp::signal::SvfBankT< SampleType, Voices >::set_resonance ( std::size_t voice,
SampleType q )
inline

◆ set_sample_rate()

template<typename SampleType = float, std::size_t Voices = 16>
void pulp::signal::SvfBankT< SampleType, Voices >::set_sample_rate ( std::size_t voice,
SampleType sample_rate )
inline

Member Data Documentation

◆ voice_count

template<typename SampleType = float, std::size_t Voices = 16>
std::size_t pulp::signal::SvfBankT< SampleType, Voices >::voice_count = Voices
staticconstexpr

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/signal/include/pulp/signal/svf_bank.hpp