Login / Register 0 items | $0.00 New @ KVR
User avatar
vortico
KVRist
 
164 posts since 19 Jul, 2008

Postby vortico; Mon Jun 04, 2018 11:42 am HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

I've created an open-source project with the goal of reducing the time it takes to get up and running with a "Hello world" plugin in many different plugin formats using nothing but the terminal and Makefiles.

Even for experienced programmers, it is often difficult to configure your environment to switch from VST to Audio Unit development, or anything to LV2 development, for example. You might be great at DSP and learning new APIs, but nobody has a natural talent for say, VST, until they use it for some time. But how do you learn the API it if you can't build an example project easily?

This project attempts to reduce the frustration from multiple hours of aimless hacking into a (hopefully) two-minute process of git clone, cd <project>, read README, and make, for each plugin type.

https://github.com/AndrewBelt/HelloDAW

The only caveat is that right now I'm too busy with VCV Rack to add formats other than VST2 for the next couple months. It would be fantastic if someone familiar with Audio Units, AAX, or LV2 could contribute a "Hello world" template for one of those formats through a pull request, based on my VST2 implementation. Eventually, this would benefit the open-source VCV Bridge plugin, for those who wish to use VCV Rack in non-VST DAWs. After more formats are added, hopefully this project will help new plugin developers get started more quickly, or assist experienced developers in porting their existing plugins with less friction.

Thoughts or feedback?
VCV Rack open-source virtual modular synthesizer
hibrasil
KVRian
 
764 posts since 23 Jun, 2002, from Huddersfield, UK

Postby hibrasil; Wed Jun 06, 2018 1:34 am Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

It’s a good idea but a lot of work . Are you determined not to use existing wrappers/plug-in frameworks?

With wdlol iplug I like it to be similarly simple, but I didn’t do make files yet for win/Mac mainly because requiring visual studio 2017 or xcode 9 feels less errorprone but I might be wrong . Probably going to include cmake scripts eventually. I do like the simplicity of your build system in VCV rack
Last edited by hibrasil on Wed Jun 06, 2018 2:27 am, edited 1 time in total.
My Website | WDL-OL | Web Audio Modules - WAMs | Oli Larkin Plugin's Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
mystran
KVRAF
 
4948 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Wed Jun 06, 2018 2:25 am Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

vortico wrote:Thoughts or feedback?


When you have a channel configuration more complicated than stereo-to-stereo, you should probably implement getInputProperties/getOutputProperties to make sure the host groups the channels correctly (eg. in stereo pairs or whatever).

Also your use of snprintf is not safe, since hosts will generally expect the strings to be null-terminated even if you run out of space (and snprintf will only include the null if the buffer is large enough to fit both the string and the null-character!). Not that it matters here, since the format strings won't ever result in long enough strings, but you might just as well use sprintf if you're trying to rely on this.
Image <- plugins | forum
User avatar
vortico
KVRist
 
164 posts since 19 Jul, 2008

Postby vortico; Wed Jun 06, 2018 3:52 am Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

mystran, I am a bit confused about the intention here. Why would any grouping be needed? Shouldn't the DAW assume that adjacent pairs of channels are always stereo pairs? That seems to be the case in Ableton Live, FL Studio, Reaper, and I think Bitwig. It would make sense if the VST plugin generates 5.1 surround, but this is a very niche use case (even 5.1 recording engineers mostly use stereo instruments and use DAW spatialization.)

A terminating null character is guaranteed if the length passed to snprintf is nonzero. According to POSIX.1-2001, if n > 0, "output bytes beyond the n-1st shall be discarded instead of being written to the array, and a null byte is written at the end of the bytes actually written into the array."
VCV Rack open-source virtual modular synthesizer
User avatar
vortico
KVRist
 
164 posts since 19 Jul, 2008

Postby vortico; Wed Jun 06, 2018 4:27 am Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

@hibrasil: 90% of the reason for creating my own project rather than using an existing framework like IPlug/WDL or JUCE is my preference to use a UNIX-like build system, and that nobody to my knowledge has completely documented all plugin formats using this system. HelloDAW is a project focused primarily on the build system of DAW plugins, not the source code or framework. Unlike IPlug, the user is expected to learn the VST/AU/AAX/LV2/etc API after building a plugin, and HelloDAW supplies the most minimal source in order to "prove" that the plugin is built and works correctly.

I prefer Makefiles for my own projects and recommend other developers to use them because they expose rather than hide build system complexity, allowing developers to understand the entire system from scratch, which is necessary for debugging issues on their own. While Make has its own cruft, I believe that by using a UNIX-like environment, users are more likely to compile all of their favorite plugin formats in 2 minutes each without hitting obstacles than with template IDE projects.

The other 10% is to ensure that I and other users of HelloDAW have the entire VST/AU/AAX/LV2/etc API at their disposal rather than relying on a unified API that might omit some features of certain formats. This allows HelloDAW-based projects that require unusual hacks to more easily achieve their goal at the expense of being more tedious to develop.

However, if HelloDAW is completed, it would be relatively easy for someone to design their own unified API that targets a particular application by forking HelloDAW. (Perhaps even a fork of WDL-OL could be placed on top of HelloDAW!)

I believe the current difficulty of building DAW plugins is the primary reason an explosion of open-source collaboration has not occurred on the same scale as web frameworks, video game engines, or databases. Passerby contributers would not be possible if there is 30 minutes of overhead per contributer to build and test a plugin.
VCV Rack open-source virtual modular synthesizer
mystran
KVRAF
 
4948 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Wed Jun 06, 2018 5:55 am Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

vortico wrote:mystran, I am a bit confused about the intention here. Why would any grouping be needed? Shouldn't the DAW assume that adjacent pairs of channels are always stereo pairs?


I remember having problems with this back when I first wanted to add a second input to a plugin. I honestly can't remember which host it was though.

A terminating null character is guaranteed if the length passed to snprintf is nonzero. According to POSIX.1-2001, if n > 0, "output bytes beyond the n-1st shall be discarded instead of being written to the array, and a null byte is written at the end of the bytes actually written into the array."


Yeah... except this is the revised C99 version of the function and on Win32 you'd get the classic version (well, strictly speaking a broken version of the classic version, since asking for the length of the buffer required didn't work) but apparently Microsoft now says:
MSDN wrote:Beginning with the UCRT in Visual Studio 2015 and Windows 10, snprintf is no longer identical to _snprintf. The snprintf function behavior is now C99 standard compliant.


So .. I guess if you're compiling against UCRT you should be safe... but then you should check for this with preprocessor macros or you'll end up with someone using an older compiler and it'll break. ;)
Image <- plugins | forum
User avatar
vortico
KVRist
 
164 posts since 19 Jul, 2008

Postby vortico; Wed Jun 06, 2018 6:11 am Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

If you use a nonstandard C99 or C++11 compiler or anything non-POSIX, then I suppose you could argue that anything can happen. I highly recommend that new and experienced developers avoid nonstandard compilers and standard libraries at all costs and instead use glibc, libstdc++, or libc++. This is why HelloDAW supports both gcc and clang on all three primary operating systems. 10 years ago, we didn't have this luxury so we were forced to deal with competing C and C++ standard implementations by our operating system vendor, but those days are thankful long gone. This is another purpose of this project, to allow people to easily switch away from Visual Studio's C++ compiler.
VCV Rack open-source virtual modular synthesizer
stratum
KVRAF
 
1852 posts since 29 May, 2012

Postby stratum; Wed Jun 06, 2018 12:16 pm Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

cmake is better than unix make files, if you are just starting, it might be worth a look.
~stratum~
User avatar
vortico
KVRist
 
164 posts since 19 Jul, 2008

Postby vortico; Wed Jun 06, 2018 12:30 pm Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

I disagree, since CMake hides complexity (although not as much as IDEs). Perhaps better than well-written Makefiles are well-written ninja as it also does not hide complexity but doesn't have the cruft of Make. But it's not widely recognized, so I chose Make.
VCV Rack open-source virtual modular synthesizer
stratum
KVRAF
 
1852 posts since 29 May, 2012

Postby stratum; Wed Jun 06, 2018 12:39 pm Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

It's good in the sense that it can generate a solution file for several IDEs.
~stratum~
hibrasil
KVRian
 
764 posts since 23 Jun, 2002, from Huddersfield, UK

Postby hibrasil; Wed Jun 06, 2018 1:24 pm Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

is hiding complexity a bad thing? I wouldn't wish upon my worst enemy some of the shit I've had to deal with with different plug-in formats. Of course it's good to learn what all those settings mean, but maybe that kind of learning is better off on small simple projects
My Website | WDL-OL | Web Audio Modules - WAMs | Oli Larkin Plugin's Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
stratum
KVRAF
 
1852 posts since 29 May, 2012

Postby stratum; Wed Jun 06, 2018 1:37 pm Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

In my opinion cmake doesn't really hide complexity, it messes up semicolons, though:) After several years of use, that's the only complaint I have about it. ( if anybody wonders what the problem is: https://stackoverflow.com/questions/115 ... tom-target )
~stratum~
User avatar
vortico
KVRist
 
164 posts since 19 Jul, 2008

Postby vortico; Wed Jun 06, 2018 4:31 pm Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

stratum wrote:It's good in the sense that it can generate a solution file for several IDEs.


That is true, but example IDE projects exist for nearly every plugin project, so you could just use those if you want to use IDEs. In other words, HelloDAW is not for you if you prefer IDEs.

To be honest, I'm not sure how it could be any simpler than this. https://github.com/AndrewBelt/HelloDAW/ ... 2/Makefile
I'd actually wager that a CMakeLists would be more convoluted.
Last edited by vortico on Wed Jun 06, 2018 4:48 pm, edited 2 times in total.
VCV Rack open-source virtual modular synthesizer
User avatar
vortico
KVRist
 
164 posts since 19 Jul, 2008

Postby vortico; Wed Jun 06, 2018 4:33 pm Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

I am somewhat close to a working Audio Unit plugin. I might push what I have soon and ask a couple specific questions since I'm not an experienced MacOS developer (I instead prefer hitting myself with a mallet). After that, I might start learning AAX.
VCV Rack open-source virtual modular synthesizer
mystran
KVRAF
 
4948 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Wed Jun 06, 2018 6:05 pm Re: HelloDAW: "Hello world" examples for VST/AU/AAX/LV2/etc plugins using Makefiles

vortico wrote:To be honest, I'm not sure how it could be any simpler than this. https://github.com/AndrewBelt/HelloDAW/ ... 2/Makefile
I'd actually wager that a CMakeLists would be more convoluted.


That's not really a realistic example though, since it doesn't handle dependency tracking, which is absolutely critical for productivity once your project grows large enough that build times start to get into the minutes.

edit: I mean.. it's not like that necessarily has to add a whole lot of complexity into the Makefiles, but it does add some..
Image <- plugins | forum
Next

Moderator: Moderators (Main)

Return to DSP and Plug-in Development