Simple linux VST with source code

Official support for: energy-xt.com
RELATED
PRODUCTS

Post

Viva la révolution!

(Seriously, Linux as the dominant DAW OS or at least a competitive one would make me a very, very happy camper).

If it ever happened, you'd become a historical figure along the lines of Bob Moog, Jorgen. :)
♫♪♫♫♪♫

Post

undef wrote:can anyone post some binaries?
Of course. But keep in mind they're just examples, apart from them working, they are maybe not of much quality (at least on my current linux setup they are not). They'll do for some lo-fi stuff though :)

Synth example 1: DOWNLOAD
Synth example 2: DOWNLOAD

Post

:)

Not to have them rely on wine would be a bonus as wine has a 2gb memory address limit. Many vst's, large banks and romplers easily eat into that memory so without wine more than 2gb memory can be addressed.

Muse may even be interested...... :hihi:

Cant remember offhand how much memory linux can handle?

Being able to save setting and presets would be the main advantage for me.

fake
You cant beat people up then have them say "I love you"

Post

I finally got around to trying to compile the sample mono synth (without filter) on Windows.

I'm using Code::Blocks IDE with GCC compiler (mingw32).

I dumped all the files from VST 2.x SDK into my project directory and changed all the #include <> into #include ""

I got this returned:

Code: Select all

Compiling: audioeffectx.cpp
Compiling: plugin.cpp
plugin.cpp: In function 'AEffect* main_plugin(VstIntPtr (*)(AEffect*, VstInt32, VstInt32, VstIntPtr, void*, float))':
plugin.cpp:37: error: cannot allocate an object of type 'CPlug'
plugin.cpp:37: error:   because the following virtual functions are abstract:
audioeffect.h:49: error:  virtual void AudioEffect::processReplacing(float**, float**, VstInt32)
plugin.cpp: In constructor 'CPlug::CPlug(VstIntPtr (*)(AEffect*, VstInt32, VstInt32, VstIntPtr, void*, float), long int, long int)':
plugin.cpp:58: error: 'hasVu' undeclared (first use this function)
plugin.cpp:58: error: (Each undeclared identifier is reported only once for each function it appears in.)
Process terminated with status 1 (0 minutes, 2 seconds)
5 errors, 0 warnings
The whole virtual abstract function means little to me.

The second problem with the hasVu being undeclared looks on the surface to be correct. I can't find the declaration of this function. However, given that people are compiling this successfully, I must be missing something in my understanding.

I'm kinda hoping that all the plugin.cpp stuff is going to be more or less a default thing that I'm not going to have to worry about too much with the synth.h file being where all my work goes. Is that the idea?

So if I can just get plugin.cpp to compile successfully, I should be able to implement my own ideas in the h file.

Regards
Caleb
Happiness is the hidden behind the obvious.

Post

It looks like you used an SDK version 2.4 or above and this obviously is not compatible going by the errors. 2.3 is what I (still) use here and it worked with this code, so my proposal would be that you should try your luck with the 2.3 files instead.

Post

fake wrote::)

Not to have them rely on wine would be a bonus as wine has a 2gb memory address limit. Many vst's, large banks and romplers easily eat into that memory so without wine more than 2gb memory can be addressed.

Muse may even be interested...... :hihi:

Cant remember offhand how much memory linux can handle?

Being able to save setting and presets would be the main advantage for me.

fake
If one goes by how those examples are built, the normal user won't notice any difference to plugins on win32. And wine isn't needed here at all ;)
Regarding memory limit - it's like with every other OS of 32bit/64bit, where you have a certain amount of memeory available for each process. In Linux (32bit) it's the same as in Windows (32bit), i.e. 4GB per process, just the difference is how much is reserved for the OS (or kernel), which is AFAIK about 800MB for the Linux32 OSs, but probably can be tweaked to get more per process. Not knowing too much about this, but Linux seems a bit more flexible regarding memory management than Windows for example, but maybe I'm just lacking a certain bit of win32 insider knowledge :)

Post

plastique wrote:
undef wrote:can anyone post some binaries?
Of course. But keep in mind they're just examples, apart from them working, they are maybe not of much quality (at least on my current linux setup they are not). They'll do for some lo-fi stuff though :)
Synth example 1: DOWNLOAD
Synth example 2: DOWNLOAD
both kill XT2 here if i try to load them (either into a sequencer or the main workspace)

slainte :( rob

Post

I'm far too noobish on linux development to be able to tell what it could be (GCC version, libs versions ??) :shrug: No error message ? Maybe you could try to start xt2 from a terminal, then load the plugin and see if that makes the message appear ?
Maybe someone else should compile them as well ? Only thing I can tell for sure is that they worked fine here.

Post

Starting from terminal would go like this:

- open terminal
- type: cd /home/<name>/<xt2directory>
- type: exec energyXT2

(not as the root user)

Post

plastique wrote:It looks like you used an SDK version 2.4 or above and this obviously is not compatible going by the errors. 2.3 is what I (still) use here and it worked with this code, so my proposal would be that you should try your luck with the 2.3 files instead.
Thanks for this.

I'm getting much further now - but this time I get:

Code: Select all

Linking dynamic library: .\monosynth.dll
Cannot export main: symbol not found
Creating library file: .\libmonosynth.a
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 4 seconds)
0 errors, 0 warnings
Regards
Caleb
Happiness is the hidden behind the obvious.

Post

I'm not familiar with the mingw compiler but I think you need to add (or change) the .def file, named the same as the dll.
Inside the .def file you have "EXPORTS main=main_plugin" without the quotes, and then link this in the compiler (how = ?).
Maybe this helps: http://www.u-he.com/vstsource/archive.php?classid=5#17

Post

Yeah I thought it might be that. I had read the advice your referred to before. I was just surprised because mingw compiler is just GCC really and I would have thought given that this was done with Linux in mind that it would just compile without any of that stuff.

Had me confused.

I've got it to build a .dll file, but it doesn't work in XT1 or XT2. I get the message in XT1 that "This is not a VST plug-in: monosynth.dll"
It has a midi-in but no audio out connection.

The changes I made specifically were:

plugin.cpp:

Code: Select all

#ifdef __GNUC__
#define main main_plugin
extern "C" __declspec(dllexport) AEffect *main_plugin (audioMasterCallback audioMaster);
// AEffect* main_plugin (audioMasterCallback audioMaster) asm ("main");
#else
AEffect *main (audioMasterCallback audioMaster);
#endif
And in libmonosynth.def under the EXPORTS command I changed the line:

Code: Select all

main
to

Code: Select all

main in
main = main_plugin
Now there were some warnings during compilation that I ignored. I don't know if they're significant:

Code: Select all

Compiling: plugin.cpp
In file included from AudioEffect.hpp:11,
                 from AudioEffect.cpp:16,
                 from plugin.cpp:3:
AEffect.h:35: warning: malformed '#pragma pack(push[, id], <n>)' - ignored
AEffect.h:191: warning: #pragma pack (pop) encountered without matching #pragma pack (push, <n>)
In file included from AEffEditor.hpp:22,
                 from AudioEffect.cpp:20,
                 from plugin.cpp:3:
aeffectx.h:21: warning: malformed '#pragma pack(push[, id], <n>)' - ignored
aeffectx.h:999: warning: #pragma pack (pop) encountered without matching #pragma pack (push, <n>)
plugin.cpp: In member function 'virtual void CPlug::process(float**, float**, long int)':
plugin.cpp:80: warning: 'cue' might be used uninitialized in this function
Linking dynamic library: .\monosynth.dll
Creating library file: .\libmonosynth.a
Process terminated with status 0 (0 minutes, 3 seconds)
0 errors, 5 warnings
Regards
Caleb
Happiness is the hidden behind the obvious.

Post

Only someone familiar with MinGW will be able to figure this out I guess.

You're using Codeblocks now aren't you ? I have another idea ...
What you could do instead though, is try to use the commandline compiler of GCC (if this is possible at all) and then this shouldn't be much different to what's in the script file ("Compile" in the linux zip). Extension has to be ".dll" instead of ".so" for the output file then.

If GCC is not much different on both platforms this could actually work.

Post

Unfortunately doing it manually this way gave me the same warnings.

I know I've seen something somewhere about changes to pragma statements. I'll see if I can find them somewhere.

*sigh*

THIS is the reason I stopped pursuing C++.
Code portability my arse!

Regards
Caleb
Happiness is the hidden behind the obvious.

Post

Woohoo! I worked it out. Yay!
Or at least, I now have a working .dll file in XT1 and XT2.

There seems to be a default number of parameter sliders shown in XT1 that don't operate - but I don't believe this synth was supposed to have any controls anyway.

OK - step 1 - a compiled VST plug-in in Windows.

Now hopefully, the plugin.cpp is going to be static or fairly static and all I have to do is work with a supplimentary header file to implement all my logic. This is the plan yes?

I'm looking forward to some sort of midi-plugin example as initially I'm not really interested in audio plug-ins. I find DSP theory a bit much to cope with. So roll on I say - roll on.

Regards
Caleb
Happiness is the hidden behind the obvious.

Post Reply

Return to “energyXT”