iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
OverSampler< T > Class Template Reference

Public Types

using BlockProcessFunc = std::function< void(T **, T **, int)>
 

Public Member Functions

 OverSampler (EFactor factor=kNone, bool blockProcessing=true, int nInChannels=1, int nOutChannels=1)
 
 OverSampler (const OverSampler &)=delete
 
OverSampleroperator= (const OverSampler &)=delete
 
void Reset (int blockSize=DEFAULT_BLOCK_SIZE)
 
void ProcessBlock (T **inputs, T **outputs, int nFrames, int nInChans, int nOutChans, BlockProcessFunc func)
 Over sample an input block with a per-block function (up sample input -> process with function -> down sample) More...
 
Process (T input, std::function< T(T)> func)
 Over sample an input sample with a per-sample function (up-sample input -> process with function -> down-sample) More...
 
ProcessGen (std::function< T()> genFunc)
 Over-sample an per-sample synthesis function. More...
 
void SetOverSampling (EFactor factor)
 
int GetRate () const
 

Static Public Member Functions

static EFactor RateToFactor (int rate)
 

Detailed Description

template<typename T = double>
class OverSampler< T >

Definition at line 41 of file Oversampler.h.

Member Typedef Documentation

◆ BlockProcessFunc

template<typename T = double>
using OverSampler< T >::BlockProcessFunc = std::function<void(T**, T**, int)>

Definition at line 44 of file Oversampler.h.

Constructor & Destructor Documentation

◆ OverSampler()

template<typename T = double>
OverSampler< T >::OverSampler ( EFactor  factor = kNone,
bool  blockProcessing = true,
int  nInChannels = 1,
int  nOutChannels = 1 
)
inline

Definition at line 46 of file Oversampler.h.

◆ ~OverSampler()

template<typename T = double>
OverSampler< T >::~OverSampler ( )
inline

Definition at line 94 of file Oversampler.h.

Member Function Documentation

◆ GetRate()

template<typename T = double>
int OverSampler< T >::GetRate ( ) const
inline

Definition at line 428 of file Oversampler.h.

◆ Process()

template<typename T = double>
T OverSampler< T >::Process ( input,
std::function< T(T)>  func 
)
inline

Over sample an input sample with a per-sample function (up-sample input -> process with function -> down-sample)

Parameters
inputThe audio sample to input
std::function<double(double)>The function that processes the audio sample at the higher sampling rate. NOTE: std::function can call malloc if you pass in captures
Returns
The audio sample output

Definition at line 255 of file Oversampler.h.

◆ ProcessBlock()

template<typename T = double>
void OverSampler< T >::ProcessBlock ( T **  inputs,
T **  outputs,
int  nFrames,
int  nInChans,
int  nOutChans,
BlockProcessFunc  func 
)
inline

Over sample an input block with a per-block function (up sample input -> process with function -> down sample)

Parameters
inputsTwo-dimensional array containing the non-interleaved input buffers of audio samples for all channels
outputsTwo-dimensional array for audio output (non-interleaved).
nFramesThe block size for this block: number of samples per channel.
nInChansThe number of input channels to process. Must be less or equal to the number of channels passed to the constructor
nOutChansThe number of output channels to process. Must be less or equal to the number of channels passed to the constructor
funcThe function that processes the audio sample at the higher sampling rate. NOTE: std::function can call malloc if you pass in captures

Definition at line 177 of file Oversampler.h.

◆ ProcessGen()

template<typename T = double>
T OverSampler< T >::ProcessGen ( std::function< T()>  genFunc)
inline

Over-sample an per-sample synthesis function.

Parameters
genFuncThe function that generates the audio sample
Returns
The audio sample output

Definition at line 323 of file Oversampler.h.

◆ RateToFactor()

template<typename T = double>
static EFactor OverSampler< T >::RateToFactor ( int  rate)
inlinestatic

Definition at line 415 of file Oversampler.h.

◆ Reset()

template<typename T = double>
void OverSampler< T >::Reset ( int  blockSize = DEFAULT_BLOCK_SIZE)
inline

Definition at line 109 of file Oversampler.h.

◆ SetOverSampling()

template<typename T = double>
void OverSampler< T >::SetOverSampling ( EFactor  factor)
inline

Definition at line 404 of file Oversampler.h.


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