VanillaJuce is a simple example of a complete VST2.4 + AUv2 synthesizer built with JUCE 5.x.
In this context, “complete” doesn't mean that this is a particularly great synthesizer; rather, it means that all of the major plugin requirements are covered, i.e.:
As a synthesizer, VanillaJuce is nothing special; it's not meant to be. Its oscillators are about as simple as possible, and as a result they don't sound very nice, mainly due to aliasing which is particularly noticeable when playing higher-pitched notes. Its envelope generators (which nicely illustrate the use of JUCE's LinearSmoothedValue template class) provide just enough dynamics that VanillaJuce can charitably be called a “synthesizer” rather than an “organ”.
Critically, VanillaJuce has no filters1), and thus some might argue that it's “not a real synthesizer”. I chose to leave out filters and filter envelope generators (EGs) for three reasons:
There are already enough books and internet resources on DSP and synthesizer design, but I found getting started with JUCE to be a major hurdle. The relevant code examples (at https://www.juce.com/tutorials and in the examples folder of the JUCE source code) were either too large (“kitchen sink demos”) or more frequently, too small (not “complete” in the sense I describe above). The complete JUCE-based synthesizer examples I was able to find (e.g. the excellent Obxd) featured so much customized/optimized code that they couldn't serve to illustrate the “JUCE way” of building a synthesizer plugin.
So, after figuring out what I needed the hard way, I decided to provide VanillaJuce as an open-source code example, to help others get started with the JUCE library. For maximum flexibility, I use the MIT License, which permits use in closed-source projects.
Although I have considerable C++ experience, I am not a JUCE expert! I welcome all comments and ideas for how to make VanillaJuce a better example for new users, on the JUCE forum where you can find me as user “getdunne”.
If you haven't yet set up your PC or Mac to work with JUCE, great! I have a ton of stuff to tell you, which might save you some time and frustration. Go to Starting from scratch with JUCE.
If you already have JUCE set up, but are not yet familiar with how to use the Projucer to start a new project, have a look at Getting started with the Projucer before moving on the code review pages below.
Since writing this, I have added two enhancements to the basic project, accessible via separate branches of the GitHub repo: