Book review: Designing Audio Effect Plug-Ins in C++: With Digital Audio Signal Processing Theory

When I looked for an audio signal processing book, I found the classic DAFX: Digital Audio Effects, but the code is mainly Matlab. Was there a book with C++ examples? That’s how I found out about this book from Will Pirkle.

Content and opinions

The book mainly describes how to write plugins with the author’s own API. What is interesting is that there is an UI to create GUIs and that will update the underlying code automatically. It is still more limited than JUCE or wdl-ol, but it seems to be an interesting start for beginners.

So first, the author introduces how digital signal processing is part of a programmer’s life, and what are the different steps of digitization. The author tries here to be quite explicit of the different pieces, but it gets also somewhat confusing. After the third chapter, I managed to understand a little bit why, as it seems that the author considers filter theory as mainly LTI filters, which explains the block diagrams.

The second chapter is… bad. It’s difficult to make a worse chapter on coding actually. Hungarian notation is something of the past, and the author is clearly confused by declaration and implementation: __stdcall is Windows only, it is supposed to be for all method in a class (why not for the constructor and destructor?) and never for the actual implementation of a method. This is an example of the author not really understanding what he is using there. It gets worse with a pseudo difference between C and C++ libraries. Disclaimer: there are no differences. What the author claims are differences are differences of programming, between imperative programming and object-oriented programming. I’m stoping here because if I start speaking about headers and libraries, my head is going to explode, as the explanations are just ludicrous.

Back to chapter 3, laying down the basis of all future plugins. The pattern that the author uses is quite simple albeit a little bit anti-clean code, but it is better than chapter 2 (how could it be worse anyway??).

Chapter 4 starts bringing some LTI theory. The author tries to introduce as clearly as possible complex numbers and how they play with signal processing theory. The author also abides by the official way of writing math with them. Too bad he is that strict with math notation and then fails to do the same for polynomial names: a(n) is always the feedback polynomial and b(n) the feedforward, not the other way around. This shift in notation just means that people will get confused when reading another book like my personal reference Adaptive Filter Theory.

Chapter 5 builds on the previous chapter with some more complex filters, but there as well, BIG mistake in the definition of the polar notation (what happens if both real and imaginary parts are negative?). Too much time is spent on manually getting the amplitude of a filter response when e have now computers to give us the results in a nice format (Python or Matlab for instance). A little bit too much time is spent on the z transform, but I may be a little bit biased now, as this notation is something I’m used to, but not for beginners. And the accumulation of approximations really got to me by then.

The next chapter addresses more general filters, the IIR filters family. Except for the issue of the naming convention, the chapter is actually quite interesting. There are different kinds of second order filters, I learnt about some, and I think it is in this chapter that the analog to digital frequency shift is introduced and properly explained. The chapter after that introduces delays and circular buffer. Soo bad the circular buffer is not a class on its own, but otherwise, the approach is interesting, and there is also a start of modularity/reutilisability.

Chapter 8 returns on feedforward only filters with a different name, FIR. The issue of designing them is almost tackled (I half expected the author to explain the Parks-McClellan algorithms, but instead, the author expects the user to use his GUI). No mention of FFT convolution here, a little bit sad, and again a wrong definition of some filters, mainly MA (Moving Average), as these are defined in filter theory as… FIR filters. It actually has nothing to do with averaging. Also a Median filter is not a FIR, as it is not a LTI filter.

By this time, I was quite disappointed by the book, but there are still interesting points. Chapter 9 tackled oscillators in a good way, I think. Even if a proper complex sinus oscillator is not presented, there are enough kind of oscillators. The next chapter merges delays and modulation with modulated delays like flangers, chorus… I don’t have the same definition of chorus (I’m using the one from DAFX instead), but the different plugins are good with different blocks put together. On reverb algorithms, I don’t have much to say. There is a good talk on the “old” theory of algorithmic reverbs, not sure it was mandatory, but at least there is some blocks for doing your own algorithmic reverb. Of course, convolution reverb is just a FIR filter! There is an additional chapter on modulated filters, perhaps not as interesting from a theoretical point of view, but a lot of different ideas for plugins.

The last meaningful chapter is dedicated to dynamic plugins. There is only one plugin in the end, but the way the author presents dynamic processing with compressor and expander is the proper one. He doesn’t confuse the different types of compressor and expander, and shows that they are different faces of the same coin. Kudos for this, as there are a lot of people who market “new” types of plugins when they are just special cases of compression or expansion.

The last chapter wraps up some missing specific plugin that developers can encounter but that didn’t fit any category. Still good to have.

Conclusion

In the end, the book is not great, it is not that bad if the computer science part is not considered and if we forgive the author some missed conventions. It browses through all the usual kinds of plugins, and as such achieves the introduction to a new field for a beginner. It’s just a shame that the code is so awful.

Leave a Reply