![]() |
VISR
0.11.7
Versatile Interactive Scene Renderer
|
#include <delay_matrix.hpp>
Public Types | |
enum | ControlPortConfig { ControlPortConfig::None = 0, ControlPortConfig::Delay = 1<<0, ControlPortConfig::Gain = 1<<1, ControlPortConfig::All = Delay | Gain } |
using | MethodDelayPolicy = rbbl::MultichannelDelayLine< SampleType >::MethodDelayPolicy |
Public Member Functions | |
DelayMatrix (SignalFlowContext const &context, char const *name, CompositeComponent *parent=nullptr) | |
DelayMatrix (SignalFlowContext const &context, char const *name, CompositeComponent *parent, std::size_t numberOfInputs, std::size_t numberOfOutputs, std::size_t interpolationSteps, SampleType maximumDelaySeconds, const char *interpolationMethod, MethodDelayPolicy methodDelayPolicy, ControlPortConfig controlInputs, SampleType initialDelaySeconds=static_cast< SampleType >(0.0), SampleType initialGainLinear=static_cast< SampleType >(1.0)) | |
DelayMatrix (SignalFlowContext const &context, char const *name, CompositeComponent *parent, std::size_t numberOfInputs, std::size_t numberOfOutputs, std::size_t interpolationSteps, SampleType maximumDelaySeconds, const char *interpolationMethod, MethodDelayPolicy methodDelayPolicy, ControlPortConfig controlInputs, efl::BasicMatrix< SampleType > const &initialDelaysSeconds, efl::BasicMatrix< SampleType > const &initialGainsLinear) | |
void | setup (std::size_t numberOfInputs, std::size_t numberOfOutputs, std::size_t interpolationSteps, SampleType maximumDelaySeconds, const char *interpolationMethod, MethodDelayPolicy methodDelayPolicy, ControlPortConfig controlInputs, SampleType initialDelaySeconds=static_cast< SampleType >(0.0), SampleType initialGainLinear=static_cast< SampleType >(1.0)) |
void | setup (std::size_t numberOfInputs, std::size_t numberOfOutputs, std::size_t interpolationSteps, SampleType maximumDelaySeconds, const char *interpolationMethod, MethodDelayPolicy methodDelayPolicy, ControlPortConfig controlInputs, efl::BasicMatrix< SampleType > const &initialDelaysSeconds, efl::BasicMatrix< SampleType > const &initialGainsLinear) |
void | process () |
void | setDelayAndGain (efl::BasicMatrix< SampleType > const &newDelays, efl::BasicMatrix< SampleType > const &newGains) |
void | setDelay (efl::BasicMatrix< SampleType > const &newDelays) |
void | setGain (efl::BasicMatrix< SampleType > const &newGains) |
![]() | |
AtomicComponent (SignalFlowContext const &context, char const *name, CompositeComponent *parent=nullptr) | |
AtomicComponent (AtomicComponent const &)=delete | |
AtomicComponent (AtomicComponent &&)=delete | |
virtual | ~AtomicComponent () override |
![]() | |
Component (SignalFlowContext const &context, char const *componentName, CompositeComponent *parent) | |
Component (SignalFlowContext const &context, std::string const &componentName, CompositeComponent *parent) | |
Component (Component const &)=delete | |
Component (Component &&)=delete | |
Component & | operator= (Component const &)=delete |
Component & | operator= (Component &&)=delete |
virtual | ~Component () |
std::string const & | name () const |
std::string | fullName () const |
void | status (StatusMessage::Kind status, char const *message) |
template<typename ... MessageArgs> | |
void | status (StatusMessage::Kind status, MessageArgs ... args) |
bool | isComposite () const |
AudioPortBase & | audioPort (char const *portName) |
AudioPortBase const & | audioPort (char const *portName) const |
AudioPortBase & | audioPort (std::string const &portName) |
AudioPortBase const & | audioPort (std::string const &portName) const |
ParameterPortBase & | parameterPort (char const *portName) |
ParameterPortBase const & | parameterPort (char const *portName) const |
ParameterPortBase & | parameterPort (std::string const &portName) |
ParameterPortBase const & | parameterPort (std::string const &portName) const |
SamplingFrequencyType | samplingFrequency () const |
std::size_t | period () const |
bool | isTopLevel () const |
impl::ComponentImplementation & | implementation () |
impl::ComponentImplementation const & | implementation () const |
Additional Inherited Members | |
![]() | |
static const std::string & | nameSeparator () |
![]() | |
Component (impl::ComponentImplementation *impl) | |
Audio Component for applying channel-specific delays and gains to a multichannel audio signal. The delays and gains can be changed at runtime. Optionally, the class features smooth transitions if gains and/or delays are changed. This class has one input port named "in" and one output port named "out". The widths of the input and the output port are identical and is set by the argument numberOfChannels in the setup() method.
Implement flexible transition length (at the moment, the block length is always used
general cleanup (including more comprehensive range checks for the delay)
using visr::rcl::DelayMatrix::MethodDelayPolicy = rbbl::MultichannelDelayLine<SampleType>::MethodDelayPolicy |
|
strong |
|
explicit |
Constructor, creates a basic, not fully initialised object. A setup() method must be called before the component before the process() method can be used.
context | Configuration object containing basic execution parameters. |
name | The name of the component. Must be unique within the containing composite component (if there is one). |
parent | Pointer to a containing component if there is one. Specify nullptr in case of a top-level component. |
|
explicit |
Constructor, creates a fully initialised object. A setup() method does not need to called. This overload initalises all delay and gain values to the same (possibly defaulted) values.
context | Configuration object containing basic execution parameters. |
name | The name of the component. Must be unique within the containing composite component (if there is one). |
parent | Pointer to a containing component if there is one. Specify nullptr in case of a top-level component. |
numberOfInputs | The number of input audio waveforms |
numberOfOutputs | The number of output audio waveforms |
interpolationSteps | The number of samples needed for the transition after new delays and/or gains are set. It must be an integral multiple of the period of the signal flow. The value "0" denotes an immediate application of the new settings. |
maximumDelaySeconds | The maximal delay value supported by this object (in seconds) |
interpolationMethod | The interpolation method to be applied. The string must correspond to a algorithm registered in rbbl::FractionalDelayFactory |
methodDelayPolicy | Enumeration value governing how the method delay of the interpolation method is incorporated into the delay values applied to the signals. |
controlInputs | Whether the component should contain parameter inputs for the gain and delay parameter. |
initialDelaySeconds | The initial delay value for all channels (in seconds, default: 0.0) |
initialGainLinear | The initial delay value for all channels (in linear scale, default: 1.0) |
|
explicit |
Constructor, creates a fully initialised object. A setup() method does not need to called. This overload accepts matrices of initial delays and gains to initialise each routing point individually.
context | Configuration object containing basic execution parameters. |
name | The name of the component. Must be unique within the containing composite component (if there is one). |
parent | Pointer to a containing component if there is one. Specify nullptr in case of a top-level component. |
numberOfInputs | The number of input audio waveforms |
numberOfOutputs | The number of output audio waveforms |
interpolationSteps | The number of samples needed for the transition after a new delay and/or gain is set. It must be an integral multiple of the period of the signal flow. The value "0" denotes an immediate application of the new delay/gain values. |
maximumDelaySeconds | The maximal delay value supported by this object (in seconds) |
interpolationMethod | The interpolation method to be applied. The string must correspond to a algorithm registered in rbbl::FractionalDelayFactory |
methodDelayPolicy | Enumeration value governing how the method delay of the interpolation method is incorporated into the delay values applied to the signals. |
controlInputs | Whether the component should contain parameter inputs for the gain and delay parameter. |
initialDelaysSeconds | The delays for all channels in seconds. The number of elements of this vector must match the channel number of this object. |
initialGainsLinear | The initial gain values for all channels, given in a linear scale. The the number of elements in this vector must match the channel number of this object. |
|
virtual |
The process method applies the (interpolated) delay and gain values to the stream of input samples.
Implements visr::AtomicComponent.
void visr::rcl::DelayMatrix::setDelay | ( | efl::BasicMatrix< SampleType > const & | newDelays | ) |
Set new values for the delays. This is a simplified version of setGainAndDelay(), which leaves the gain values unaltered. The semantics of the transition are documented in setDelayAndGain(), except that the previous 'new gain value' remains unaltered als the new 'new gain value'.
newDelays | A vector containing the new delay values for all channels (in linear scale). The vector must have numberOfChannels elements. |
std::invalid_argument | If a vector size is invalid |
std::invalid_argument | If a delay value exceeds the maximum delay setting. |
void visr::rcl::DelayMatrix::setDelayAndGain | ( | efl::BasicMatrix< SampleType > const & | newDelays, |
efl::BasicMatrix< SampleType > const & | newGains | ||
) |
Set new values for the delays and the gains. This method triggers a new fading process for a smooth transition between the current and the new gain and delay values. The semantics of the smooth transition are as follows:
newDelays | A containing the new delay values for all channels (in seconds). The matrix must have 1 row and numberOfChannels columns. |
newGains | A matrix containing the new gain values for all channels (in linear scale). The matrix must have 1 row and numberOfChannels columns. |
std::invalid_argument | If a matrix size is invalid |
std::invalid_argument | If a delay value exceeds the maximum delay setting. |
void visr::rcl::DelayMatrix::setGain | ( | efl::BasicMatrix< SampleType > const & | newGains | ) |
Set new values for the gains. This is a simplified version of setGainAndDelay(), which leaves the delay values unaltered. The semantics of the transition are documented in setDelayAndGain(), except that the previous 'new delay value' remains unaltered als the new 'new delay value'.
newGains | A vector containing the new gain values for all channels (in linear scale). The vector must have numberOfChannels elements. |
std::invalid_argument | If a vector size is invalid |
std::invalid_argument | If a delay value exceeds the maximum delay setting. |
void visr::rcl::DelayMatrix::setup | ( | std::size_t | numberOfInputs, |
std::size_t | numberOfOutputs, | ||
std::size_t | interpolationSteps, | ||
SampleType | maximumDelaySeconds, | ||
const char * | interpolationMethod, | ||
MethodDelayPolicy | methodDelayPolicy, | ||
ControlPortConfig | controlInputs, | ||
SampleType | initialDelaySeconds = static_cast<SampleType>(0.0) , |
||
SampleType | initialGainLinear = static_cast<SampleType>(1.0) |
||
) |
Setup method to initialise the object and set the parameters.
numberOfInputs | The number of input audio waveforms |
numberOfOutputs | The number of output audio waveforms |
interpolationSteps | The number of samples needed for the transition after new delays and/or gains are set. It must be an integral multiple of the period of the signal flow. The value "0" denotes an immediate application of the new settings. |
maximumDelaySeconds | The maximal delay value supported by this object (in seconds) |
interpolationMethod | The interpolation method to be applied. The string must correspond to a algorithm registered in rbbl::FractionalDelayFactory |
methodDelayPolicy | Enumeration value governing how the method delay of the interpolation method is incorporated into the delay values applied to the signals. |
controlInputs | Whether the component should contain parameter inputs for the gain and delay parameter. |
initialDelaySeconds | The initial delay value for all channels (in seconds, default: 0.0) |
initialGainLinear | The initial delay value for all channels (in linear scale, default: 1.0) |
void visr::rcl::DelayMatrix::setup | ( | std::size_t | numberOfInputs, |
std::size_t | numberOfOutputs, | ||
std::size_t | interpolationSteps, | ||
SampleType | maximumDelaySeconds, | ||
const char * | interpolationMethod, | ||
MethodDelayPolicy | methodDelayPolicy, | ||
ControlPortConfig | controlInputs, | ||
efl::BasicMatrix< SampleType > const & | initialDelaysSeconds, | ||
efl::BasicMatrix< SampleType > const & | initialGainsLinear | ||
) |
Setup method to initialise the object and set the parameters.
numberOfInputs | The number of input audio waveforms |
numberOfOutputs | The number of output audio waveforms |
interpolationSteps | The number of samples needed for the transition after a new delay and/or gain is set. It must be an integral multiple of the period of the signal flow. The value "0" denotes an immediate application of the new delay/gain values. |
maximumDelaySeconds | The maximal delay value supported by this object (in seconds) |
interpolationMethod | The interpolation method to be applied. The string must correspond to a algorithm registered in rbbl::FractionalDelayFactory |
methodDelayPolicy | Enumeration value governing how the method delay of the interpolation method is incorporated into the delay values applied to the signals. |
controlInputs | Whether the component should contain parameter inputs for the gain and delay parameter. |
initialDelaysSeconds | The delays for all channels in seconds. The number of elements of this vector must match the channel number of this object. |
initialGainsLinear | The initial gain values for all channels, given in a linear scale. The the number of elements in this vector must match the channel number of this object. |