ebu / ear-production-suite

The EAR Production Suite is a set of VST® plugins and tools for producing immersive and personalizable audio content suitable for any Next Generation Audio codec. It is based on the Audio Definition Model (ITU-R BS.2076) and the ITU ADM Renderer (ITU-R BS.2127) and enables monitoring on any ITU-R BS.2051 loudspeaker configuration.
https://ear-production-suite.ebu.io/
GNU General Public License v3.0
102 stars 20 forks source link

Fix backwards compatibility with 64ch REAPER versions #267

Closed firthm01 closed 8 months ago

firthm01 commented 10 months ago

Setting BusesProperties in a AudioProcessor ctor sets the default layout for the plugin. If this is 128 channels, REAPER v6.x will still instantiate the plugin and appear happy with it, but never call the processBlock method, so level monitoring, export and DSP will not run. Therefore, it is necessary to know if we are running under REAPER with a 64 channel limitation within the plugins. The extension already provided an exposed function to do this, which could be called via the DetermineChannelCount helper. A handle to the host is grabbed via setIHostApplication - however, this is only called AFTER the plugin has been constructed, when we would need to set the default layout. A bus can be resized at any time using the JUCE setChannelLayoutOfBus function. However, this always seems to return false if there is more than one bus in the layout (not sure if a bug in JUCE/VST3/REAPER, but it is a blocker in any case). For this reason, plugin layouts had to be changed to a single bus of discreteChannels so they can be resized after construction. Additionally, there are some peculiarities with calls from the host to isBusesLayoutSupported - dozens of configurations are queried with quite unusual layout types. The actual set layout isn't always queried, so the calls would always return false. To simplify this, so long as the input and output channel counts match, we return true. Ultimately we're not bothered what the buses actually are as everything we do works entirely on a per-channel basis.

firthm01 commented 10 months ago

Fix needs applying to ADM Export Source VST