
Additional Variable Configuration
Additional configuration variables are optional parameters that are needed if a specific object/algorithm needs configuration parameters beyond the default ones. Objects by default have configuration for (as mentioned above):
An object can chose to utilize all the default variables or not. However if the object needs more configuration variables, that’s where additional variables come in. A good example is parameter biquad audio object:
However, the parameter biquad object also allows the user to select the filter topology and whether ramping is needed or not. Those two are represented with additional variables. These are fully customizable by the objects.
Adding Additional Variables to Audio Object
The object needs to inform the toolbox regarding the number of additional variables it needs. This is already described above as part of the object description. Besides the number of additional variables, the object needs to have a description of each additional variable. The audio object developer can provide the following:
Besides the number of additional variables, the object needs to have a description of each additional variable. The audio object developer can provide the following:
String data type is not supported, as it will add additional bytes to the flash memory. Strings are used only in GTT and not required on target.
Starting in R release – the sizes of a dynamic additional variable (NOT the count of variables, the size of each variable) can change based on user inputs.
To enable this functionality, make sure to see the static metadata page. You must set the static metadata parameter isAddVarUpdateRequired
to true.
Here are the restrictions and features:
Below is an example of an object that has four additional variables.
The example can be referred to here
An example of the result in the SFD is shown below, with the configuration of additional variable 1:
Audio Object description file for tuning and control
Once a signal flow design is complete, SFD calls the following three Audio Object API functions, getXmlSVTemplate(), getXmlObjectTemplate(), and getXmlFileInfo(), to generate XML that describes the parameter memory layout for tuning purposes and state memory layout for control and debug purposes. This data depends on the object configuration designed in the signal flow.
These functions are enabled only when generating the XML file on a PC. The getXmlSVTemplate() function is called once and used for state variable templates, a single parameter, or control value. This state variable template can be reused in the object template or even the device description. The getXmlObjectTemplate() creates an object template that can be reused in another object template or in the device description. The getXmlFileInfo() uses the block ID assigned by the SFD and the HiQnet address of an object. HiQnet ID of the StateVariable must be unique in an object – even across hierarchical levels.
This data describes the parameter memory layout for tuning purposes and state memory layout for control purposes:
unsigned int CAudioObjectToolbox::getXmlSVTemplate(tTuningInfo* info, char* buffer, unsigned int maxLen){}
unsigned int CAudioObjectToolbox::getXmlObjectTemplate(tTuningInfo* info, char* buffer, unsigned int maxLen){}
unsigned int CAudioObjectToolbox::getXmlFileInfo(tTuningInfo* info, char* buffer, unsigned int maxLen){}
This data must precisely describe the memory layout of the object. Here are some general guidelines:
To ease the generation of this data, the xAF has created XML helper functions. These functions can be used when writing getXmlSVTemplate(), getXmlObjectTemplate() functions.
The helper function is shown below for an example where getXmlSVTemplate() for a Delay object is written using writeSvTemplate():
For more xml helper functions:
For more information and details, please check the Device Description File specification guide.
Examples of the XML function that needs to be written is shown inAudio Object Example section.