Hi everyone,
I’m developing a custom plugin (AY chip emulator) that needs to output 5 channels when in
“separate mode” - stereo L/R plus three individual chip channels (A, B, C) for visualization
purposes.
The Issue
I implemented getNumOutputChannelsGivenInputs() to return 5 channels and verified it’s being
called correctly. However, the plugin was only receiving a 2-channel buffer, even though my override was returning 5.
Root Cause
I traced through the Tracktion Engine source and found this in tracktion_EditNodeBuilder.cpp
(around line 1225):
// If this plugin is on a track or clip and doesn't have a sidechain input we can limit the number of channels it uses
if (plugin.getOwnerTrack() != nullptr || plugin.getOwnerClip() != nullptr)
if (! plugin.getSidechainSourceID().isValid())
maxNumChannels = 2; // <- Hard limit to stereo
This hardcoded limit overrides whatever getNumOutputChannelsGivenInputs() returns.
Questions
- Is the 2-channel limit intentional design? I understand the optimization for typical track
plugins, but it seems to override the plugin’s explicit channel requirements. - Is there an official way to indicate that a track plugin needs more than 2 channels?
The use case is legitimate - outputting extra analysis/visualization channels alongside the main
stereo output is common in audio plugins (e.g., sidechain monitors, spectrum analyzers with
separate frequency bands, etc.).
Thanks for any insights!
