No Matches
Adding more Channel I/O Formats

When you create a new ASPiK project, it will automatically declare these channel I/O combinations for you in the PluginCore constructor.

• Mono input to mono output (1 -> 1)
• Mono input to stereo output (1 -> 2)
• Stereo input to stereo output (2 -> 2)

The processAudioFrame function is already set up to decode these three I/O configurations as well. Adding more configurations is very easy and you can also add your own configuration definitions.

AU, AAX and VST all support different types of multi-channel operation that is beyond simple stereo. However, there are variations within each API, and there are some formats that are not supported in every API. So, if you decide you want to write a plugin for a multi-channel Ambisonics format you will likely not be able to write it for all APIs. For example, AU does not support channel I/O greater than 10 inputs and 10 outputs. On the other hand, VST3 supports up to 22.1 channel plugins, including variations for both Sony and DTS surround sound, while AAX supports Sony, DTS and most of the obscure Ambisonics formats. The first thing you need to decide is how many formats to support. Then, you need to describe each supported combination. If you support a side-chain input, you will need to describe the channel combinations your plugin will support (though there are some limitations on side-chains that are API-specific). This is best explained with the sample code, so go back to the PluginCore constructor. There are two base class functions that will make setting up your supported channels a simple operation. You just call the functions to add your supported combinations. The functions are:

addSupportedIOCombination( )
addSupportedAuxIOCombination( )

The channel configurations consist of a simple array that stores an input and output channel configuration pair. Enumerations for each type of channel configuration are found in the pluginstructures.h file.

<strong>enum channelFormat</strong><br>
etc . . .
Use this enum to identify plugin channel formats. Steinberg calls these "speaker arrangements".
Definition: pluginstructures.h:115

You define a channel I/O configuration as an array pair using the enumerations above, and past this value to the helper functions. For ASPiK projects, this is pre-coded for you as:

// --- for FX plugins
if(getPluginType() == kFXPlugin)
addSupportedIOCombination({kCFMono, kCFMono});
addSupportedIOCombination({kCFMono, kCFStereo});
a ddSupportedIOCombination({kCFStereo, kCFStereo});

Besides mono and stereo, the most popular multi-channel format might be 5.1, which is encoded as kCF5p1 above. To add support for 5.1 plugins, you would add the following to the above if() statement:

addSupportedIOCombination({kCF5p1, kCF5p1});

For a 5.1-to-stereo fold-down plugin, you would write:

addSupportedIOCombination({kCF5p1, kCFStereo});

You can also see that there are both Sony and DTS versions of higher channel-count formats. After describing your plugin's normal input/output channel configurations, you do the same for the side-chain using the aux IO variables. If you enable the side chain during the ASPiK CMake setup, then this code is written for you.

// --- for sidechaining, we support mono and stereo inputs; <br>
addSupportedAuxIOCombination({kCFMono, kCFNone});
addSupportedAuxIOCombination({kCFStereo, kCFNone});