Master Preset Control Module Configuration

The purpose of this module is to facilitate configuring presets for the entire device containing multiple cores/instances of xAF. Refer to the xAF Specification for more details.

Master Preset Control Design

User can prepare the presets for each signal flow using GTT. Once the presets are prepared, user should prepare slot map which gives information on presets to be recalled for a particular slot. Refer GTT user guide for creating slot map and presets. Each slot can also be configured with fade in, fade out times using which platform can choose to apply Instance mute/unmute while applying a new slot.

Saving the master preset control map file and presets on the target device

Presets and slot map should be prepared and saved using Global Tuning Tool. Saving them on to the device is currently an offline process. Platform has to supply slot map during initialization of Master preset control Module and saved presets should be accessible by the particular cores where presets are recalled.

Presets can also be saved on the device using the procedure saving/loading seti files (more in section “Tuning Sets (SETi) implemented”).

Instantiating the Master Preset Control Module with slot map stored on the device

To instantiate Master Preset Control Module, platform has to load the slot map prepared/saved from Global Tuning Tool. Platform can use the DeviceParser class, which is included in the interface library to parse the slot map. Below is a brief example on how to load the slot map.

Once m_presetCtrlMap is populated with parsed slot map, it can be used to instantiate the master preset control module as shown below.

xAF_Error err = xAFInitMasterPresetControl(&g_masterPresetControl, m_presetCtrlMap, &allocateMem);

After successful instantiation of the master preset control, the default slot gets loaded into the instance(s).

Loading A New Slot

Master preset control module loads default slot during reboot. To load a different slot at runtime, the xTP command 0x64 with function Id 0x02 needs to be sent to the amplifier. Refer to the xTP specification for details on 0x64 command.

This command supports two operations:

  • “Get Active Slot ” via operation Id “0x02”

This command retrieves the currently active slot on the device. Platform can call xAFSetActiveSlot() to get Active slot

  • “Load Slot ” via operation Id “0x03”.

Load slot command loads the preset as per device id and slot id given in the command.

To load the new slot following steps needs to be performed:

Detail about the APIs used to load a new slot is as below:

  • Call xAFGetRampTimes(xAFMasterPresetControl* masterPresetControl, float* fadeInTime, float* fadeOutTime, unsigned int slotId) to get the fade in or fade out time
  • Call xAFGetNumPreset(xAFMasterPresetControl* masterPresetControl, unsigned int* numPreset, unsigned int slotId) to get the number of presets for a particular slot
  • Call xAFLoadSlot(xAFMasterPresetControl* masterPresetControl, xAFPreset* presets, unsigned int slotId) API to get a list of presets (contains preset id, core id and instance id) for a particular slot
  • Call the following framework APIs  setInstanceMuteRampUpTime(float val), setInstanceMuteRampDownTime(float val) to set the ramp times for performing instance mute operation

A new slot is applied in steps of instance mute/unmute cycle as follows:

  • Call setInstanceMuteState(int val) API to initiate the instance mute. The response xTP command is sent back as the instance mute is in progress (0x01)
  • Platform is responsible for polling the status of instance Mute by calling framework function getInstanceMuteRampingState()
  • Once Mute is completed platform can apply the preset file using framework API loadSETIDataFromInterface(IOBase* IOInterface)
  • Call setInstanceMuteState(int val) to unmute amplifier
  • Once un-mute is completed slot is completed and a second response is sent back to
  • GTT for indicating a successful load(0x00)

Example Implementation

In INXS-Release, you can find a reference implementation on the xAF repo in the VirtualAmpEffect file at the following location:

https://bitbucket.harman.com/projects/LSACCA/repos/extendable-audio-framework/browse/private/utils/xAFVirtualAmp/VirtualAmpEffect.cpp?at=refs%2Fheads%2Fmaster

https://bitbucket.harman.com/projects/LSACCA/repos/extendable-audio-framework/browse/private/src/framework/core/MasterControl.c?at=refs%2Fheads%2Fmaster

_________________

Rate this post!