OcaDynamicsCurve#
This document describes the controller implementation of OcaDynamicsCurve. This class is documented in the AES70 standard as:
Dynamic compression / expansion curve.
Curve means a function that expresses the relationship of output level to input level. The dependent variable (Y) of the curve is output level; the independent variable (X) is input level.
Every curve shall be composed of (n+1) straight-line segments joined by (n) small fillets called knees. Each knee shall occur at a particular input level value called the threshold. Each segment shall be characterized by its slope.
| / | S3 / | S2 / | T1-------------T2 | / | S1 / | / | / +------------------------------------
This "drawing" shows a three-segment curve. The horizontal axis is input level, vertical axis is output level.
Algebraically, a curve shall be a function
Out = Curve( In, T[1..n-1], S[1..n], K[1..n-1] )
where n is the number of segments, and In is input level in dBr Out is output level in dBr T[1...n-1] is an array of thresholds in dBr S[1...n] is an array of slopes in dBr per dBr, i.e. unitless K[1..n] is the knee parameter, an implementation-dependant parameter that specifies the shape of the curve around the knee.
Each segment shall have a slope that expresses its ratio of output level to input level. Note that this slope is the inverse of what dynamics processors call "ratio". For example, a ratio of 2:1 shall be represented by a curve segment with slope 1/2 = 0.5.
This model can represent various kinds of audio dynamics elements (we ignore K[] in these examples):
- Compressor with ratio of 2:1 and threshold of 10dBr: n = 2 T[1] = 10 S[1] = 1 S[2] = 0.5
- Hard limiter with threshold of 18dBr: n = 2 T[1] = 18 S[1] = 1 S[2] = 0
- Upward expander with ratio of 1.5:1 and threshold of -12dBr: n = 2 T[1] = -12 S[1] = 1 S[2] = 1.5
- Downward expander (gate) with ratio of 50:1 and threshold of -45dBr: n = 2 T[1] = -45 S[1] = 50 S[2] = 1
This class, OcaDynamicsCurve, shall add two additional parameters to the basic curve mechanism.
Out = Curve( In, T[1..n-1], S[1..n], K[1..n-1] , Floor, Ceiling) where In, T[], and S[], and K[] are as defined above. Floor shall be the lowest gain (in dBr) that the dynamics element is allowed to produce. Ceiling shall be the highest gain (in dBr) that the dynamics element is allowed to produce.
To show the use of Floor and Ceiling, we revisit some of the examples above (again, K[] is ignored):
- Compressor with ratio of 2:1, threshold of 10dBr, and max gain reduction of 20dB: n = 2 T[1] = 10 S[1] = 1 S[2] = 0.5 Floor = -20 Ceiling = 0
- Upward expander with ratio of 1.5:1, threshold of -12dBr, and max gain boost of 4dB: n = 2 T[1] = -12 S[1] = 1 S[2] = 1.5 Floor = 0 Ceiling = 4.0
More complex dynamics curves may be modeled by using more segments (n > 2).
Overview#
- ClassID: 1.1.1.16
- Header:
aes70/controller/OcaDynamicsCurve.hpp
- Namespace:
aes70::controller
- Inheritance: aes70::controller::OcaActuator, aes70::controller::OcaWorker, aes70::controller::OcaRoot, aes70::controller::object
Class Declaration#
namespace aes70::controller
{
class OcaDynamicsCurve : public OcaActuator
{
public:
OcaDynamicsCurve(std::shared_ptr<connection> connection,
uin32_t object_number);
OcaDynamicsCurve(const OcaDynamicsCurve &o);
// Control Methods
// Calls GetNSegments and calls on_result or on_failure
void GetNSegments(auto on_result, failure_callback on_failure);
// Calls SetNSegments and calls on_result or on_failure
void SetNSegments(OcaUint8 Slope, auto on_result, failure_callback on_failure);
// Calls SetNSegments and does not wait for the response
void SetNSegments(OcaUint8 Slope);
// Calls GetThreshold and calls on_result or on_failure
void GetThreshold(auto on_result, failure_callback on_failure);
// Calls SetThresholds and calls on_result or on_failure
void SetThresholds(OcaList<OcaDBr> Threshold, auto on_result, failure_callback on_failure);
// Calls SetThresholds and does not wait for the response
void SetThresholds(OcaList<OcaDBr> Threshold);
// Calls GetSlopes and calls on_result or on_failure
void GetSlopes(auto on_result, failure_callback on_failure);
// Calls SetSlopes and calls on_result or on_failure
void SetSlopes(OcaList<OcaFloat32> slope, auto on_result, failure_callback on_failure);
// Calls SetSlopes and does not wait for the response
void SetSlopes(OcaList<OcaFloat32> slope);
// Calls GetKneeParameters and calls on_result or on_failure
void GetKneeParameters(auto on_result, failure_callback on_failure);
// Calls SetKneeParameters and calls on_result or on_failure
void SetKneeParameters(OcaList<OcaFloat32> Parameters, auto on_result, failure_callback on_failure);
// Calls SetKneeParameters and does not wait for the response
void SetKneeParameters(OcaList<OcaFloat32> Parameters);
// Calls GetDynamicGainCeiling and calls on_result or on_failure
void GetDynamicGainCeiling(auto on_result, failure_callback on_failure);
// Calls SetDynamicGainCeiling and calls on_result or on_failure
void SetDynamicGainCeiling(OcaDB gain, auto on_result, failure_callback on_failure);
// Calls SetDynamicGainCeiling and does not wait for the response
void SetDynamicGainCeiling(OcaDB gain);
// Calls GetDynamicGainFloor and calls on_result or on_failure
void GetDynamicGainFloor(auto on_result, failure_callback on_failure);
// Calls SetDynamicGainFloor and calls on_result or on_failure
void SetDynamicGainFloor(OcaDB Gain, auto on_result, failure_callback on_failure);
// Calls SetDynamicGainFloor and does not wait for the response
void SetDynamicGainFloor(OcaDB Gain);
// Calls SetMultiple and calls on_result or on_failure
void SetMultiple(OcaParameterMask Mask, OcaUint8 NSegments, OcaList<OcaDBr> Thresholds, OcaList<OcaFloat32> Slope, OcaList<OcaFloat32> KneeParameter, OcaDB DynamicGainFloor, OcaDB DynamicGainCeiling, auto on_result, failure_callback on_failure);
// Calls SetMultiple and does not wait for the response
void SetMultiple(OcaParameterMask Mask, OcaUint8 NSegments, OcaList<OcaDBr> Thresholds, OcaList<OcaFloat32> Slope, OcaList<OcaFloat32> KneeParameter, OcaDB DynamicGainFloor, OcaDB DynamicGainCeiling);
// Calls GetThresholds and calls on_result or on_failure
void GetThresholds(auto on_result, failure_callback on_failure);
// Observing Properties
subscription observenSegments(auto callback, failure_callback on_failure);
subscription observeThresholds(auto callback, failure_callback on_failure);
subscription observeSlopes(auto callback, failure_callback on_failure);
subscription observeKneeParameters(auto callback, failure_callback on_failure);
subscription observeDynamicGainFloor(auto callback, failure_callback on_failure);
subscription observeDynamicGainCeiling(auto callback, failure_callback on_failure);
// Property Changed Subscriptions
subscription OnnSegmentsChanged(auto callback, failure_callback on_failure);
subscription OnThresholdsChanged(auto callback, failure_callback on_failure);
subscription OnSlopesChanged(auto callback, failure_callback on_failure);
subscription OnKneeParametersChanged(auto callback, failure_callback on_failure);
subscription OnDynamicGainFloorChanged(auto callback, failure_callback on_failure);
subscription OnDynamicGainCeilingChanged(auto callback, failure_callback on_failure);
};
}
Methods#
GetNSegments#
void GetNSegments(auto on_result, failure_callback on_failure)
Calls the method GetNSegments in the remote device.
Parameters:#
auto on_result
: A callable (e.g. a lambda) with the following arguments:OcaUint8 NSegments
OcaUint8 minN
OcaUint8 maxN
failure_callback on_failure
: A callback which is called on error.
SetNSegments#
void SetNSegments(OcaUint8 Slope, auto on_result, failure_callback on_failure)
Calls the method SetNSegments in the remote device. If no result and error callback is specified, the method will be called without requesting a response.
Parameters:#
OcaUint8 Slope
auto on_result
: A callable (e.g. a lambda) with 0 arguments.failure_callback on_failure
: A callback which is called on error.
GetThreshold#
void GetThreshold(auto on_result, failure_callback on_failure)
Calls the method GetThreshold in the remote device.
Parameters:#
auto on_result
: A callable (e.g. a lambda) with the following arguments:OcaDBr Threshold
OcaDBz minThreshold
OcaDBz maxThreshold
failure_callback on_failure
: A callback which is called on error.
SetThresholds#
void SetThresholds(OcaList<OcaDBr> Threshold, auto on_result, failure_callback on_failure)
Calls the method SetThresholds in the remote device. If no result and error callback is specified, the method will be called without requesting a response.
Parameters:#
OcaList<OcaDBr> Threshold
auto on_result
: A callable (e.g. a lambda) with 0 arguments.failure_callback on_failure
: A callback which is called on error.
GetSlopes#
void GetSlopes(auto on_result, failure_callback on_failure)
Calls the method GetSlopes in the remote device.
Parameters:#
auto on_result
: A callable (e.g. a lambda) with the following arguments:OcaList<OcaFloat32> Slopes
OcaList<OcaFloat32> minSlope
OcaList<OcaFloat32> maxSlope
failure_callback on_failure
: A callback which is called on error.
SetSlopes#
void SetSlopes(OcaList<OcaFloat32> slope, auto on_result, failure_callback on_failure)
Calls the method SetSlopes in the remote device. If no result and error callback is specified, the method will be called without requesting a response.
Parameters:#
OcaList<OcaFloat32> slope
auto on_result
: A callable (e.g. a lambda) with 0 arguments.failure_callback on_failure
: A callback which is called on error.
GetKneeParameters#
void GetKneeParameters(auto on_result, failure_callback on_failure)
Calls the method GetKneeParameters in the remote device.
Parameters:#
auto on_result
: A callable (e.g. a lambda) with the following arguments:OcaList<OcaFloat32> Parameters
OcaList<OcaFloat32> minParameter
OcaList<OcaFloat32> maxParameter
failure_callback on_failure
: A callback which is called on error.
SetKneeParameters#
void SetKneeParameters(OcaList<OcaFloat32> Parameters, auto on_result, failure_callback on_failure)
Calls the method SetKneeParameters in the remote device. If no result and error callback is specified, the method will be called without requesting a response.
Parameters:#
OcaList<OcaFloat32> Parameters
auto on_result
: A callable (e.g. a lambda) with 0 arguments.failure_callback on_failure
: A callback which is called on error.
GetDynamicGainCeiling#
void GetDynamicGainCeiling(auto on_result, failure_callback on_failure)
Calls the method GetDynamicGainCeiling in the remote device.
Parameters:#
auto on_result
: A callable (e.g. a lambda) with the following arguments:OcaDB Gain
OcaDB minGain
OcaDB maxGain
failure_callback on_failure
: A callback which is called on error.
SetDynamicGainCeiling#
void SetDynamicGainCeiling(OcaDB gain, auto on_result, failure_callback on_failure)
Calls the method SetDynamicGainCeiling in the remote device. If no result and error callback is specified, the method will be called without requesting a response.
Parameters:#
OcaDB gain
auto on_result
: A callable (e.g. a lambda) with 0 arguments.failure_callback on_failure
: A callback which is called on error.
GetDynamicGainFloor#
void GetDynamicGainFloor(auto on_result, failure_callback on_failure)
Calls the method GetDynamicGainFloor in the remote device.
Parameters:#
auto on_result
: A callable (e.g. a lambda) with the following arguments:OcaDB Gain
OcaDB minGain
OcaDB maxGain
failure_callback on_failure
: A callback which is called on error.
SetDynamicGainFloor#
void SetDynamicGainFloor(OcaDB Gain, auto on_result, failure_callback on_failure)
Calls the method SetDynamicGainFloor in the remote device. If no result and error callback is specified, the method will be called without requesting a response.
Parameters:#
OcaDB Gain
auto on_result
: A callable (e.g. a lambda) with 0 arguments.failure_callback on_failure
: A callback which is called on error.
SetMultiple#
void SetMultiple(OcaParameterMask Mask, OcaUint8 NSegments, OcaList<OcaDBr> Thresholds, OcaList<OcaFloat32> Slope, OcaList<OcaFloat32> KneeParameter, OcaDB DynamicGainFloor, OcaDB DynamicGainCeiling, auto on_result, failure_callback on_failure)
Calls the method SetMultiple in the remote device. If no result and error callback is specified, the method will be called without requesting a response.
Parameters:#
OcaParameterMask Mask
OcaUint8 NSegments
OcaList<OcaDBr> Thresholds
OcaList<OcaFloat32> Slope
OcaList<OcaFloat32> KneeParameter
OcaDB DynamicGainFloor
OcaDB DynamicGainCeiling
auto on_result
: A callable (e.g. a lambda) with 0 arguments.failure_callback on_failure
: A callback which is called on error.
GetThresholds#
void GetThresholds(auto on_result, failure_callback on_failure)
Calls the method GetThresholds in the remote device.
Parameters:#
auto on_result
: A callable (e.g. a lambda) with the following arguments:OcaList<OcaDBr> Thresholds
OcaDBz minThreshold
OcaDBz maxThreshold
failure_callback on_failure
: A callback which is called on error.
observenSegments#
subscription observenSegments(auto callback, failure_callback on_failure)
Fetches the remote property nSegments and subscribes for modifications. The callback is called with the initial values of nSegments and whenever it changes.
Parameters:#
auto callback
: A callable (e.g. a lambda) with one argument:OcaUint8 nSegments
failure_callback on_failure
: A callback which is called on error.
observeThresholds#
subscription observeThresholds(auto callback, failure_callback on_failure)
Fetches the remote property Thresholds and subscribes for modifications. The callback is called with the initial values of Thresholds and whenever it changes.
Parameters:#
auto callback
: A callable (e.g. a lambda) with one argument:OcaList<OcaDBr> Thresholds
failure_callback on_failure
: A callback which is called on error.
observeSlopes#
subscription observeSlopes(auto callback, failure_callback on_failure)
Fetches the remote property Slopes and subscribes for modifications. The callback is called with the initial values of Slopes and whenever it changes.
Parameters:#
auto callback
: A callable (e.g. a lambda) with one argument:OcaList<OcaFloat32> Slopes
failure_callback on_failure
: A callback which is called on error.
observeKneeParameters#
subscription observeKneeParameters(auto callback, failure_callback on_failure)
Fetches the remote property KneeParameters and subscribes for modifications. The callback is called with the initial values of KneeParameters and whenever it changes.
Parameters:#
auto callback
: A callable (e.g. a lambda) with one argument:OcaList<OcaFloat32> KneeParameters
failure_callback on_failure
: A callback which is called on error.
observeDynamicGainFloor#
subscription observeDynamicGainFloor(auto callback, failure_callback on_failure)
Fetches the remote property DynamicGainFloor and subscribes for modifications. The callback is called with the initial values of DynamicGainFloor and whenever it changes.
Parameters:#
auto callback
: A callable (e.g. a lambda) with one argument:OcaDB DynamicGainFloor
failure_callback on_failure
: A callback which is called on error.
observeDynamicGainCeiling#
subscription observeDynamicGainCeiling(auto callback, failure_callback on_failure)
Fetches the remote property DynamicGainCeiling and subscribes for modifications. The callback is called with the initial values of DynamicGainCeiling and whenever it changes.
Parameters:#
auto callback
: A callable (e.g. a lambda) with one argument:OcaDB DynamicGainCeiling
failure_callback on_failure
: A callback which is called on error.
OnnSegmentsChanged#
subscription OnnSegmentsChanged(auto callback, failure_callback on_failure)
Parameters#
auto callback
: A callable (e.g. a lambda) with one argument:OcaUint8 nSegments
failure_callback on_failure
: A callback which is called on error.
OnThresholdsChanged#
subscription OnThresholdsChanged(auto callback, failure_callback on_failure)
Parameters#
auto callback
: A callable (e.g. a lambda) with one argument:OcaList<OcaDBr> Thresholds
failure_callback on_failure
: A callback which is called on error.
OnSlopesChanged#
subscription OnSlopesChanged(auto callback, failure_callback on_failure)
Parameters#
auto callback
: A callable (e.g. a lambda) with one argument:OcaList<OcaFloat32> Slopes
failure_callback on_failure
: A callback which is called on error.
OnKneeParametersChanged#
subscription OnKneeParametersChanged(auto callback, failure_callback on_failure)
Parameters#
auto callback
: A callable (e.g. a lambda) with one argument:OcaList<OcaFloat32> KneeParameters
failure_callback on_failure
: A callback which is called on error.
OnDynamicGainFloorChanged#
subscription OnDynamicGainFloorChanged(auto callback, failure_callback on_failure)
Parameters#
auto callback
: A callable (e.g. a lambda) with one argument:OcaDB DynamicGainFloor
failure_callback on_failure
: A callback which is called on error.
OnDynamicGainCeilingChanged#
subscription OnDynamicGainCeilingChanged(auto callback, failure_callback on_failure)
Parameters#
auto callback
: A callable (e.g. a lambda) with one argument:OcaDB DynamicGainCeiling
failure_callback on_failure
: A callback which is called on error.