Code Your Own Synth Plug-Ins With C++ and JUCE
Minimum price
Suggested price

Code Your Own Synth Plug-Ins With C++ and JUCE

About the Book

Audio programming is a lot of fun, but it has always been hard to get into. Most of the existing teaching materials aren't written for the audio programming enthusiast and generally don't cover the topic of plug-ins, also known as VSTs. Until now!

Code Your Own Synth Plug-Ins With C++ and JUCE provides a clear introduction to the world of audio programming, using a real software synthesizer as the example project. This book is for programmers of all experience levels who want to learn how audio plug-ins work under the hood, and how these synths can magically create sound out of nothing.

Why this book? Some time ago I came across the source code for a virtual analog synthesizer plug-in called MDA JX10. I wanted to understand how this synth worked and so I started going through the code to clean it up and add comments. While doing this, I realized that this synth would make an excellent topic for a book — it has a little bit of everything one needs to know to get started with audio development and digital signal processing, tied neatly together into a working plug-in.

Most plug-ins these days are written using the popular JUCE audio programming framework. There aren't many books available about JUCE — or even about how to make synthesizers — and so I decided I might as well write one, explaining how to code a modernized version of the MDA JX10 synth from scratch.

This book takes you on a journey of building a software synthesizer step-by-step, starting from the very basics and ending up with a full-featured VST or Audio Unit plug-in that can be used in any of the popular DAWs such as Logic Pro, REAPER, FL Studio, Cubase, Bitwig Studio, and others.

Topics covered in the book:

  • Synthesizer design: What synthesizers are and the different building blocks they are made from.
  • How and why to use JUCE for making audio plug-ins.
  • All about handling MIDI.
  • What digital audio is, and the basics of digital signal processing (DSP).
  • Oscillators, from a simple sine wave to a bandlimited sawtooth, and how to combine oscillators into a square wave with pulse width modulation (PWM).
  • Using an analog-style ADSR envelope to shape the sound over time.
  • Polyphony and voice stealing, legato-style playing, handling the sustain pedal, and other voice management topics.
  • Filters and how to use them to make your synth sound awesome.
  • Modulation using velocity, LFO, filter envelope, and MIDI CC such as the modulation wheel.
  • Parameter smoothing and other ways to avoid audio glitches.
  • How to communicate between the audio thread and the UI thread, the proper way.
  • Building a good-looking user interface for the plug-in.
  • And lots more: factory presets, glide, avoiding aliasing, adding a MIDI learn function, and so on...

This book packs a lot of information into its 360 pages. It's a follow-along tutorial of how to create a complete synthesizer plug-in, with lots of explanations of why you're doing everything and hints of new avenues to explore. If you've ever wondered how software synths work — or how to build your own — then this book is a great place to start learning!

Is this book for you? Maybe you've been trying to get into audio programming but didn’t know where to start, or you’re just curious how audio plug-ins work, or perhaps you were overwhelmed by the amount of math in a typical DSP course... This book explains it all. You'll learn the fundamentals of making audio plug-ins in general and synths in particular, in an easy-to-follow guide that is light on math and heavy on being practical. The only prerequisite is some knowledge of C++ and a Mac, Windows, or Linux computer.

Why is this book using C++? It's true that C++ doesn't have a great reputation, but because it produces fast code it's the industry standard programming language for audio development, and JUCE is the standard framework. I've kept the C++ in this book as simple as possible, so don't let C++'s notoriety scare you off. Anyone with basic programming skills should be able to follow along with this book.

Do you need to know math to understand this book? Not at all! While being familiar with math can be very helpful for someone pursuing a career in DSP or audio development, writing a synthesizer plug-in can be done with high-school level math skills. There is only a little math in this book and you can mostly skip it if it gives you the creeps.

The source code for the book is available on GitHub, including several audio demos of what the synth sounds like. Go ahead, check it out and then come back to buy this book!

  • Share this book

  • Categories

    • C and C++
    • Music
    • Computer Science
    • Computers and Programming
    • Creative Non-Fiction
    • Software Engineering
    • Game Development
  • Feedback

    Email the Author(s)

About the Author

Matthijs Hollemans
Matthijs Hollemans

Matthijs Hollemans is a professional audio programmer. In his spare time he's a hobbyist musician who really needs to learn how to play the piano properly. Matthijs wrote the best-selling book The iOS Apprentice and is a co-author of Machine Learning by Tutorials from Kodeco (formerly Check out his audio development blog at

Reader Testimonials

Luke KB
Luke KB

I've been thoroughly enjoying working through your new synth plugin book. As a budding audio programmer it's been super helpful and inspiring to say the least :) Thanks again for making this book. There doesn't appear to be anything else like this available!

Pedro Gonzalez Gonzalez
Pedro Gonzalez Gonzalez

I purchased your book "Code your own Synth Plugin...". I am really glad I did. I was not expecting to be as good as it is. Succinct, to the point and with clear explanations. Second to none!

Table of Contents

  • Acknowledgments
  • About the author
  • Introduction
  • Chapter 1: What is a synth, exactly?
  • Chapter 2: Getting started with JUCE
  • Chapter 3: MIDI in, sound out
  • Chapter 4: Handling MIDI events in JUCE
  • Chapter 5: Introduction to oscillators
  • Chapter 6: The sawtooth oscillator
  • Chapter 7: Plug-in parameters
  • Chapter 8: The ADSR envelope
  • Chapter 9: Combining oscillators
  • Chapter 10: Polyphony & voice management
  • Chapter 11: Modulation
  • Chapter 12: The filter
  • Chapter 13: User interface
  • Chapter 14: Where to go from here

The Leanpub 60-day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub