VISR  0.11.6
Versatile Interactive Scene Renderer
visr::rbbl::GainMatrix< ElementType > Class Template Reference

#include <gain_matrix.hpp>

Public Member Functions

 GainMatrix (std::size_t numberOfInputs, std::size_t numberOfOutputs, std::size_t blockLength, std::size_t interpolationSteps, ElementType initialValue=static_cast< ElementType >(0.0), std::size_t alignment=0)
 
 GainMatrix (std::size_t numberOfInputs, std::size_t numberOfOutputs, std::size_t blockLength, std::size_t interpolationSteps, efl::BasicMatrix< ElementType > const &initialGains, std::size_t alignment=0)
 
 ~GainMatrix ()
 
void process (ElementType const *const *input, ElementType *const *output)
 
void process (ElementType const *const *input, ElementType *const *output, efl::BasicMatrix< ElementType > const &newGains)
 
void setNewGains (efl::BasicMatrix< ElementType > const &newGains)
 

Detailed Description

template<typename ElementType>
class visr::rbbl::GainMatrix< ElementType >

Processing component to apply a potentially time-varying gain matrix operation to a vector of audio input signals, producing a vector output signals

Template Parameters
ElementTypeThe data type used for the audio samples and the gain values. Class is explicitly instantiated for element types float and double.

Constructor & Destructor Documentation

◆ GainMatrix() [1/2]

template<typename ElementType >
visr::rbbl::GainMatrix< ElementType >::GainMatrix ( std::size_t  numberOfInputs,
std::size_t  numberOfOutputs,
std::size_t  blockLength,
std::size_t  interpolationSteps,
ElementType  initialValue = static_cast<ElementType>(0.0),
std::size_t  alignment = 0 
)
explicit

Constructor, sets all matrix gains to common value (default: 0.0)

Parameters
numberOfInputsThe number of input channels of the audio processor, i.e., the number of columns of the matrix.
numberOfOutputsThe number of output channels of the audio processor, i.e., the number of rows of the matrix.
blockLengthThe number of samples in each input or output channel processed in each invocation of process()
interpolationStepsThe duration of a transition to a new set of gain value, specified in samples. Must be an integer multiple of the blockLength parameter.
initialValueThe initial value (linear scale) for all gain values in the matrix.
alignmentthe minimum alignment for the input and output vectors as well as the internally stored data members, given as a number of samples.

◆ GainMatrix() [2/2]

template<typename ElementType >
visr::rbbl::GainMatrix< ElementType >::GainMatrix ( std::size_t  numberOfInputs,
std::size_t  numberOfOutputs,
std::size_t  blockLength,
std::size_t  interpolationSteps,
efl::BasicMatrix< ElementType > const &  initialGains,
std::size_t  alignment = 0 
)
explicit

Constructor, sets matrix gains according to a given matrix.

Parameters
numberOfInputsThe number of input channels of the audio processor, i.e., the number of columns of the matrix.
numberOfOutputsThe number of output channels of the audio processor, i.e., the number of rows of the matrix.
blockLengthThe number of samples in each input or output channel processed in each invocation of process()
interpolationStepsThe duration of a transition to a new set of gain value, specified in samples. Must be an integer multiple of the blockLength parameter.
initialGainsThe initial matrix gains (in linear scale). Must be a matrix with dimension numberOfOutputs * numberOfInputs .
alignmentThe minimum alignment for the input and output vectors as well as the internally stored data members, given as a number of samples.

◆ ~GainMatrix()

template<typename ElementType >
visr::rbbl::GainMatrix< ElementType >::~GainMatrix ( )
default

Destructor.

Member Function Documentation

◆ process() [1/2]

template<typename ElementType >
void visr::rbbl::GainMatrix< ElementType >::process ( ElementType const *const *  input,
ElementType *const *  output 
)

Process multichannel audio by matrixing the number of blockLength samples (specified in the constructor) from each input channel to the range of the output channels. If a new set of gain values has been set previously, the transition to the new value will continue. After that, matrixing will be performed using the new gain values.

Parameters
inputA range of arrays containing the input sample vectors. Must be numberOfInputs elements long, and each sample vector must contain at least blockLength elements.
[out]outputRange of arrays containing the output sample vectors. Must be numberOfOutputs elements long, and each sample vector must contain at least blockLength elements.

◆ process() [2/2]

template<typename ElementType >
void visr::rbbl::GainMatrix< ElementType >::process ( ElementType const *const *  input,
ElementType *const *  output,
efl::BasicMatrix< ElementType > const &  newGains 
)

Set a new matrix of gain values and process multichannel audio by matrixing the number of blockLength samples (specified in the constructor) from each input channel to the range of the output channels. If no new set of gain values has been set previously, a transition will start that will change the used gains to the new values over a period of interpolationSteps samples. If there is a transition currently active, the current interpolated gains will be used as the starting point of a new transistion process (taking interpolationSteps samples). transition to the new value will continue. After that, matrixing will be performed using the new gain values.

Parameters
inputA range of arrays containing the input sample vectors. Must be numberOfInputs elements long, and each sample vector must contain at least blockLength elements.
[out]outputThe output Range of arrays containing the output sample vectors. Must be numberOfOutputs elements long, and each sample vector must contain at least blockLength elements.
newGainsThe matrix of new gain values, dimension must be numerOfInputs * numberOfOutputs .

◆ setNewGains()

template<typename ElementType >
void visr::rbbl::GainMatrix< ElementType >::setNewGains ( efl::BasicMatrix< ElementType > const &  newGains)

Set a new gain matrix. If no new set of gain values has been set previously, a transition will start that will change the used gains to the new values over a period of interpolationSteps samples. If there is a transition currently active, the current interpolated gains will be used as the starting point of a new transistion process (taking interpolationSteps samples).

Parameters
newGainsThe matrix of new gain values, dimension must be numerOfInputs * numberOfOutputs .

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