Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Adding the VST2 Wrapper code to your Synth Projects
No permission to create posts
August 23, 2016
8:01 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

NOTE TO ALL SYNTH BOOK USERS:

The VST2 wrapper code has now been added to all VST3 Synth projects as of August 23, 2016 for the VSt3 SDK 3.6.6

See the forum note here:

http://www.willpirkle.com/foru.....ded/#p1477

- Will

September 8, 2015
7:57 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

The SynthBook projects are strict VST3 but you can easily add the VST2 wrapper code so you can use VST2 clients to test your Synth plugins. Here is a step-by-step procedure:

In VSTSynthProcessor.cpp:

1) copy this wrapper chunk OUTSIDE of namespace
// --- VST2 Wrapper built-in
::AudioEffect* createEffectInstance(audioMasterCallback audioMaster)
{
return Steinberg::Vst::Vst2Wrapper::create(GetPluginFactory(), /* calls factory.cpp macro */
Steinberg::Vst::Sock2VST3::Processor::cid, /* proc CID */
'S2v3', /* 10 dig code for Sock2VST3 */
audioMaster);
}

2) change Sock2VST3 to your synth namespace AND 'S2v3' to your own secret 4-char code
// --- VST2 Wrapper built-in
::AudioEffect* createEffectInstance(audioMasterCallback audioMaster)
{
return Steinberg::Vst::Vst2Wrapper::create(GetPluginFactory(), /* calls factory.cpp macro */
Steinberg::Vst::NanoSynth::Processor::cid, /* proc CID */
'Nan0', /* 10 dig code for NanoSynth */
audioMaster);
}

3) In Visual Studio, add the .cpp file with Solution->Properties->Add Existing Item (the code is in the source folder of your VST3 SDK):
/source/vst/vst2wrapper/vst2wrapper.sdk.cpp

4) add #include to TOP of VSTSynthProcessor.h
#include "public.sdk/source/vst/vst2wrapper/vst2wrapper.h"

5) alter the .def file to export the second function by adding VSTPluginMain to the list
EXPORTS
GetPluginFactory
VSTPluginMain

The .def file is found in your project root directory; you can edit it with any text editor, or you can open it in Visual Studio and edit it there.

NOTE: the location of the #include file in step 4) is critical; by placing it in the top of the processor's .h file, it will be included BEFORE the controller.h file (see the #include sequence at the top of VSTSynthProcessor.h). If the wrapper is #included AFTER the controller.h file, you will get errors:

error C2011: 'VstKeyCode' : 'struct' type redefinition
error C2011: 'VstVirtualKey' : 'enum' type redefinition
error C2011: 'VstModifierKey' : 'enum' type redefinition

This is an architecture issue for the VST3 authors and not my Synth Project code.

All the best,

- Will

June 8, 2016
1:46 am
Avatar
jhox
Member
Members
Forum Posts: 6
Member Since:
January 30, 2016
sp_UserOfflineSmall Offline

Hi Will,

I have used the VST2 wrapper with VSTGUI 4.2.
It works for 64-bit VST2.

The 32-bit VST2 plugin needs a refresh:
When I load another preset, the new data will be loaded (playing on the keyboard the new sound), but the GUI shows the old param values.
When I move the plugin window out of the screen & then back, the GUI is refreshed & shows the correct values.

This not happens only with my plugins:
Even project 'note_expression_synth' & 'MiniSynth' (VST3) show the same behavior.

If I use the new VSTGUI 4.3, the plugin shows an empty (white) window!
The same with the (new) SDK project 'uidescription test'.

Do you have heard about this problem?

Maybe this happens only on my computer...

Tested on Win 8 (64), Cubase Pro 8 (64)

jhox

June 8, 2016
2:10 am
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Hi jhox

I have not heard of this particular problem, though there are known issues with the VST2 wrapper that Steinberg supplies. The fact that this happens in the VST3 SDK-supplied note_expression_synth points to an issue within the VST2 wrapper architecture so I don't have any good answers for you there.

The current beta version of RackAFX v6.7 (with new GUI) uses VSTGUI4.3 exclusively and there were many changes that occurred between 4.2 and 4.3, including the renaming of a base class and re-prototyping of several key GUI functions. There are a few things to consider:

1) wait until the next VST3 SDK comes out which will use VSTGUI4.3 (the current one uses 4.2) and see if the GUI and/or wrapper issues have been fixed

2) join the VST3 Developer and VSTGUI4 Developer mailing lists (they are separate mailing lists) and post questions about this behavior there; there are both VST2 wrapper and new VSTGUI4.3 issues at hand. For both of these mailing lists, please always use the note_expression_synth example to discuss your problems so that the other developers can replicate your issues, rather than use any of my book examples or any of your own synth code. Also make sure you have the latest VST3 SDK (3.6.5) to use for your examples.

I am a member of both mailing lists but you should consider posting any pertinent information (replies) here for others that might be searching for it.

- Will

August 3, 2016
6:27 pm
Avatar
adrianmcroft
New Member
Members
Forum Posts: 1
Member Since:
August 2, 2016
sp_UserOfflineSmall Offline

Hey folks,

if it saves anyone a few seconds ...

I followed Will's instructions as above but also added 'public.sdk/source/vst/vst2wrapper/vst2wrapper.sdk.cpp' to my VS2015 project and this builds straightaway - otherwise 'I get LNK2001 unresolved external symbol VSTPluginMain'.

Many thanks for the help

AMC

August 19, 2016
7:29 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Thanks, I've modified the above details to change the file to ...sdk.cpp rather than just the .cpp file

- Will

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 47

Peter: 41

Derek: 41

clau_ste: 39

Frodson: 38

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 476

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 30

Topics: 482

Posts: 1876

Newest Members:

sam, annaharris, Marie Weaver, kev, Steven, Mr Anderson, mguy, omelc

Moderators: W Pirkle: 143

Administrators: Tom: 65, JD Young: 80, Will Pirkle: 0, W Pirkle: 143