This functionality alerts an object when its parameter memory is updated or modified. It provides information on the exact variables that were modified and allows the object to update internal variables accordingly. An example is in a filter block, where a parameter update (for example a gain/frequency/q change) triggers the recalculation of the filter coefficients in the tuning code. The API triggered is CAudioObject::tuneXTP().
void CAudioObject::tuneXTP(int subblock, int startMemBytes, int sizeBytes, xBool shouldAttemptRamp)
{
}
An ID-based memory addressing scheme is used instead of pure memory offsets. The CAudioObject→tuneXTP() method is called by the framework in CAudioProcessing→setAudioObjectTuning().
CAudioObject::tuneXTP() take in three integers representing the:
The subblock, startAdr and size are passed into the audio object to enable the calculation of the elements it needs to tune.
The code MUST be written in a manner that allows the tuning of any variable even if the corresponding sub-block is not provided. For example, an object with 2 sub-blocks with 4 variables within each sub-block, the algorithm should be able to support tuning the 5th variable with both commands: tuneXTP(0, 5, 1) AND tuneXTP(1,0,1).
Implementation
Once triggered, the function’s implementation is heavily dependent on the audio object itself and on the corresponding tuning panel (or Device Description/ memory layout) that the tuning tool will use to tune the audio object.
The developer needs to take into consideration the following while designing an object:
For example, if a parameter biquad block is being tuned, the index or sub-block ID passed in by the CAudioProcessing class could determine:
The xAF team has implemented the Parameter biquad block with the sub-block definition referring to a channel in the biquad block rather than one specific filter. The xAF also uses memory offset and sub-block to recalculate as few filter coefficients as possible.
Examples of what the tuning methods of each individual Audio Object trigger are listed below:
| Audio Object | Description |
| Delay | Sets the delay time in milliseconds. Each channel may have different delay and update buffers. |
| Gain | Sets the gain of each channel. |
| Parameter Biquad | Sets the type, frequency, gain, quality of a filter and recalculate filter coefficients for all filters in a channel. |
| Limiter | Sets the limit gain, threshold, attach time, release time, hold time and hold threshold. |
| LevelMonitor | Sets the frequency and time weighting of level meter. |