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

Duplicates a mono processor across N channels. More...

#include <processor_duplicator.hpp>

Public Member Functions

 ProcessorDuplicatorT ()=default
void prepare (int num_channels, SampleType sample_rate)
 Prepare for processing with the given number of channels.
void process (SampleType *const *channels, int num_channels, int num_samples)
 Process a multi-channel buffer in-place channels: array of channel pointers num_channels: number of channels num_samples: samples per channel.
void process_channel (SampleType *buffer, int channel, int num_samples)
 Process a single channel.
P & operator[] (int channel)
 Access individual channel processor (e.g., to set parameters).
const P & operator[] (int channel) const
template<typename Func>
void for_each (Func &&fn)
 Set parameters on all channel processors.
void reset ()
 Reset all channel processors.
int num_channels () const

Detailed Description

template<typename P, typename SampleType = float>
class pulp::signal::ProcessorDuplicatorT< P, SampleType >

Duplicates a mono processor across N channels.

The processor type P must support:

  • default constructor
  • set_sample_rate(float)
  • process(float) -> float (single-sample)
  • reset()

When P also provides an in-place block path process(SampleType*, int), each channel is handed to it whole instead of being looped through the single-sample call, so a processor whose block path keeps its state in registers gets that benefit here too. P's block path must be equivalent to looping its single-sample path.

RT contract: prepare() resizes channel storage and is not audio-callback safe. process(), process_channel(), for_each(), and reset() allocate no memory after prepare when P follows the same contract.

Constructor & Destructor Documentation

◆ ProcessorDuplicatorT()

template<typename P, typename SampleType = float>
pulp::signal::ProcessorDuplicatorT< P, SampleType >::ProcessorDuplicatorT ( )
default

Member Function Documentation

◆ for_each()

template<typename P, typename SampleType = float>
template<typename Func>
void pulp::signal::ProcessorDuplicatorT< P, SampleType >::for_each ( Func && fn)
inline

Set parameters on all channel processors.

◆ num_channels()

template<typename P, typename SampleType = float>
int pulp::signal::ProcessorDuplicatorT< P, SampleType >::num_channels ( ) const
inline

◆ operator[]() [1/2]

template<typename P, typename SampleType = float>
P & pulp::signal::ProcessorDuplicatorT< P, SampleType >::operator[] ( int channel)
inline

Access individual channel processor (e.g., to set parameters).

◆ operator[]() [2/2]

template<typename P, typename SampleType = float>
const P & pulp::signal::ProcessorDuplicatorT< P, SampleType >::operator[] ( int channel) const
inline

◆ prepare()

template<typename P, typename SampleType = float>
void pulp::signal::ProcessorDuplicatorT< P, SampleType >::prepare ( int num_channels,
SampleType sample_rate )
inline

Prepare for processing with the given number of channels.

◆ process()

template<typename P, typename SampleType = float>
void pulp::signal::ProcessorDuplicatorT< P, SampleType >::process ( SampleType *const * channels,
int num_channels,
int num_samples )
inline

Process a multi-channel buffer in-place channels: array of channel pointers num_channels: number of channels num_samples: samples per channel.

◆ process_channel()

template<typename P, typename SampleType = float>
void pulp::signal::ProcessorDuplicatorT< P, SampleType >::process_channel ( SampleType * buffer,
int channel,
int num_samples )
inline

Process a single channel.

◆ reset()

template<typename P, typename SampleType = float>
void pulp::signal::ProcessorDuplicatorT< P, SampleType >::reset ( )
inline

Reset all channel processors.


The documentation for this class was generated from the following file: