Help me get started with VSTGUI

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

#The fREaK! wrote:based on what aciddose has said however, they are pretty much guaranteed not to work in cubase
wait.... what? 2.4 plugs guaranteed NOT to work in Cubase :?:

What does 'export the main function' mean?

Thanks,
Adam
aciddose wrote:you empty headed animal food trough wiper, your mother was a hamster and your father smelt of elderberries!

Post

i think he is refering to the fact some hosts use the audioeffectx class directly. has the class structure changed in 2.4?

i thought they would have just added a new audioeffectxx or something.

if audioeffect and audioeffectx classes are not maintained exactly the same, vst 2.4 plugs will not work in some hosts. they will not work in older versions of cubase, but will work in the newest versions (which expect 2.4)

some hosts use "getvstversion" to figure out how to typecast the object pointer in aeffect.

in audioeffectx it returns 2. returning 0 or 1 would mean the class is audioeffect. having the "object" pointer set to zero will tell the host there is no class but some hosts will simply fail here.

Post

aciddose wrote:i think he is refering to the fact some hosts use the audioeffectx class directly.
Oh, we're down to "some hosts" now? :-)
Here it was 99%...
has the class structure changed in 2.4?
Unfortunately, yes. They added the new virtual methods processDoubleReplacing() and canDoubleReplacing() in the middle of the AEffect structure, a very bad move IMO; guaranteed to break compatibility with hosts that rely on a fixed layout in the object pointer and don't know about V2.4.
"Until you spread your wings, you'll have no idea how far you can walk." Image

Post

since that, two of the hosts i was refering to had their bugs fixed and so do not make assumptions about the classes.

:P

and even now, they still crash if the object pointer isnt zero and the classes are modified. every host which even uses the object pointer will fail when the vtable isnt as expected. what i said with 99% is that 99% of hosts "try" to use the object pointer.. the host i wrote doesnt even touch it.

no host should ever use the classes directly in my opinion. any host which uses the class directly relies upon compiler specific configuration of alignment so i consider any host which actually does that as poorly behaved.

they put it in the middle of the struct?.. in those reserved spaces.. maybe?..

if they added something in the middle of the struct they must be really unbelievably stupid.. that would break _every_ host.

maybe you mean they put it in the middle of the audioeffect class, displacing members in the vtable?.. you should expand on what you mean. i'm not going through the website to download 2.4 since i consider it mostly useless. i dont even use their versions of the source, i wrote my own.

if they put the pointers in the reserved spaces, hosts that do not know about 2.4 will simply write over top of the reversed spaces while 2.4 hosts will know there are pointers in them.

Post

What does 'export the main function' mean?
In VST 2.4 a new VSTPluginMain function is used by hosts to retrieve the struct instead of the old main/main_macho/main_plugin ones, which are now defined as wrappers for VSTPluginMain. The old one (name depends on platform, main for Windows) are required for backward compatibility.


They put a new pointer in AEffect for the new processDoubleReplacing just before the "future" padding, and removed 4 bytes of it to compensate.

I think he meant the new functions added in AudioEffect. They added those there, as well as moved the now deprecated functions in AudioEffect and AudioEffectX (to be removed next version) to the end.


And I use my own version as well, with AudioEffect and AudioEffectX merged and free from virtual functions, and lot of functions either inlined of removed, which works as a wrapper around a little plugin-format independant framework of mine. My plugins are what I meant to refer to as guaranteed not to work in cubase, but the same apparently went for usual 2.4 ones before they updated it.

Post

aciddose wrote:maybe you mean they put it in the middle of the audioeffect class, displacing members in the vtable?
Yes, that's what I meant (obvious from the fact that I mentioned virtual methods, which aren't in AEffect)... was in a bit of a hurry when I wrote it, didn't double-check. Shame on me.

Oh, and...
aciddose wrote:what i said with 99% is that 99% of hosts "try" to use the object pointer..
I'm still waiting for a list backing this statement.
"Until you spread your wings, you'll have no idea how far you can walk." Image

Post

OK, after following the rest of the instructions for installing PSDK, the OLE and related problems went away. (Though, I do wonder why the heck they're referenced in a plugin! But hopefully it won't matter.

For my particular application, if I can just get one small host to work (like the mini host that's provided with VST SDK, or Arakula's which is probably better), that will be sufficient. For my project, nobody would need to run the plugin in a DAW or live chainer, since it's just a tool for a specific purpose and of no help in actual audio processing (strange as that sounds). I'm just using VST as a way not to need to know how to handle soundcard input/output.

So, next I need to understand what asomers meant in his post (see my next post).

Post

asomers wrote:as for libpng... if USE_LIBPNG is not set to 1 it shouldn't complain about it, since the surrounddelay resources are .bmps.
You da man, Adam -- thanks! Took me a bit to realize that I couldn't just change the USE_LIBPNG definition, clean, and build. I had to manually delete the libpng and libz dependencies that cropped up in the solution view for drawtest. (Whatever that means!) It'll take me a bit to get a handle on what this MSVC build environment does and doesn't automate.

And if I want to use libpng later, I think you've given me the necessary clues.

Thanks again.

PS: I actually don't think I can use a mini host after all, since I'll need sfz along with my vst and I don't know if a mini host can do that (handle two chains). But still, I don't think host compatibility will be a big issue -- as long as I can get it to work in VSThost or something like that.

Thanks everone for the help so far. But I still think I'll need a clue how to use the GUI stuff. I'll post a better question later!

Thanks again
Jeff

Post

Ah, crap.

For some reason, for surrounddelay, it builds a .lib rather than a .dll file. But the project->properties->linker->general->OutputFile is ".\Debug/surrounddelay.dll".

Whussupwiddat?

Thanks,
Jeff

Post

The .lib is probably rather small, isn't it? Should be an import library to be used in other projects.
"Until you spread your wings, you'll have no idea how far you can walk." Image

Post

But surrounddelay is supposed to be a VST.

Post

learjeff wrote: For some reason, for surrounddelay, it builds a .lib rather than a .dll file. But the project->properties->linker->general->OutputFile is ".\Debug/surrounddelay.dll".
double check that project->properties->configuration properties->general->configuration type is "dynamic library (.dll)"

That's all I can think of ATM. Sorry
aciddose wrote:you empty headed animal food trough wiper, your mother was a hamster and your father smelt of elderberries!

Post

learjeff wrote:But surrounddelay is supposed to be a VST.
While that is true, it still is a DLL - and for the linker that means that somebody might want to link it to an application, so it creates an import library for that purpose. Makes no sense for a VST PlugIn, but that's far beyond the linker's intelligence level 8-)
... but it should also produce a .dll file. If that isn't there, and the linker didn't produce an error message, follow Adam's suggestion.
"Until you spread your wings, you'll have no idea how far you can walk." Image

Post

Hmm, actually, a .dll WAS being built. I was just looking in the wrong place (win/Debug rather than win.vc6/Debug -- no idea what the difference is!)

Post

the difference is win.vc6/debug has microsoft gnome magic. you must obey the microsoft and submit to whatever the gnomes do, even when you dont ask them to.

where is my key?

gnome: we hid it for you!

uh.. it was fine under the mat.. where did you hide it?

gnome: we burried it in the forest!

where?

gnome: we forgot where :(

Post Reply

Return to “DSP and Plugin Development”