Aviate Audio Multiverse Library
Public Types | Public Member Functions | List of all members
Aviate::ParameterAutomation< T > Class Template Reference

The class will automate a parameter using a trigger from a start value to an end value, using either a preprogrammed function or a user-provided LUT. More...

#include <LibBasicFunctions.h>

Public Types

enum class  Function : unsigned {
  NOT_CONFIGURED = 0 , HOLD , LINEAR , EXPONENTIAL ,
  LOGARITHMIC , PARABOLIC , LOOKUP_TABLE
}
 Type of function to control automation. More...
 

Public Member Functions

 ParameterAutomation ()
 Default constructor.
 
 ParameterAutomation (T startValue, T endValue, size_t durationSamples, Function function=Function::LINEAR)
 Construct an automation object based on duration in audio samples. More...
 
 ParameterAutomation (T startValue, T endValue, float durationMilliseconds, Function function=Function::LINEAR)
 Construct an automation object based on duration in audio samples. More...
 
virtual ~ParameterAutomation ()
 destructor
 
void reconfigure (T startValue, T endValue, size_t durationSamples, Function function=Function::LINEAR)
 set the start and end values for the automation More...
 
void reconfigure (T startValue, T endValue, float durationMilliseconds, Function function=Function::LINEAR)
 set the start and end values for the automation More...
 
void trigger ()
 Start the automation from startValue.
 
getNextValue ()
 Retrieve the next calculated automation value. More...
 
bool isFinished ()
 check if automation is completed More...
 

Detailed Description

template<typename T>
class Aviate::ParameterAutomation< T >

The class will automate a parameter using a trigger from a start value to an end value, using either a preprogrammed function or a user-provided LUT.

Member Enumeration Documentation

◆ Function

template<typename T >
enum Aviate::ParameterAutomation::Function : unsigned
strong

Type of function to control automation.

Enumerator
NOT_CONFIGURED 

Initial, unconfigured stage.

HOLD 

f(x) = constant

LINEAR 

f(x) = x

EXPONENTIAL 

f(x) = exp(-k*x)

LOGARITHMIC 

f(x) =

PARABOLIC 

f(x) = x^2

LOOKUP_TABLE 

f(x) = lut(x)

Constructor & Destructor Documentation

◆ ParameterAutomation() [1/2]

template<typename T >
Aviate::ParameterAutomation< T >::ParameterAutomation ( startValue,
endValue,
size_t  durationSamples,
Function  function = Function::LINEAR 
)

Construct an automation object based on duration in audio samples.

Parameters
startValueautomation will start with this value
endValueautomation will end on this value
durationSampleslength of the automation sequence in samples
functionfunction to apply in moving from start to end values

◆ ParameterAutomation() [2/2]

template<typename T >
Aviate::ParameterAutomation< T >::ParameterAutomation ( startValue,
endValue,
float  durationMilliseconds,
Function  function = Function::LINEAR 
)

Construct an automation object based on duration in audio samples.

Parameters
startValueautomation will start with this value
endValueautomation will end on this value
durationMillisecondslength of the automation sequence in milliseconds as a float value
functionfunction to apply in moving from start to end values

Member Function Documentation

◆ getNextValue()

template<typename T >
T Aviate::ParameterAutomation< T >::getNextValue ( )

Retrieve the next calculated automation value.

Returns
the calculated parameter value of templated type T

◆ isFinished()

template<typename T >
bool Aviate::ParameterAutomation< T >::isFinished ( )

check if automation is completed

Returns
true is automation is finished, false if stil running

◆ reconfigure() [1/2]

template<typename T >
void Aviate::ParameterAutomation< T >::reconfigure ( startValue,
endValue,
float  durationMilliseconds,
Function  function = Function::LINEAR 
)

set the start and end values for the automation

Parameters
functionselect which automation curve (function) to use
startValueafter reset, parameter automation start from this value
endValueafter the automation duration, paramter will finish at this value
durationMillisecondsnumber of samples to transition from startValue to endValue

◆ reconfigure() [2/2]

template<typename T >
void Aviate::ParameterAutomation< T >::reconfigure ( startValue,
endValue,
size_t  durationSamples,
Function  function = Function::LINEAR 
)

set the start and end values for the automation

Parameters
functionselect which automation curve (function) to use
startValueafter reset, parameter automation start from this value
endValueafter the automation duration, paramter will finish at this value
durationSamplesnumber of samples to transition from startValue to endValue

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