Cubase 10 - OSX - VST3 - Resizing Bug


#1

I’m having a problem with VST3 Audio Plugin resizing in Cubase 10 on OSX.

Please see screenshot:
Cubase10-OSX-Resizing-Issue

It can be tested by just using the empty Audio Plugin project with small changes (pls. see below). A faster resizing causes a black border and a shifted rendering.
It can even happen that it does not render at all (black component).

The issue is much more evident in a larger project with more components to be rendered (like a StretchableLayoutManager).

/*
  ==============================================================================

    This file was auto-generated!

    It contains the basic framework code for a JUCE plugin editor.

  ==============================================================================
*/

#include "PluginProcessor.h"
#include "PluginEditor.h"

//==============================================================================
ResizeTestAudioProcessorEditor::ResizeTestAudioProcessorEditor (ResizeTestAudioProcessor& p)
    : AudioProcessorEditor (&p), processor (p)
{
    // Make sure that before the constructor has finished, you've set the
    // editor's size to whatever you need it to be.
    setResizeLimits(100, 100, 600, 600);
    setSize (400, 300);
}

ResizeTestAudioProcessorEditor::~ResizeTestAudioProcessorEditor()
{
}

//==============================================================================
void ResizeTestAudioProcessorEditor::paint (Graphics& g)
{
    int width = getWidth();
    int height = getHeight();
    
    // (Our component is opaque, so we must completely fill the background with a solid colour)
    g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));

    g.setColour (Colours::white);
    g.setFont (15.0f);
    
    g.drawFittedText ("Hello World!", 0, 0, width, height, Justification::centred, 1);
    
    // draw an outline around the component
    g.drawRect(0, 0, width, height, 1);
}

void ResizeTestAudioProcessorEditor::resized()
{
    // This is generally where you'll want to lay out the positions of any
    // subcomponents in your editor..
}

#2

Does this only happen in Cubase 10 or are other DAWs affected?


#3

In Reaper / OSX everything works fine.
Cubase 10 / Win 10 is also not affected.

Only Cubase 10 / OSX is showing that issue and it seems that only the height is affected by having a black border at the bottom or top or even nothing rendered after opening the GUI.
Maybe that is related to the getHeight() method.


#4

I noticed also similar issues. I had no time to have a closer look at it so far, but it can also happen in reaper.
Sometime the plugin isn’t centered when loading a new instance. Also it can be that the plugin UI does not show up in reapers embedded plugin view (the view where the used channel plugins are listet on the left) at all. It seems to work when you open the plugins in a separate window.
I’m having this only with some of our plugins, but like edintell said, it maybe is a race condition that depends on different factors.

edit: Not sure if it is the same issue. Could no one reproduce in Reaper? I had exactly that issue in Reaper when instantiating a new plugin, but not always reproducible.


#5

I also have this issue, it only came up in Cubase 10 on macOS and was fine in Cubase 9.5 (and is also fine everywhere else), so it seems to be a new Cubase 10 macOS only bug. I have no way to contact Steinberg to notify them about it as I suspect it’s more on them than Juce.


#6

Does this only happen with >= JUCE 5.4 or was 5.3 also affected?


#7

Juce 5.3.2 is affected


#8

I’ve investigated a bit deeper.

By using the below code, normally the following resizable plugin window should appear:
ok

If the Y-Axis of the plugin is resized by a faster move then something like this happens:

Y-Shift_1
Y-Shift_2
Y-Shift_3

The getWidth() & getHeight() as well as getParentWidth() & getParentHeight() methods deliver the correct values!

Nevertheless, the rendering is shifted in its Y-Axis which is a critical bug!

Dear Juce Team please be so kind to put that issue on your number one prio list because it has a direct impact on the commercial release of our plugin!

Furthermore, if the content to be rendered is more complex then everything gets destroyed. Especially, if the maximize button of the Cubase 10 plugin window is used.

#include "PluginProcessor.h"
#include "PluginEditor.h"

