ofxPDSP
pdsp::Processor Class Reference

The bridge between pdsp and the audio callback. More...

#include <Processor.h>

Public Member Functions

 Processor (int channels)
 
void process (const int &bufferSize) noexcept
 simply process the channes without copying them, useful if you want just to split the processing in multiple calls. More...
 
void processAndCopyOutput (float **bufferToFill, const int &channelsNum, const int &bufferSize) noexcept
 process all the DSP recursively and copies them to an array of pointer to arrays (channels) More...
 
void processAndCopyInterleaved (float *bufferToFill, const int &channelsNum, const int &bufferSize) noexcept
 process all the DSP recursively and copies the result to an array of interleaved values More...
 
void resize (int channelsNum)
 change the number of output channels; More...
 

Public Attributes

std::vector< PatchNodechannels
 an array of channels. Patch your Units and modules to this channels thinking to them as your system final output
 
PatchNode blackhole
 all the connectio patched to this will be processed but not outputted. Patch your Units and modules to this channels if you need them to be always active for some reason;
 

Detailed Description

The bridge between pdsp and the audio callback.

One of the processAndCopy... method of this class has to be called inside the audio callback, it will recursively process all the Units and modules patched to the input channels and copy the results to the audio callback. The standard constructor has 2 channels, but you can change the number of channels simply using resize() on the channels vector.

Member Function Documentation

◆ process()

void pdsp::Processor::process ( const int &  bufferSize)
noexcept

simply process the channes without copying them, useful if you want just to split the processing in multiple calls.

Sometimes maybe you want to split the process in multiple process calls, so you can patch a Processor channels into another processor, call process() on the first processor and processAndCopy on the second.

◆ processAndCopyInterleaved()

void pdsp::Processor::processAndCopyInterleaved ( float *  bufferToFill,
const int &  channelsNum,
const int &  bufferSize 
)
noexcept

process all the DSP recursively and copies the result to an array of interleaved values

Parameters
[in]bufferToFillinterleaved array of audio buffers to render
[in]channelsNumnumber of channels
[in]bufferSizenumber of samples to render

◆ processAndCopyOutput()

void pdsp::Processor::processAndCopyOutput ( float **  bufferToFill,
const int &  channelsNum,
const int &  bufferSize 
)
noexcept

process all the DSP recursively and copies them to an array of pointer to arrays (channels)

Parameters
[in]bufferToFillmultidimensional array of audio buffers to render
[in]channelsNumnumber of channels
[in]bufferSizenumber of samples to render

◆ resize()

void pdsp::Processor::resize ( int  channelsNum)

change the number of output channels;

Parameters
[in]channelsNumnumber of channels

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