Ambisonics 4/5/6/7 broken in VST3.7.8 / Reaper Latest

Compiled the develop branch today (14/june).

Upon adding the newest channel layouts ambisonics(4) (5) (6) (7), when I load the plugin in Reaper (latest version), it doesn’t go past stereo (it ignores the ambisonics(1) (2) and (3) that my plugin already dealt with)…

The Ambisonics 4,5,6,7 channel layouts prevent my plugin from going beyond stereo.

If I delete the (4) (5) (6) (7) and leave only (1) (2) (3), the plugin works, and I can go with no problem to 16 channels, once I add 4, 5, 6, 7, it just stays in stereo…

In Pro Tools, Ambisonics layouts 1 through 7 work correctly.

----- update

Just tried with another test… problem persists.

The way I am setting up is, in my getDefaultLayout()

            return BusesProperties().withInput("Input", juce::AudioChannelSet::stereo() true)
                                    .withOutput("Output", juce::AudioChannelSet::stereo(),true);

And then, in the isBusesLayoutSupported, I have:

 if (
            layouts.getMainOutputChannelSet() != juce::AudioChannelSet::stereo()
            && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::ambisonic(1)
            && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::ambisonic(2)
            && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::ambisonic(3)
            && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::ambisonic(4)
            && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::ambisonic(5)
            && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::ambisonic(6)
            && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::ambisonic(7)

            )
        {
            return false;
        }
        if (
            layouts.getMainInputChannelSet() != juce::AudioChannelSet::stereo()
            && layouts.getMainInputChannelSet() != juce::AudioChannelSet::ambisonic(1)
            && layouts.getMainInputChannelSet() != juce::AudioChannelSet::ambisonic(2)
            && layouts.getMainInputChannelSet() != juce::AudioChannelSet::ambisonic(3)
            && layouts.getMainInputChannelSet() != juce::AudioChannelSet::ambisonic(4)
            && layouts.getMainInputChannelSet() != juce::AudioChannelSet::ambisonic(5)
            && layouts.getMainInputChannelSet() != juce::AudioChannelSet::ambisonic(6)
            && layouts.getMainInputChannelSet() != juce::AudioChannelSet::ambisonic(7)

            )
        {
            return false;
        }
    }
    return true;

If I comment out the ambisonics 4, 5, 6, 7, the plugin properly expands through stereo, ambisonics 1, 2 and 3.

If I leave the 4, 5, 6, and 7, the plugin is stuck in stereo until ambisonics(7)… so ambisonics 1,2,3,4,5,6 remain with a stereo in/out

I think REAPER may need updating to handle the new ambisonics layouts correctly. Those were only added in VST 3.7.8. I think REAPER is probably using an earlier version, and will need to update in order to add support for these layouts.

I thought about it, I saw their latest version is from 27 May 2023, I assumed it would be ready :frowning:

Is there a way I can add an #if to the VST3 version so as to include/exclude the Ambisonics layouts in the isBusesLayoutSupported?

I don’t think so - although plugins have to report to the host the version of the VST3 SDK that they are using, I don’t see any way for the host to pass its SDK version to the plugin.

It’s possible I’ve just overlooked something in the API, though…

Hi there,

Reaper latest (v7) still broken.

On the latest version, ambisonics(7) reports correctly on 64-ch track
ambisonics(5) reports correctly on 36-ch track.

but for some reason, once ambisonics(4) to (7) are added in isBusesLayoutSupported, it breaks ambisonics(1), and Quadraphonic (e.g., setting a track to width 4-ch doesn’t seem to negotiate succesfully).

Any help @reuk ?

VST3 uses a 64-bit bitmap to determine which channels should be enabled on a bus, where each bit corresponds to a different kind of speaker, such as left, right, centre, sub, etc.

However, VST 3.7.8 introduced an exception to this rule, where a layout with the bottom 25, 49, or 64 bits set corresponds to a 5th, 6th, or 7th-order ambisonics layout respectively. Lower-order ambisonic layouts all have the bottom 19 bits unset, and the bits from 20 to 58 set depending on the ambisonic order.

When I load the SurroundPlugin demo into Reaper 7.07 and request a VST3 bus size of 4, 9, 16, or 25, Reaper requests a layout with the bottom 4, 9, 16, or 25 bits enabled. JUCE sees that these are not VST3-specified ambisonic layouts, and so uses the semantics of these channels instead.

When I request a bus size of 36, 49, or 64, Reaper requests a layout with the bottom 36, 49, or 64 bits set. Because this is the correct way to request a higher-order ambisonic layout, JUCE is able to interpret such requests and switch to the correct layout.

There’s not much we can do in JUCE to work around this - from the plugin’s perspective, it’s doing what the host told it to do. To use a lower-order ambisonic layout in Reaper, the host needs to instruct the plugin to enable a layout with the bottom 19 bits unset. I’d recommend contacting the Reaper developers to see whether they’re aware of this issue.

Thank you so much for your explanation.

But how come the 4-channel layout works when I use ambisonics(1)(2)(3) but as soon as I add an order above 3, it breaks? That’s what has me puzzled.

I’ll try and come in contact with Cockos…