GetDunne Wiki

Notes from the desk of Shane Dunne, software development consultant

User Tools

Site Tools


vanillajuce

This is an old revision of the document!


VanillaJuce

VanillaJuce is a simple example of a complete VST2.4 + AUv2 synthesizer built with JUCE 5.1.

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.:

  • VST 2.4 compatible plugin builds under Microsoft Visual Studio 2017 (Community version is sufficient)
  • Audio Unit v2 compatible plugin builds under Apple XCode (tested with v8.2.1)
  • Plugin has a simple GUI editor, using JUCE controls only (no custom graphics)
  • Very basic 16-voice synthesizer with 2 oscillators and ADSR amplitude envelope
  • Dynamic editing of sound parameters is supported
  • Saving and recalling sound programs (via plugin host) is supported

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 filters, 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: 1. These things get us into the realm of digital signal processing (DSP), which could greatly complicate what I intended as a simple code example to help the beginning JUCE user get started. (I plan to publish other JUCE examples illustrating DSP.) 2. Pragmatically, there's not much point in adding filtering without first addressing aliasing in the oscillators. 2. The code already illustrates how to create EGs; adding filter EGs wouldn't teach anything new.

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 (GPL v3) code example, to help others get started with the JUCE library.

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”.

Getting started

This is not quite the same as the usual “getting started” documentation for JUCE. That already exists at https://www.juce.com/tutorials. My aim here is to tell you a bunch of things the JUCE tutorials don't tell you, so you can avoid having to learn them all the hard way, as I did.

VanillaJuce code review

(More on the way, please be patient…)

vanillajuce.1504101285.txt.gz · Last modified: 2017/08/30 13:54 by shane