//==============================================================================
ResizeTestAudioProcessorEditor::ResizeTestAudioProcessorEditor (ResizeTestAudioProcessor& p) : AudioProcessorEditor (&p), processor (p)
{
    setResizeLimits(200, 200, 600, 600);
    setSize (400, 300);
    
    addAndMakeVisible(&widthLabel);
    addAndMakeVisible(&heightLabel);
}

ResizeTestAudioProcessorEditor::~ResizeTestAudioProcessorEditor()
{
}


//==============================================================================
void ResizeTestAudioProcessorEditor::paint (Graphics& g)
{
    int width = getWidth();
    int height = getHeight();
    
    int parentWidth = getParentWidth();
    int parentHeight = getParentHeight();
    
    g.setColour (Colours::white);
    g.setFont (15.0f);
    
    g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));
    g.drawRect(0, 0, width, height, 1);
    
    g.drawText("Width: " + std::to_string(width), 0, 10, 80, 20, Justification::right);
    g.drawText("P-Width: " + std::to_string(parentWidth), 200, 10, 100, 20, Justification::right);
    g.drawText("Height: " + std::to_string(height), 0, 30, 80, 20, Justification::right);
    g.drawText("P-Height: " + std::to_string(parentHeight), 200, 30, 100, 20, Justification::right);
   
    g.drawFittedText ("CENTER", 0, 0, width, height, Justification::centred, 1);
}


void ResizeTestAudioProcessorEditor::resized()
{
    int width = getWidth();
    int height = getHeight();
    
    widthLabel.setText("R-Width: " + std::to_string(width), dontSendNotification);
    heightLabel.setText("R-Height: " + std::to_string(height), dontSendNotification);
    
    widthLabel.setBounds(0, 70, 80, 20);
    heightLabel.setBounds(0, 90, 80, 20);
}

#9

We’ll get to the bottom of this. At the moment we’re waiting for a new software license from Steinberg which is taking a little while to sort out.


#10

As an additional information it is interesting to know that the VST 2 version works without any problems.
Just the VST 3 plugin is heavily impacted!


#11

Further investigation shows that getScreenY() delivers randomly fluctuating values during resizing which is for sure not the expected behavior.

Searching for a way to get the relativ offset of the rendering I found this:
ComponentPeer* peer = this->getPeer();
int yPosBounds = peer->getBounds().getY();

The Code below provides the following result after a faster resize:

Rendering-Offset

Well, the VST3 plugin works fine with Reaper64 and Cubase 9.5 on OSX but Cubase 10.0.5 Build 72 Nov 1/2018 shows the described behavior.
As a side note, VST2 works on Cubase 10 without any issues.

#include "PluginProcessor.h"
#include "PluginEditor.h"

ResizeTestAudioProcessorEditor::ResizeTestAudioProcessorEditor (ResizeTestAudioProcessor& p) : AudioProcessorEditor (&p), processor (p)
{
    setResizeLimits(200, 200, 1000, 1000);
    setSize (500, 300);
}


ResizeTestAudioProcessorEditor::~ResizeTestAudioProcessorEditor()
{
}


void ResizeTestAudioProcessorEditor::paint (Graphics& g)
{
    ComponentPeer* peer = this->getPeer();
   
    int yPosScreen = getScreenY();
    int yPosComponent = getBounds().getY();
    int yPosBounds = peer->getBounds().getY();
    
    int width = getWidth();
    int height = getHeight();
   
    g.setColour (Colours::white);
    g.setFont (15.0f);
    
    g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));
    g.drawRect(0, 0, width, height, 1);
    
    g.drawText("Y-Screen: " + std::to_string(yPosScreen), 0, 100, 200, 20, Justification::right);
    g.drawText("Y-Bounds Comp.: " + std::to_string(yPosComponent), 0, 130, 200, 20, Justification::right);
    g.drawText("Y-Bounds Peer.: " + std::to_string(yPosBounds), 0, 160, 200, 20, Justification::right);
}


void ResizeTestAudioProcessorEditor::resized()
{
}

#12

I was also able to reproduce the VST 3 issue with some plugin in reaper 32 bit.