AAX SDK  2.4.1
Avid Audio Extensions Development Kit

Routing custom audio streams to a plug-in.

Overview of Sidechain Inputs

If applicable, plug-ins may choose to enable sidechain inputs. If a sidechain is enabled, a menu is added to the plug-in's header that allows the user to choose an interface or bus as the sidechain, or "key input". Once enabled, the plug-in will be able to access sidechain input just like any other input signal. Currently, DAE is limited to mono sidechain inputs.

Adding a Sidechain Input to an Effect

Setting up a sidechain input is fairly straight forward. You will want to add a physical address within your context structure, and then "describe" the sidechain in Describe.

Context Structure:

//=============================
// Component context definitions
//=============================
// Context structure
struct SMyPlugIn_Alg_Context
{
[...]
int32_t * mSideChainP;
[...]
};
// Physical addresses within the context
enum EDemoDist_Alg_PortID
{
[...]
,MyPlugIn_AlgFieldID_SideChain = AAX_FIELD_INDEX (SDemoDist_Alg_Context, mSideChainP)
[...]
};
#define AAX_FIELD_INDEX(aContextType, aMember)
Compute the index used to address a context field.
Definition: AAX.h:323

Describe:

// ***************************************************************************
// ROUTINE: DescribeAlgorithmComponent
// Algorithm component description
// ***************************************************************************
static void DescribeAlgorithmComponent( AAX_IComponentDescriptor * outDesc )
{
[...]
err = outDesc.AddSideChainIn(eDemoDist_AlgFieldID_SideChain);
[...]
properties->AddProperty ( AAX_eProperty_SupportsSideChainInput, true );
[...]
}
int32_t AAX_Result
Definition: AAX.h:337
@ AAX_SUCCESS
Definition: AAX_Errors.h:39
@ AAX_eProperty_SupportsSideChainInput
Tells the host that the plug-in supports side chain inputs.
Definition: AAX_Properties.h:621
Description interface for an AAX plug-in component.
Definition: AAX_IComponentDescriptor.h:47
virtual AAX_Result AddSideChainIn(AAX_CFieldIndex inFieldIndex)=0
Subscribes a side-chain input context field.
Todo:
Is properties->AddProperty ( AAX_eProperty_SupportsSideChainInput, true ) even necessary?!?! I believe I saw a p.i. that does not declare this...

In order to tell whether there is sidechain information available to your plug-in, check for a null pointer within your algorithm's process function. The sidechain channel will show up as an additional stem from the original stem format you declare. That is to stay, for a stereo plug-in, the sidechain channel will be the third channel passed in.

//==============================================================================
// Processing function definition
//==============================================================================
void
MyPlugIn_AlgorithmProcessFunction (
SMyPlugIn_Alg_Context * const inInstancesBegin [],
const void * inInstancesEnd)
{
[...]
int32_t sideChainChannel = *instance->mSideChainP;
float * AAX_RESTRICT sideChainInput = 0;
if ( sideChainChannel )
sideChainInput = instance->mInputPP [sideChain]Channel;
[...]
}
#define AAX_CALLBACK
Definition: AAX.h:285
Collaboration diagram for Sidechain Inputs: