VST3 in Delphi

DSP, Plug-in and Host development discussion.
Eduur
KVRer
6 posts since 21 Jan, 2019

Post Tue Feb 05, 2019 9:39 am

So, see subject.
I was wondering if I am the last (wo)man on earth still doing (hobby) VST development in Delphi... I guess I am, because I was not able to find anything related to VST3 / Pascal on the net. So, a few weeks ago I decided to create a VST3 wrapper for my VST2 plugins. You can see the result on my github page: https://github.com/RuudErmers/RMSVST3

Only tested in Reaper and only the basics.
It is a combined Processor/Controller and implements the following:
- Audio processing (synth or effect), two channel only.
- Midi CC processing
- Parameter processing
- Presets
- Tempo / Playstate.

An example Audio Gain which expands the code to any plugin (just a few lines of code) is available.

Anyone interested in something like this? If so, I would like to expand and improve the quality of the code. But, .. maybe ... I am the only one :(

duncanparsons
KVRAF
8373 posts since 11 Apr, 2003 from now on the flat

Re: VST3 in Delphi

Post Sat Feb 09, 2019 8:33 am

I think tobybear or Christian Budde looked at it some years ago when VST3 first came out, but at the time there were some issues with it, as I recall.. I could be wrong.

When I was doing BetaBugs (RIP) in the mid 00s all my plugs were Delphi based, but I work pretty much all in C++ as I can target both Mac as well as Win. Last I was doing DVST coding, Lazarus/FreePascal weren't exporting plugin UIs properly for Win, let alone Mac, it was a terrible mess. When the first version of Delphi targeting native Mac came out in 2010/11 I was hopeful for well ordered UI control for Mac, but the dylibs it created weren't up to it at the time for whatever reason. It just wasn't handling the UI handles correctly, FireMonkey was getting in the way when lower level access to the pointers was needed- I hope this has been updated!

However, I'm glad to see you are doing this, and I hope it all goes well for you :-)
Image

Eduur
KVRer
6 posts since 21 Jan, 2019

Re: VST3 in Delphi

Post Thu Feb 21, 2019 7:19 am

Duncan, thanks for your reply. I was waiting for all other Delphi fanatics, but I guess there aren't (m)any left. Too bad, but understandable. Creating this VST3 interface was fun because there are some tricky things with multiple inheritance and COM stuff I knew not much about. But I guess it will not be the product of the year. Too bad as Delphi right now is very stable and has a nice Community Edition (finally).

User avatar
HrastProgrammer
KVRist
34 posts since 10 Sep, 2007 from CPU

Re: VST3 in Delphi

Post Sat Feb 23, 2019 1:28 am

Great work! Thank you!

I am one of the rare fanatics who use Delphi and FreePascal/Lazarus for DSP-ing and VST-ing. My Tranzistow and Diodow synthesizers were initially developed in Delphi 7 (32-bit only), later ported to XE7 (for both 32-bit and 64-bit versions) and Lazarus (Windows/Linux, 32/64-bit). The complete audio engine is 100% assembler using SSE3 and AVX2 to gain maximum performance while "high-level" functions (GUI, patch management, etc) are Pascal. I also used Lazarus to port Diodow to Raspberry Pi3 and ARM/NEON assembler.

I will certainly consider this if I ever decide to port Tranzistow or Diodow to VST3 ...

Thanks again.

agharta
KVRist
90 posts since 10 Jan, 2018

Re: VST3 in Delphi

Post Sat Feb 23, 2019 2:10 am

As someone who wrote an MP3 player in Delphi 7 around 2001 it's great to see it still alive for deeper audio work.
The Player did have some standout features I must admit and was extremely fast even when searching across multiple tags with a database of 30K songs.
The same search on other major players at the time that I tested either crashed or was about 100 times slower making them unusable.
I have a more recent version of Delphi but it's so different than V7 and I'm so out of the loop that converting it would be too much I think.

quikquak
KVRian
522 posts since 6 Aug, 2005 from England

Re: VST3 in Delphi

Post Sun Feb 24, 2019 12:15 am


Topcheese
KVRist
223 posts since 12 Nov, 2017

Re: VST3 in Delphi

Post Sun Feb 24, 2019 1:01 am

Band in the Box products are written in Delphi.

trewq
KVRist
299 posts since 24 Nov, 2008

Re: VST3 in Delphi

Post Sat Mar 02, 2019 1:25 pm

I am just starting to research making a plugin version of ChordwarePA (Delphi Pascal). So yeah, I'm interested. And thanks for the work you do and share.

http://www.chordwarepa.com/index.html

Steve

User avatar
vasyan
KVRist
183 posts since 17 Feb, 2013 from Krasnoyarsk, Siberia, RU

Re: VST3 in Delphi

Post Wed Mar 20, 2019 4:48 am

Eduur wrote:
Tue Feb 05, 2019 9:39 am
I was wondering if I am the last (wo)man on earth still doing (hobby) VST development in Delphi...
You're not alone, I'm such a Delphi fanatic. I also wrote my PolyGAS synthesizer on it.
I am pleased to test your engine VST3. :tu:

User avatar
vasyan
KVRist
183 posts since 17 Feb, 2013 from Krasnoyarsk, Siberia, RU

Re: VST3 in Delphi

Post Wed Mar 20, 2019 5:33 am

Eduur wrote:
Tue Feb 05, 2019 9:39 am
You can see the result on my github page: https://github.com/RuudErmers/RMSVST3
Your VST3 example is not compiled. :(
Here are the errors:

Code: Select all

Checking project dependencies...
Compiling RMSMyVST3.dproj (Debug, Win32)
brcc32 command line for "RMSMyVST3.vrc"
  c:\program files (x86)\embarcadero\studio\16.0\bin\cgrc.exe -c65001 RMSMyVST3.vrc -foRMSMyVST3.res 
dcc command line for "RMSMyVST3.dpr"
  RMSMyVST3.dpr   
[dcc32 Fatal Error] UCPluginFactory.pas(29): F2613 Unit 'CodeSiteLogging' not found.
Failed
Elapsed time: 00:00:01.5
Unfortunately, I am not a telepath to find out the code of the CodeSiteLogging.pas, which is not in your repository, as well as an indication of where to find it. :evil:

tobybear
KVRian
876 posts since 11 Jun, 2001 from Munich, Germany

Re: VST3 in Delphi

Post Wed Mar 20, 2019 6:44 am

Glad to see that good old Delphi/Lazarus/Pascal still gets some love! Keep up the good work!

User avatar
vasyan
KVRist
183 posts since 17 Feb, 2013 from Krasnoyarsk, Siberia, RU

Re: VST3 in Delphi

Post Wed Mar 20, 2019 6:52 am

tobybear wrote:
Wed Mar 20, 2019 6:44 am
Glad to see that good old Delphi/Lazarus/Pascal still gets some love! Keep up the good work!
VST3?

User avatar
vasyan
KVRist
183 posts since 17 Feb, 2013 from Krasnoyarsk, Siberia, RU

Re: VST3 in Delphi

Post Wed Mar 20, 2019 6:55 am

In general, we managed to compile your code after what is called “танцы с бубном” in Russia (dancing with a shaman drum). :wink:
What version of Delphi did you use for the compilation?
Fixed a lot of errors before the plugin was compiled:

Code: Select all

[dcc32 Error] UCEditController.pas(106): E2003 Undeclared identifier: 'CodeSite'
[dcc32 Error] UUIDHelper.pas(27): E2250 There is no overloaded version of 'IntToHex' that can be called with these arguments
[dcc32 Error] UCEditController.pas(75): E2010 Incompatible types: 'Pointer' and 'IPlugView'
Ugly decorated code. As Russian programmers say "хуёвый код" (bad code).
In each module, you have a link to a non-existent CodeSite module.
Do not be lazy and correct this error by using conditional statements.

Code: Select all

{$IFDEF CodeSite}
CodeSite.Send('Bla-Bla-Bla');
{$ENDIF}
The same applies to the used section:

Code: Select all

{$IFDEF CodeSite}
uses CodeSiteLogging;
{$ENDIF}
Compiled plugin does not work in FL Studio 12.

I’ll take a close look at the translation of your headlines from C to Pascal. The first thing that already caught my eye was your use of string instead of AnsiString.

Eduur
KVRer
6 posts since 21 Jan, 2019

Re: VST3 in Delphi

Post Wed Mar 20, 2019 10:03 pm

Hi Vasyan, thanks for your reply and remarks!
I used the almost latest Community Edition XE10.2 RIO for compilation.
As I stated in the readme :) you should install CodeSite Express from the GetIt repositery, you won't regret it.
I don't get the errors you get, in fact everything compiles cleanly. What version are you using?
On AnsiStrings/string. String is the default preferred way of working with strings in Delphi. The AnsiString construction is only needed because the VST3 interface requires it.
I did update the code yesterday on github, with a new small synth and also FruityPlug output. The VST3 is running in FL Studio.
BTW. I looked at your PolyGAS and it looks and sounds great!

User avatar
Vokbuz
KVRist
63 posts since 24 Aug, 2014

Re: VST3 in Delphi

Post Thu Mar 21, 2019 2:09 am

As Russian programmers say "хуёвый код" (bad code)
OT: Russian programmers more likely to say "говнокод". Bad code is a very polite translation. No offence. :)

Return to “DSP and Plug-in Development”