|
ASX Version4.20.14
|
These functions support reading peak meter information. More...
Functions | |
| ASX32_API ASX_ERROR | ASX_Meter_GetChannels (ASX_HANDLE hMeter, int *pnChannels) |
| Returns the number of channels this peak meter has. | |
| ASX32_API ASX_ERROR | ASX_Meter_GetPeak (ASX_HANDLE hMeter, float *fdB, const int nChannels) |
| Returns the peak meter reading for the given meter control. | |
| ASX32_API ASX_ERROR | ASX_Meter_GetRMS (ASX_HANDLE hMeter, float *fdB, const int nChannels) |
| Returns the RMS meter reading for the given meter control. | |
| ASX32_API ASX_ERROR | ASX_Meter_SetBallistics (ASX_HANDLE hMeter, const enum asxMETER_TYPE nMeterType, const float fAttackTimeMs, const float fDecayTimeMs) |
| Set the meter ballistics. | |
| ASX32_API ASX_ERROR | ASX_Meter_GetBallistics (ASX_HANDLE hMeter, const enum asxMETER_TYPE nMeterType, float *fAttackTimeMs, float *fDecayTimeMs) |
| Get meter ballistics. | |
These functions support reading peak meter information.
| ASX32_API ASX_ERROR ASX_Meter_GetBallistics | ( | ASX_HANDLE | hMeter, |
| const enum asxMETER_TYPE | nMeterType, | ||
| float * | fAttackTimeMs, | ||
| float * | fDecayTimeMs | ||
| ) |
Get meter ballistics.
| hMeter | A handle to an ASX meter object. |
| nMeterType | Which meter part to get ballistics settings from. See asxMETER_TYPE. |
| fAttackTimeMs | The attack time in milliseconds. |
| fDecayTimeMs | The decay time in milliseconds. |
| ASX32_API ASX_ERROR ASX_Meter_GetChannels | ( | ASX_HANDLE | hMeter, |
| int * | pnChannels | ||
| ) |
Returns the number of channels this peak meter has.
| hMeter | A handle to an ASX meter object. |
| pnChannels | The returned number of channels. |
| ASX32_API ASX_ERROR ASX_Meter_GetPeak | ( | ASX_HANDLE | hMeter, |
| float * | fdB, | ||
| const int | nChannels | ||
| ) |
Returns the peak meter reading for the given meter control.
Some adapters (ASI6000,ASI5000) implement meter controls with ballistics. This means that instead of following the signal instantaneously, meters values have finite attack and decay time constants Ta and Td. For instance when the input is removed, the meter value will decay towards zero (whether or not the meter control is read). It will decay to 37% of its original value in Td seconds. (14% @ 2xTd, 5% @ 3xTd etc)
If meter ballistics are not implemented, when the ASX_Meter_GetPeak function is called the meter statistic for that control will be reset to zero. This means that the period over which the statistic is computed depends on the time between calls to ASX_Meter_GetPeak(). If the call is made 100 times a second, then the value returned would reperesent the peak during a 10ms interval of audio.
The lower limit of meter return value, depends on the adapter series. For all ASI4000 adapters, the minimum value returned is -100dB. For ASI6000,ASI5000 adapters, the minimum value returned is -192dB.
| hMeter | A handle to an ASX meter object. |
| fdB | A pointer to receive the peak meter reading in dB. The range of this reading it 0.0 to -120.0 dB. |
| nChannels | The number of channels. This should match the number of elements in the fGetDb array. |
| ASX32_API ASX_ERROR ASX_Meter_GetRMS | ( | ASX_HANDLE | hMeter, |
| float * | fdB, | ||
| const int | nChannels | ||
| ) |
Returns the RMS meter reading for the given meter control.
The peak is stereo and the units are in decibels relative to full-scale digital (dbFs). The RMS measurement depends on the waveform shape. For example, playing a fullscale sinewave (with an amplitude of +/-32767 for a 16bit PCM format) will return a RMS reading of -3dB (compared with a Peak meter reading of 0dBFs), while playing a square wave will return a RMS reading of 0dB and playing an impulsive signal like solo drums will return an RMS value much lower than the peak value.
If this meter has ballistics, then Ta=Td=150ms, which simulates the ballistics of a VU meter.
| hMeter | A handle to an ASX meter object. |
| fdB | A pointer to receive the RMS meter reading in dB. The range of this reading it 0.0 to -120.0 dB. |
| nChannels | The number of channels. This should match the number of elements in the fGetDb array. |
| ASX32_API ASX_ERROR ASX_Meter_SetBallistics | ( | ASX_HANDLE | hMeter, |
| const enum asxMETER_TYPE | nMeterType, | ||
| const float | fAttackTimeMs, | ||
| const float | fDecayTimeMs | ||
| ) |
Set the meter ballistics.
The attack and decay values represent the time constants of the equivalent single pole low pass filter used to create the ballistics. With a time constant of T, if the meter is stable at full scale and the input is suddenly removed, the meter will decay. Similarly, if the meter is at zero and a full scale input is applied will move to the new reading at a rate specified by the attack time constant.
Driver versions up to and including version 4.04.xx implement a single global ballistics setting for all meters, i.e. if you change the ballistics on one meter, the ballistics on all meters are updated. Driver versions in the 4.05.xx series and later implement independent ballistics for each meter.
The following table shows the percentage of the final meter value over time, when a constant input is suddenly removed (decay) or applied (attack):
|
Time |
Meter decay |
Meter attack |
| 0 | 100% | 0% |
| T | 37% | 63% |
| 2T | 14% | 86% |
| 3T | 5% | 95% |
| 4T | 2% | 98% |
| 5T | 0.7% | 99% |
Table 2.1: Attack and decay compared to time.
The table was calculated using the following formulas:
decay = intial * e -t/T
and:
attack = initial * ( 1 - e -t/T )
| hMeter | A handle to an ASX meter object. |
| nMeterType | The meter type to set the balistics of. See asxMETER_TYPE. |
| fAttackTimeMs | The attack time in milliseconds. |
| fDecayTimeMs | The decay time in milliseconds. |
1.7.3