Overview
Linear multichannel smoothly varying scaler with control pin
Discussion
Scales all input channels by the gain values taken from the first input pin. Changes to the gain parameter are exponentially smoothed (first order IIR) by the smoothingTime parameter on the block basis. Internally, currentGain represents the instantaneous smoothed gain that is applied. The module starts with a current gain equal to 0 and then slews towards the gain specified on the control input. The module supports multiple input and output pins and the number of pins is specified by the second argument NUMPINS. By default, NUMPINS = 1. All audio inputs and outputs are in fract32 format. The processing function is implemented using a fractional multiply by the smoothed gain followed by a fixed bit right-shift at the end.
...
The control input can have any block size and any number of channels. The module uses the first sample value of the control pin at the target gain; all other values are ignored.
Type Definition
Code Block |
---|
typedef struct _ModuleScalerControlBlockSmoothedFract32 { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure FLOAT32 smoothingTime; // Time constant of the smoothing process INT32 dataType; // Specifies data type at input control pin (0=Q9.31, 1=float) fract32 currentGain; // Instantaneous gain applied by the module. This is also the starting gain of the module. fract32 smoothingCoeff; // Smoothing coefficient } ModuleScalerControlBlockSmoothedFract32Class; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
smoothingTime | float | parameter | 0 | 10 | 0:1000 | msec |
dataType | int | const | 0 | 0 | Unrestricted | |
currentGain | fract32 | state | 1 | 0 | Unrestricted | linear |
smoothingCoeff | fract32 | derived | 1 | 0.002081 | Unrestricted |
Pins
Input Pins
Name: g
Description: gain input
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out1
Description: audio output
Data type: fract32
MATLAB Usage
File Name: scaler_control_block_smoothed_fract32_module.m
...