# VST3 Plugin wrapper

**URL:** <https://forum.juce.com/t/vst3-plugin-wrapper/12323>\
**Category:** Audio Plugins\
**Created:** [February 5, 2014, 4:31pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323 "2014-02-05T16:31:59Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 8, 2014, 10:05am UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/21 "2014-02-08T10:05:04Z")

</div>

Thanks - should be ok now. (Strange that llvm didn't complain about that)

---

<div class="post-metadata">

**Author:** ![xsd121](https://avatars.discourse-cdn.com/v4/letter/x/ebca7d/32.png) [@xsd121](https://forum.juce.com/u/xsd121)\
**Post date:** [February 8, 2014, 3:13pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/22 "2014-02-08T15:13:00Z")

</div>

Hi Jules,

&nbsp;

Just some update on&nbsp;this issue. I test again on the demo project generated from introjucer.

With Both&nbsp;

```
#ifndef JucePlugin_Build_VST

 #define JucePlugin_Build_VST 1

#endif

#ifndef JucePlugin_Build_VST3

 #define JucePlugin_Build_VST3 1

#endif
```

vst flags set to 1, the xcode build went fine.

When only the VST3 is enabled, i got the link errors in my previous post.

```
#ifndef JucePlugin_Build_VST

 #define JucePlugin_Build_VST 0

#endif

#ifndef JucePlugin_Build_VST3

 #define JucePlugin_Build_VST3 1

#endif
```

Seems a bit weird.

Maybe you have mentioned at somewhere that both of these need to be declared as 1 in order to build vst3 and I did not see that?

&nbsp;

thanks.

---

<div class="post-metadata">

**Author:** ![MarcW](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/marcw/32/244_2.png) [@MarcW](https://forum.juce.com/u/MarcW)\
**Post date:** [February 8, 2014, 4:22pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/23 "2014-02-08T16:22:51Z")

</div>

Just want to report that my plugin is building and loading in Cubase 7.5 now. Thanks for getting this working!&nbsp;

xsd121, I have the same where both need to be declared to build VST3.&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 9, 2014, 11:28am UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/24 "2014-02-09T11:28:00Z")

</div>

Sorry - I hadn't tried building VST3 without&nbsp;VST2. It just needed a little tweak to add those functions.

---

<div class="post-metadata">

**Author:** ![stian](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stian/32/17_2.png) [@stian](https://forum.juce.com/u/stian)\
**Post date:** [February 10, 2014, 1:08pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/25 "2014-02-10T13:08:53Z")

</div>

I just downloaded the VST3 SDK, updated my JUCE version,&nbsp;checked the VST3 box and it works straight away. Awesome!!&nbsp;Big thanks to&nbsp;jrlanglois and&nbsp;Jules!

Stian

---

<div class="post-metadata">

**Author:** ![stian](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stian/32/17_2.png) [@stian](https://forum.juce.com/u/stian)\
**Post date:** [February 10, 2014, 2:29pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/26 "2014-02-10T14:29:59Z")

</div>

There are apparently still major problems in WaveLab 8. WaveLab calls process with&nbsp;processContext.sampleRate set to zero, so there's no processing going on. I could easily fix that, but the UI also freezes after a short while.

&nbsp;

Stian

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 10, 2014, 3:05pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/27 "2014-02-10T15:05:31Z")

</div>

Ah, good old Wavelab. It's always been a total fucking PITA to support it, so no surprises there.

It probably needs a hack like the&nbsp;checkWhetherMessageThreadIsCorrect() stuff&nbsp;that I did for VST2 to work around its threading model. I'm a bit busy and my Wavelab license has expired,&nbsp;so if anyone wants to volunteer to try that, it'd be appreciated!

---

<div class="post-metadata">

**Author:** ![dnop](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@dnop](https://forum.juce.com/u/dnop)\
**Post date:** [February 11, 2014, 8:39am UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/28 "2014-02-11T08:39:36Z")

</div>

I got a similar linker error and did some investigation on it.

For me this happens only when I build a VST3 only plugin without VST code in the same binary.

Therefore added juce\_VST3\_Wrapper.cpp and juce\_VST3\_Wrapper.mm to the project.

The linker complains about missing symbols and that is correct. I analysed the object file produced from juce\_VST3\_Wrapper.mm with the with the command line tool nm. There are no symbols in that object.

This is the same for the Juce Audio Plugin Demo. The Demo Project works, because there is also the juce\_VST\_Wrapper.mm in the project, where the missing symbols are defined.

So my conclusion is the following: To build a VST3 plugin, add juce\_VST3\_Wrapper.cpp and juce\_VST\_Wrapper.mm to the project. It makes no difference, if juce\_VST3\_Wrapper.mm is also part of the project.

While this work, I wonder what is going wrong with juce\_VST3\_Wrapper.mm. I think Jules had added that file for a certain reason and there is a difference to juce\_VST\_Wrapper.mm. So a VST3 plugin built with the configuration above, may be buggy or lacking some functionality, right?

---

<div class="post-metadata">

**Author:** ![dnop](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@dnop](https://forum.juce.com/u/dnop)\
**Post date:** [February 11, 2014, 8:46am UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/29 "2014-02-11T08:46:16Z")

</div>

I was wondering, why my VST3 plugin did projuced only noise and did not react to MIDI.

I found out, that setting JucePlugin\_MaxNumInputChannels to 0 beaks a VST3 plugin. I did that because the plugin is a Synth and does not care for input data. But in juce\_VST3\_Wrapper.cpp line 1112 there is this check:

> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pluginInstance != nullptr  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; && data.inputs != nullptr  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; && data.outputs != nullptr  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; && processContext.sampleRate \> 0.0)

Because, the plugin does not allow input channels, data.inputs is a nullpointer. That will make the process function just return false instead of processing files.

Setting JucePlugin\_MaxNumInputChannels to a value \> 0 is a workaround, but I think that is not the way it should be, right?

&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 11, 2014, 10:23am UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/30 "2014-02-11T10:23:08Z")

</div>

Hmm, yes, that code does look a bit ropey - sorry, I hadn't sanity-checked it.&nbsp;I've had a quick look and tightened it up a bit now,&nbsp;if you want to try again..

---

<div class="post-metadata">

**Author:** ![stian](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stian/32/17_2.png) [@stian](https://forum.juce.com/u/stian)\
**Post date:** [February 17, 2014, 9:22am UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/31 "2014-02-17T09:22:50Z")

</div>

I think they cleaned up much of the threading mess in&nbsp;v7, so this is probably another issue. After experimenting a bit more, it seems to work fine the first time you instantiate the plug-in. Only when you reopen Wavelab, there are problems. This can easily be reproduced by adding the demo plug-in to the effect chain, closing the app and reopening it (with the restore files option selected). Simply clicking the play button seems to freeze the application. Anyway, you should remove the check for the&nbsp;processContext.sampleRate in the first line of the process method since this is zero in Wavelab 8. Also, Introjucer seems to confuse&nbsp;up the&nbsp;pluginManufacturerWebsite and companyWebsite as well as the&nbsp;pluginManufacturerEmail and&nbsp;companyEmail tags so that you can't change these without manual editing.

Stian

---

<div class="post-metadata">

**Author:** ![Mart](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mart](https://forum.juce.com/u/Mart)\
**Post date:** [February 25, 2014, 3:08pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/32 "2014-02-25T15:08:22Z")

</div>

Sorry, [that post on getParameterNumSteps()](http://www.juce.com/forum/topic/vst-3-and-getparameternumsteps) probably should have been posted in this thread. Now that I had a look into Steinberg's API and verified what I wrote about the values VST3 hosts are expecting, how about changing line 179 juce\_VST3\_Wrapper.cpp from

```
info.stepCount = (Steinberg::int32) p.getParameterNumSteps (index);
```

to

```
info.stepCount = (Steinberg::int32) p.getParameterNumSteps (index) - 1;
```

or even something like

```
info.stepCount = (Steinberg::int32) (p.getParameterNumSteps (index) == 0x7fffffff ? 0 : 
p.getParameterNumSteps (index) - 1;
```

&nbsp;

(By the way: thanks a million to everyone working on this library!)

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 25, 2014, 4:03pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/33 "2014-02-25T16:03:20Z")

</div>

How about

```
const int numSteps = p.getParameterNumSteps (index);
            info.stepCount = (Steinberg::int32) (numSteps > 0 && numSteps < 0x7fffffff ? numSteps - 1 : 0);
```

---

<div class="post-metadata">

**Author:** ![Mart](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mart](https://forum.juce.com/u/Mart)\
**Post date:** [February 25, 2014, 5:06pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/34 "2014-02-25T17:06:52Z")

</div>

Yes, that looks even better.

---

<div class="post-metadata">

**Author:** ![funky](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@funky](https://forum.juce.com/u/funky)\
**Post date:** [February 26, 2014, 7:41am UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/35 "2014-02-26T07:41:58Z")

</div>

Hello Everybody,&nbsp;  
  
I tried out the new VST3 Wrapper and it works well, so DemoPlugin works and so on.&nbsp;

Now I tried out the new Feature of VST3: &nbsp; **Sampleaccurate Automation**

In VST2 I used for automation the functions: beginEdit and endEdit (in JUCE:&nbsp;beginParameterChangeGesture/end...)&nbsp;

Now in VST3 there is a new Function: **performEdit** for Automation

Now my Question:&nbsp;

Is the sampleaccurate Automation working automaticly in VST3 or should I use the "performEdit" function. Because there is no implemented Version of a function like " **performParameterChangeGesture**" in the new JUCE.&nbsp;  
Im not shure If its working automatic, I tried to automate the gain-param of the DemoPlugin and I made shure that there is a jump while using the slider. But when Im writing out the Automation now (unfortunately through the plugin again) and plot it in Matlab the Jump is not a perfect sample accurate jump.&nbsp;

So is the sampleaccurate Automation a lie or is my test wrong or do I need the functions.&nbsp;

&nbsp;

Had anyone a similar problem?&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Mart](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mart](https://forum.juce.com/u/Mart)\
**Post date:** [February 26, 2014, 12:34pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/36 "2014-02-26T12:34:00Z")

</div>

I had a quick look into VST3 automation functions and how they are wrapped in the wrapper yesterday and I guess part of your problem might be that you're "writing out the automation" through your Plugin:  
  
For sample-accurate automation playback, VST3 passes lists of parameter changes along with each sample block (see the "Automation playback" part of VST3 SDK/doc/vstinterfaces/vst3Automation.html within you VST3 SDK folder). They are passed as part of _data_ with each call to _IAudioProcessor::process (ProcessData &data)_.

However, the wrapper apparently only takes the last parameter of each of these lists to call JuceAudioProcessor::setParameter with it (see _JuceVST3Component::processParameterChanges_ in _juce\_VST3\_Wrapper.cpp)_.

To sum it up: just one parameter change per sample block is passed to JuceAudioProcessor -\> no support of sampleaccurate automation (playback). (At least for now and if I'm not mistaken.)

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 26, 2014, 1:08pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/37 "2014-02-26T13:08:14Z")

</div>

Yeah, all the juce wrapper stuff was written to work on all formats, and pre-dates any sample-accurate parameter&nbsp;abilities that VST3 has added.

It'd require a big redesign of the whole AudioProcessor class to take advantage of it, because obviously it'd need to either break each block&nbsp;down into smaller chunks and process them (which would probably cause many flaky plugins to fail) or add an extra layer to let your process block iterate&nbsp;the parameter changes and find out their positions.. And all of this would need to be ported to all the other plugin formats of course.&nbsp;All worth doing, but not trivial!

---

<div class="post-metadata">

**Author:** ![Mart](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mart](https://forum.juce.com/u/Mart)\
**Post date:** [March 7, 2014, 4:08pm UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/38 "2014-03-07T16:08:16Z")

</div>

When drawing automation in Cubase, there is this tooltip thing that shows you the denormalized String representation of the automation value:  
  
 ![](https://dl.dropboxusercontent.com/u/2235522/Automation_Tooltip.png)

This is calulated by calling Steinberg's _IEditController::getParamStringByValue_. It passes a normalized value and expects the String representation that the parameter would have if it was set to that value. As it does not actually set the parameter, this cannot be achieved by calling _juce::AudioProcessor::getParameterText (int index)_.

The way the wrapper works right now, this is kind of broken as the tooltip always shows the value the plugin is actually set to (at the moment of editing the automation).

I coded myself [a quick fix for that](https://github.com/MartinHH/JUCE/compare/master...developMH), but I'm still new to the library (and not a c++ expert neither).

---

<div class="post-metadata">

**Author:** ![funky](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@funky](https://forum.juce.com/u/funky)\
**Post date:** [February 27, 2014, 10:15am UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/39 "2014-02-27T10:15:06Z")

</div>

Hey Mart,&nbsp;

&nbsp;

So sorry but know I'm a little bit confused.&nbsp;  
Your Quickfix doesn't fix the problem with sampleaccurate automation&nbsp;or have I misunderstood.&nbsp;

I still do not see the connection between the String-Parameter-representation and the automation.&nbsp;

Sorry for my confusion :)&nbsp;

---

<div class="post-metadata">

**Author:** ![funky](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@funky](https://forum.juce.com/u/funky)\
**Post date:** [February 27, 2014, 10:21am UTC](https://forum.juce.com/t/vst3-plugin-wrapper/12323/40 "2014-02-27T10:21:50Z")

</div>

Hey Jules,&nbsp;  
&nbsp;

First thank you for the Explanation.&nbsp;

Is there a way to bypass the current VST-Wrapper only for a short time Interval? So the sample-accurate Automation for me is only interesting at Jump Points (like 0 -\> 1). Do you see a way - without porting everything - to write Automation correctly at this points?&nbsp;  
  
I checked out the problem is not the reading of the Automation, if i draw a Automation-curve in Cubase by Hand an draw a jump from 0 -\> 1 the Plugin reads it good enough (I think). But when write the Jump with the Plugin it's not a perfekt jump from 0 -\> 1.&nbsp;

So is there a way to use the "performEdit" function for some samples while writing the automation? Perhaps this helps...&nbsp;

[Previous page](https://forum.juce.com/t/vst3-plugin-wrapper/12323.md?page=1)

[Next page](https://forum.juce.com/t/vst3-plugin-wrapper/12323.md?page=3)
