Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page walks through a complete example of an audio module, starting from the high-level MATLAB model and continuing through the generated code. This example is identical to the scaler_smoothed_module.m contained in the Deprecated module library. We go through this module in a systematic fashion and reference the source files listed in Scaler Smoothed Example Source Files. (8.D.2.4) Examples Module Library contains additional module examples which highlight advanced features.

...

All of these items above are documented in the Audio Weaver Matlab API. The specific items in the module m-file pertaining to module generation are variables, code markers, and wiring allocation guidelines described in (8.D.2.4) Generating Module Libraries (in particular, the sections Specifying Wiring Constraints and Code Markers and Template Substitution).

...

The header file also contains a few other items. First, there is a bit mask for each variable in the data structure. The mask corresponds to the position of the variable within the instance structure. Note that the module header is 8 words long and thus the first bit starts in the 9th bit position. This leaves 24 bits to select individual variables or arrays. If you have more than 24 parameters that need adjusting, you will need to store at least some of them in arrays.

These bit masks can be used by the _Set() and _Get() functions to determine which variable within the instance structure has been modified.

...

Audio Weaver uses template substitution to generate audio module source and header files. The template files are shown as item 2 in https://dspconcepts.atlassian.net/wiki/spaces/DOCHUB/pages/2748822128/Module+Development+Overview#OverallEnvironment3068985912/8.D.2.4%2BModule%2BDevelopment%2BOverview#OverallEnvironment and two files are used:

  • <AWE>\matlab\module_generation\templates\awe_module_template.c

  • <AWE>\matlab\module_generation\templates\awe_module_template.h

...

with the build configuration set to x86 Release. The solution builds the DLL and then copies it into the directory <AWE>\Bin\win32-vc142-rel so that it can be referenced by the Server. Further details on this step can be found in https://dspconcepts.atlassian.net/wiki/spaces/DOCHUB/pages/2748822407/Building+Audio+Module+DLLs#BuildingExamplesDLL3069018678/8.D.2.4%2BBuilding%2BAudio%2BModule%2BDLLs#BuildingExamplesDLL.dll.

Summary of Steps Involved in Writing an Audio Module

...