| AAX SDK 2.6.1 Avid Audio Extensions Development Kit

- Welcome
- Manual
- Classes
- Files
- Lists
- Support

Loading...
Searching...
No Matches
Sidechain Inputs
AAX SDK Manual » Additional AAX features

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)
[...]
};
AAX_FIELD_INDEX
#define AAX_FIELD_INDEX(aContextType, aMember)
Compute the index used to address a context field.
Definition: AAX.h:320

Describe:

// ***************************************************************************
// ROUTINE: DescribeAlgorithmComponent
// Algorithm component description
// ***************************************************************************
static void DescribeAlgorithmComponent( AAX_IComponentDescriptor * outDesc )
{
AAX_Result err = AAX_SUCCESS;
[...]
err = outDesc.AddSideChainIn(eDemoDist_AlgFieldID_SideChain);
[...]
properties->AddProperty ( AAX_eProperty_SupportsSideChainInput, true );
[...]
}
AAX_SUCCESS
@ AAX_SUCCESS
Definition: AAX_Errors.h:36
AAX_Result
int32_t AAX_Result
Definition: AAX.h:334
AAX_eProperty_SupportsSideChainInput
@ AAX_eProperty_SupportsSideChainInput
Tells the host that the plug-in supports side chain inputs.
Definition: AAX_Properties.h:626
AAX_IComponentDescriptor
Description interface for an AAX plug-in component.
Definition: AAX_IComponentDescriptor.h:44
AAX_IComponentDescriptor::AddSideChainIn
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
AAX_CALLBACK
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;
[...]
}
AAX_CALLBACK
#define AAX_CALLBACK
Definition: AAX.h:282
Collaboration diagram for Sidechain Inputs: