Overview
Surround plugins process multi-channel audio formats beyond stereo. Common formats include:- 5.1 - 6 channels (L, R, C, LFE, Ls, Rs)
- 7.1 - 8 channels (L, R, C, LFE, Ls, Rs, Lrs, Rrs)
- 7.1.2 - 10 channels (7.1 + height pair)
- 7.1.4 - 12 channels (7.1 + 4 height channels) [Atmos]
IPlugSurroundEffect Template
TheIPlugSurroundEffect example demonstrates:
- Multiple channel configurations (1, 2, 6, 8, 10, 12 channels)
- Platform-specific speaker arrangements
- 12-channel metering
- Custom bus type handling for VST3/AU/AAX
Channel Configuration
config.h
Supported Configurations:
1-1= Mono2-2= Stereo6-6= 5.1 surround8-8= 7.1 surround10-10= 7.1.2 (Atmos bed)12-12= 7.1.4 (Atmos full)
Basic Structure
- Header
- Processing
- Bus Types
IPlugSurroundEffect.h
Creating a Surround Plugin
cd iPlug2/Examples
python duplicate.py IPlugSurroundEffect MySurroundReverb MyCompany
cd MySurroundReverb
// Support stereo and surround formats
#define PLUG_CHANNEL_IO "2-2 6-6 8-8"
// Or support everything including Atmos:
// #define PLUG_CHANNEL_IO "1-1 2-2 6-6 8-8 10-10 12-12"
#define VST3_SUBCATEGORY "Fx|Spatial"
#define AAX_PLUG_CATEGORY_STR "SoundField"
Copy the
GetAPIBusTypeForChannelIOConfig function from IPlugSurroundEffect to map channel counts to platform formats.void MySurroundReverb::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
{
const int nChans = NOutChansConnected();
// Detect current format
switch (nChans) {
case 1: // Mono
ProcessMono(inputs, outputs, nFrames);
break;
case 2: // Stereo
ProcessStereo(inputs, outputs, nFrames);
break;
case 6: // 5.1
Process51(inputs, outputs, nFrames);
break;
case 8: // 7.1
Process71(inputs, outputs, nFrames);
break;
case 10: // 7.1.2
Process712(inputs, outputs, nFrames);
break;
case 12: // 7.1.4 (Atmos)
Process714(inputs, outputs, nFrames);
break;
}
}
mLayoutFunc = [&](IGraphics* pGraphics) {
pGraphics->AttachPanelBackground(COLOR_GRAY);
const IRECT bounds = pGraphics->GetBounds().GetPadded(-10);
const IRECT meterArea = bounds.GetPadded(-50);
const IVStyle meterStyle = DEFAULT_STYLE.WithColor(kFG, COLOR_WHITE.WithOpacity(0.3f));
// Input meters (12 channels max)
pGraphics->AttachControl(
new IVPeakAvgMeterControl<12>(
meterArea.FracRectVertical(0.5, true),
"Inputs",
meterStyle,
EDirection::Vertical,
{"L", "R", "C", "LFE", "Ls", "Rs", "Lrs", "Rrs", "Ltf", "Rtf", "Ltr", "Rtr"}),
kCtrlTagInputMeter);
// Output meters
pGraphics->AttachControl(
new IVPeakAvgMeterControl<12>(
meterArea.FracRectVertical(0.5, false),
"Outputs",
meterStyle,
EDirection::Vertical,
{"L", "R", "C", "LFE", "Ls", "Rs", "Lrs", "Rrs", "Ltf", "Rtf", "Ltr", "Rtr"}),
kCtrlTagOutputMeter);
};
Channel Order
Standard Speaker Layouts
- 5.1 (6 channels)
- 7.1 (8 channels)
- 7.1.4 (12 channels)
Processing Examples
5.1 Surround Reverb
Upmixing Stereo to 5.1
Spatial Panner
LFE Channel
LFE Handling:
- LFE is typically at index 3
- Low-pass filter below 120 Hz
- Don’t apply reverb or spatial effects
- Some hosts expect +10dB gain compensation
Atmos Height Channels
For 7.1.2 and 7.1.4 formats:Testing
Testing Surround:
- Use a DAW with surround support (Pro Tools, Nuendo, Logic)
- Create a surround session (5.1, 7.1, etc.)
- Insert plugin on surround track
- Verify correct channel mapping with tone generators
- Test channel meters show correct activity
- Check LFE handling (some hosts are picky)
Test Signals
Next Steps
Channel Routing
Advanced channel configuration options
Spatial Audio
Ambisonics and 3D audio processing
Metering
Multi-channel meters and analysis
Testing
Validate surround plugins in DAWs