Skip to content

Getting Started

passivist edited this page Jan 22, 2017 · 13 revisions

GRNLR - developing a granular synthesis VST/AU plugin with the JUCE framework

About the Tutorial

This tutorial assumes that you have not written any "serious" C++ before but have like me programmed in artist oriented programming languages like SuperCollider, Processing, OpenFrameworks or PD/MAX. This isn't really an in depth C++ tutorial, which I don't want and am not qualified to write. Since I am not really a very skilled or experienced C++ programmer it is not an authoritative guide but rather a look at my own learning process. It documents my journey, from a relatively finished concept and prototype in SuperCollider, to a working VST/AU plugin. So I will sometimes reference the process of "porting" parts of the program from SuperCollider to JUCE.

Some knowledge in digital audio might help you in following this tutorial but I'll try to keep the technical details as sparse and simple as possible.

About granular synthesis

Granular synthesis is a form of sound synthesis in which very short sounds called grains are arranged into a more or less continuous stream of sound. The notion of discrete sound particles was first introduced by Dennis Gabor (1900 - 1979) in an attempt to devise a way to analyze sound. The first musical works working with the technique were composed by Iannis Xenakis (1922 - 2001) influencing composers like Horacio Vaggione or Curtis Roads. I recommend that if you want to learn more about granular synthesis you read Curtis Road's excellent book "Microsound".

Getting started

JUCE can be obtained from the JUCE Website or from the JUCE github project. JUCE is free for open source projects but if you want to keep your source closed you will have to get a commercial license. Before starting with this tutorial I recommend following at least the "Getting started with the Projucer" tutorial and the "Create a basic Audio/MIDI plugin Part 1" tutorial. For Linux users there is also a handy list of all the dependencies you'll need.

If you want to learn a bit of C++ beforehand I can recommend this "LearnCpp.com" tutorial as well as cplusplus.com as a general resource. There are a lot of books on C++. There is a very thorough post on stackoverflow listing all the best C++ books. Stackoverflow in general is a very good resource to looking up programming related questions. Once you are comfortable with your IDE of choice and the Projucer as well as the Plugin-Host you can start by making some plans.

Making plans

Because I started out with a working prototype that had all the features that I wanted to implement, I first thought about which of these features I wanted to have in the plugin version of the program and which I wanted to discard. For me JUCE isn't really a platform I would prototype on (yet?). So I think it is worthwhile to prototype in a more forgiving environment where you don't really have to worry about small changes breaking everything.

For me this platform was SuperCollider. I have implemented granular synthesizers in PureData and MAX but chose SuperCollider for its flexibility. I also suspected it being a little easier to port to JUCE. SuperCollider is text based, unlike PD/MAX which use graphic patching, so for me the path to C++ seemed to be a bit shorter. While it wasn't really possible to use much of the code I wrote for the prototype itself, a much more important advantage was that SuperCollider is open source. Because the source code is freely available I was able to look at solutions to some programming and signal processing related problems I had no immediate or obvious solutions to. Looking into the SuperCollider source was especially helpful when implementing the grain envelope and more technical DSP problems like interpolation.

<<< last Chapter next Chapter >>>