AAX SDK  2.1.1
Avid Audio Extensions Development Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sidechain Inputs

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)
[...]
};

Describe:

// ***************************************************************************
// ROUTINE: DescribeAlgorithmComponent
// Algorithm component description
// ***************************************************************************
static void DescribeAlgorithmComponent( AAX_IComponentDescriptor * outDesc )
{
[...]
err = outDesc.AddSideChainIn(eDemoDist_AlgFieldID_SideChain);
[...]
[...]
}
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;
[...]
}
Collaboration diagram for Sidechain Inputs: