blog

Designing Audio Effect Plug-ins in C++ (book review)

by

Image of Book cover for Designing Audio Effect Plugins in C++

I’ve been writing a series of posts here over the last few months discussing the JUCE C++ application framework and how useful it’s been in creating the ‘Scumbler’ looping audio performance application that’s my current nights & weekends project. One of the important requirements that I had for the project was that it be able to use existing VST or AU audio effects plug-ins to process the audio during performance.

Over the years since I graduated with a degree in electronic and computer music, I’ve accumulated a fairly large shelf of books on digital signal processing theory and applications. Earlier this year, Focal Press released what’s the most usable book on writing audio effects plug-ins. It’s very easy to find books for theorists, or for people who already have very heavy math backgrounds explaining the concepts behind DSP; it’s rarer to find resources targeted at interested and motivated practitioners. Anyone coming to this book with a relatively solid background in C++ programming and high-school math (trig and at least pre-calculus) should be able to work through it and come out the other end with an understanding of much of the DSP that’s needed out in the wild.

What’s Included

Any book like this needs to include a chapter on basic digital audio theory, and having read a lot of those chapters over the years, this one should be especially understandable to someone new to the concepts — the author is a professor of music engineering at the University of Miami‘s Frost School of Music, and it’s clear that the book has benefited from many semesters of refinement from teaching the material to students there. The book proceeds in a logical fashion from "this is why you can turn sound into numbers and back into sound without losing anything" into the central concept of the math behind digital filters through the major categories of digital filter topologies, delay lines, oscillators, reverbs, and the various ways that parameters can be modulated.

RackAFX

RackAfx

From my point of view, the one thing that really sets this book apart from any of the others I’ve read is that it uses a piece of software developed by the author that jumpstarts your plug-in development. The RackAFX software:

  • Creates all of the project files and boilerplate source files that you need to build a plug-in. The version available at publication time supported VST plug-ins on Windows; a more recent version can also output the files needed to build that plug-in as an Apple AU plug-in compiled with XCode.
  • Defines a set of C++ classes that abstract out almost all of the functionality that’s common between all audio plug-ins. Your code is then just doing whatever calculations need to be done to update coefficient values as the user changes parameter values and implement the actual sample-by-sample effect algorithm.
  • Hosts your plug-in while in development.
  • Provides realtime analysis tools for your plug-in — both oscilloscope and spectrum analysis. Having these available directly instead of needing a heavier analysis tool like MatLAB is a great help while developing.

It’s a minor quibble of mine that RackAFX only runs under Windows, but in practice all that means is that I need to start up Parallels Desktop and get Windows 7 running. That’s a good excuse to get a refill of my coffee while the hard drive spins, so everything comes out even in the end on this point.

The RackAFX software and a boatload of additional content not in the book are available at the author’s website: http://www.willpirkle.com/

Even if you already have some experience in this topic, this is an excellent book to have on the shelf.

Disclosure: The author is a friend, and we were both in grad school at U Miami at the same time.

+ more