vst3_plugin.h

Programming applications for making music on Linux.

Moderators: khz, MattKingUSA

User avatar
skei
Established Member
Posts: 194
Joined: Sun May 18, 2014 4:24 pm
Contact:

vst3_plugin.h

Post by skei »

want to make vst3 plugins in a simple way?
have a look here:
https://github.com/skei/vst3_plugin.h

i also posted a little bit more info here:
https://www.kvraudio.com/forum/viewtopi ... 3&t=556777

- tor-helge

User avatar
sadko4u
Established Member
Posts: 824
Joined: Mon Sep 28, 2015 9:03 pm

Re: vst3_plugin.h

Post by sadko4u »

It would be a more nicer solution if we could avoid the original VST3 SDK.
LSP (Linux Studio Plugins) Developer and Maintainer.

User avatar
skei
Established Member
Posts: 194
Joined: Sun May 18, 2014 4:24 pm
Contact:

Re: vst3_plugin.h

Post by skei »

yeah, i know.. but that would be a pretty substantial job.. would need to redefine all those com interfaces and helper structs and classes that steinberg seems to love.. :-/ could be done, but i don't see much reason for that, to be honest.. you only need the gpl part of the sdk, and no compilation or linking or anything like that (everything is done via #includes in the vst3_plugin.h file, so no work on your part).. download the sdk, unzip it somewhere, let gcc know about it (-I<path>, and you're good to go..

User avatar
mike@overtonedsp
Established Member
Posts: 102
Joined: Mon Apr 24, 2017 5:26 pm
Location: Oxford, England
Contact:

Re: vst3_plugin.h

Post by mike@overtonedsp »

It would be a more nicer solution if we could avoid the original VST3 SDK.
Why?

User avatar
mike@overtonedsp
Established Member
Posts: 102
Joined: Mon Apr 24, 2017 5:26 pm
Location: Oxford, England
Contact:

Re: vst3_plugin.h

Post by mike@overtonedsp »

want to make vst3 plugins in a simple way?
have a look here:
What benefit is this? Other than the possibility of being able to build plug-ins that kind of look and behave something like a VST3, but with added possibility of some subtle breakage and perhaps some extra incompatibility issues with random host applications and perhaps other plugins? You can take the existing VST3 SDK and quite easily build against it without having to jump through all the cmake hoops if that's not your thing (I integrated the VST3 SDK into my build process quite easily without cmake as I like to be able to configure my build process myself). Am I missing something? As I understand it the VST3 SDK has a Linux compatible license now, so there should no need for reverse engineering and other hacks...

User avatar
skei
Established Member
Posts: 194
Joined: Sun May 18, 2014 4:24 pm
Contact:

Re: vst3_plugin.h

Post by skei »

mike@overtonedsp wrote:
Tue Dec 01, 2020 3:21 pm
there should no need for reverse engineering and other hacks
there's not much reverse engineering or hacks involved, really.. i saw a lot of people complain about the complexity of the vst3 sdk, so i decided to dig as deep down as i managed, to understand what's really going on.. and then i shaved off most of these additional, unneeed layers and complexity, so that i were left with the essentials.. then, a simple plugin wrapped (compatible with my internal plugin format) is placed on top of that..

with this, i can make a plugin by compiling just one .cpp file (the plugin itself), no make files needed, no external libs or files to link in, no weird build systems to set up.. and the code is much easier to understand, tweak, fix, try things, experiment, etc..

i did it mainly to add vst3 support into my main framework, and i thought it could also help other people who doesn't want to spend a lot of time deciphering the intricacies of the official sdk, or doesn't want to mess with com-objects, uuids, utf16 and crap like that.. but if you already have a working vst3 layer/abstraction, or is happily using the official vst3 sdk as-is, you probably won't be interested in this..

i have tested the version in my framework (which this header file is based on) in all vst3 compatible linux-hosts i know, and they seem to work everywhere.. they should actually be more stable than vst2 versions, since there's less 'undefined behaviour' in vst3 than vst2, resulting in a lot less hacks and 'tricks' needed for thread-safety, etc..

Basslint
Established Member
Posts: 663
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy

Re: vst3_plugin.h

Post by Basslint »

I think this is gold, @skei...thanks for sharing it and please, regardless of how many people adopt it in the short-team, keep at it because in the long-term it is going to help a lot of people make VST3 plugins. I've looked into the VST3 SDK and found it very hard to work it with - maybe it's not like this for people who known VST2, but it seems a very big API.

Only thing, since you include the VST3 headers, this should be licensed under the GPLv3.
Last edited by Basslint on Sun Dec 06, 2020 1:59 pm, edited 1 time in total.
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Wanna make music on openSUSE? Check out GeekosDAW!

User avatar
skei
Established Member
Posts: 194
Joined: Sun May 18, 2014 4:24 pm
Contact:

Re: vst3_plugin.h

Post by skei »

don't worry, i won't stop with this..

i have dug quite a bit deeper, and i'm soon finished with the next step - getting rid of the steinberg sdk completely.. so that you don't have to use the official steinberg sdk at all.. #include one extra .h file, and off you go.. after all, it's mainly a bunch of typedefs, structs and empty virtual/abstract classes.. i just need to do some utility functions for easier handling of utf16, uuid, strings, etc..

since it 's "a derivative of" the official sdk, it needs to be gpl3, i guess..

User avatar
skei
Established Member
Posts: 194
Joined: Sun May 18, 2014 4:24 pm
Contact:

Re: vst3_plugin.h

Post by skei »

hooray! a little update, before i clean it up and update github.. i got rid of all #includes of the steinberg sdk files, and made a replacement vst3.h file, 1200 lines (36kb).. so, now the plugin is completely stand-alone.. no need for the steinberg vst3 sdk.. the resulting .so is 14.5kb.. reaper (linux) finds it and tries to load it (printf everywhere).. but since i haven't implemented a few necessary utility functions (iid_equal, ascii_to_utf16, utf16_to_ascii), it fails.. but at least now i know it can be done..

edit: updated github

Basslint
Established Member
Posts: 663
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy

Re: vst3_plugin.h

Post by Basslint »

skei wrote:
Sun Dec 06, 2020 9:32 pm
hooray! a little update, before i clean it up and update github.. i got rid of all #includes of the steinberg sdk files, and made a replacement vst3.h file, 1200 lines (36kb).. so, now the plugin is completely stand-alone.. no need for the steinberg vst3 sdk.. the resulting .so is 14.5kb.. reaper (linux) finds it and tries to load it (printf everywhere).. but since i haven't implemented a few necessary utility functions (iid_equal, ascii_to_utf16, utf16_to_ascii), it fails.. but at least now i know it can be done..

edit: updated github
Very very cool! :D
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Wanna make music on openSUSE? Check out GeekosDAW!

User avatar
sadko4u
Established Member
Posts: 824
Joined: Mon Sep 28, 2015 9:03 pm

Re: vst3_plugin.h

Post by sadko4u »

skei wrote:
Sun Dec 06, 2020 9:32 pm
i got rid of all #includes of the steinberg sdk files, and made a replacement vst3.h file, 1200 lines (36kb).. so, now the plugin is completely stand-alone.. no need for the steinberg vst3 sdk..
This is damn cool! I always believed that Steinberg swpawned a very fat SDK which can be very simply reduced to a small set of header files.
LSP (Linux Studio Plugins) Developer and Maintainer.

User avatar
skei
Established Member
Posts: 194
Joined: Sun May 18, 2014 4:24 pm
Contact:

Re: vst3_plugin.h

Post by skei »

did some more cleaning up.. it's also now part of the next/updated version of my plugin library/framework (kode2).. but since there's still some time before i will publish that, i (temporarily) added the kode_vst3_base.h file to this repository, so you can have a look if you want.. it probably still needs some tweaks and more cleanups (tabs vs spaces and stuff like that)..

https://github.com/skei/vst3_plugin.h/b ... st3_base.h

Basslint
Established Member
Posts: 663
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy

Re: vst3_plugin.h

Post by Basslint »

One thing which I think would help its adoption a lot is an examples/ directory with 1-2 working simple plugins, maybe a minimal synth and a basic effect.
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Wanna make music on openSUSE? Check out GeekosDAW!

User avatar
skei
Established Member
Posts: 194
Joined: Sun May 18, 2014 4:24 pm
Contact:

Re: vst3_plugin.h

Post by skei »

yeah, i have been thinking about it.. but this version was mainly meant as a prototype, a proof of concept, a test.. as soon as i knew it worked, i started cleaning it up, and massaging it to fit into my new plugin framework: kode2.. it's still 'work in progress', and there's a few things to do and clean up before i make a proper, official announcement and release.. but compiling a gui-less, do-nothing vst3 plugin takes just a few seconds, results in a 90 kb .so file (release build), and works in reaper and bitwig.. gui is already in place, but needs some debugging..

kode_vst3_api.h wraps/abstracts the vst3 'api', and with that, i made a vst3 wrapper for my internal plugin/instance class: kode_vst3_plugin.h / kode_vst3_instance.h, and finally, a test plugin using the above: test_plugin.h.. if you dig into these files, i think it should be pretty easy to understand how it all hangs together..

actually, the vst3 sdk is 'com-like', which means it's generally based on empty classes (interfaces) without constructors/destructors, with virtual methods that either the host or your plugin implements.. more or less just structs with function pointers.. and i think it should be pretty easy (but maybe tedious) to make it work in pure c too, using the vtable directly.. but we'll see if i get around to experimenting with that..

j_e_f_f_g
Established Member
Posts: 1121
Joined: Fri Aug 10, 2012 10:48 pm

Re: vst3_plugin.h

Post by j_e_f_f_g »

Oh, if you want to do COM in pure C, I wrote a series of articles (with code examples) about that at:

https://www.codeproject.com/Articles/13 ... in-plain-C

Post Reply