{"id":10188,"date":"2022-09-14T23:00:00","date_gmt":"2022-09-14T20:00:00","guid":{"rendered":"https:\/\/handoli.com\/index.php\/2022\/09\/14\/new-book-code-your-own-synth-plug-ins-with-c-and-juce\/"},"modified":"2022-09-14T23:00:00","modified_gmt":"2022-09-14T20:00:00","slug":"new-book-code-your-own-synth-plug-ins-with-c-and-juce","status":"publish","type":"post","link":"https:\/\/handoli.com\/index.php\/2022\/09\/14\/new-book-code-your-own-synth-plug-ins-with-c-and-juce\/","title":{"rendered":"New book: Code Your Own Synth Plug-Ins With C++ and JUCE"},"content":{"rendered":"<p>It happened again, I wrote a new book!<\/p>\n<p>One of the places I hang out online is <a href=\"https:\/\/www.theaudioprogrammer.com\/discord\">The Audio Programmer Discord<\/a>, a nice and friendly community for people who are into creating audio software. New folks show up on a regular basis, wanting to learn how to create audio plug-ins such as synthesizers, and ask for book recommendations.<\/p>\n<p>The problem is, until now <strong>there wasn\u2019t any book I could recommend<\/strong> as a good place to start from. To learn audio programming, you have to piece the information together yourself from all over the place: college textbooks, blog posts, videos, obscure forums, old mailing list archives\u2026 That\u2019s a big hurdle to take, especially for people who are new to programming.<\/p>\n<p>Books about making synths do exist, but none of them offer a complete starter course that takes you from zero knowledge to a finished plug-in. The closest is Will Pirkle\u2019s <em>Designing Software Synthesizer Plugins in C++<\/em>, but I can\u2019t really recommend the second edition to beginners and the first edition is hard to find (and outdated). Books like that are definitely very useful, but not as a first book.<\/p>\n<p>And so I figured here is a book I could write:<\/p>\n<p><strong>How to get started from scratch with no audio programming or DSP knowledge, and through step-by-step explanations learn to build a real synthesizer plug-in.<\/strong><\/p>\n<figure class=\"image\">\n  <a href=\"https:\/\/machinethink.net\/images\/synth-book\/sine@2x.jpg\"><img decoding=\"async\" src=\"https:\/\/machinethink.net\/images\/synth-book\/sine.jpg\" alt=\"The book cover\"\/><\/a><br \/>\n<\/figure>\n<p>Great idea\u2026 but a tutorial-style book like that requires an example project, and while I did have some synthesizer code lying around, none of it was suitable as teaching material.<\/p>\n<p>Then one day I stumbled upon <strong>MDA JX10<\/strong>. The <a href=\"http:\/\/mda.smartelectronix.com\/\">MDA plug-ins<\/a> are a legendary set of freeware audio plug-ins from the early 2000s that were graciously donated as open source by their author. Being two decades old, these plug-ins are obviously not the latest and greatest in audio technology \u2014 that said, they do demonstrate the fundamentals of audio signal processing quite well.<\/p>\n<p>JX10 in particular is a fun little virtual analog synth that has a bit of everything you need to know to write your own synths. So, I took this existing project, modernized the code and ported it to the <strong>JUCE framework<\/strong>, and turned it into what I think is a compelling story of how to make sound with computers.<\/p>\n<p>Now when someone asks, <strong>\u201cHow do I get started in synthesizer programming?\u201d<\/strong>, I can point them to my own book, <a href=\"https:\/\/leanpub.com\/synth-plugin\">Code Your Own Synth Plug-Ins With C++ and JUCE<\/a>.<\/p>\n<figure class=\"image\">\n  <a href=\"https:\/\/machinethink.net\/images\/synth-book\/book-cover@2x.jpg\"><img decoding=\"async\" src=\"https:\/\/machinethink.net\/images\/synth-book\/book-cover.jpg\" alt=\"The book cover\"\/><\/a><br \/>\n<\/figure>\n<p>What is this book about? It\u2019s <strong>360 pages of detailed explanations<\/strong> of how to create a software synthesizer plug-in that can be used in all modern DAWs such as Logic Pro, REAPER, FL Studio, Cubase, Bitwig Studio, GarageBand, and others. You\u2019ll learn the theory of how synthesizers work and how to implement the underlying digital signal processing (DSP) algorithms.<\/p>\n<div class=\"note\">\n<p>Even if you\u2019re not really into synths, this book is a good place to start because you\u2019ll learn the foundations of dealing with digital audio and making plug-ins, and that knowledge transfers to any kind of audio programming.<\/p>\n<\/div>\n<p>The programming language used is C++, as that is the industry standard for writing <strong>efficient audio processing<\/strong> code. But as this is an introductory book, I kept the C++ shenanigans to the bare minimum. The book aims to be accessible for anyone with basic knowledge of C or C++, or even languages such as Swift or JavaScript, and who knows their way around Xcode or Visual Studio.<\/p>\n<p>Even better: you only need <strong>high-school level math<\/strong> to follow along. There is <em>some<\/em> math in this book \u2014 you can\u2019t escape this when doing DSP \u2014 but the focus is on code, not math.<\/p>\n<p>The audio framework used is <a href=\"https:\/\/juce.com\/\">JUCE<\/a>. Pretty much everyone making audio plug-ins uses JUCE, as this allows you to program the whole thing just once \u2014 including the user interface \u2014 and deploy to Mac, Windows, Linux, and iOS from the same codebase. I\u2019m generally not a fan of cross-platform frameworks but for JUCE I\u2019m making an exception!<\/p>\n<p>The book is <a href=\"https:\/\/leanpub.com\/synth-plugin\">for sale at Leanpub<\/a>. You can <strong>download a free sample PDF<\/strong> or EPUB with the first three chapters to try before you buy. The book\u2019s <a href=\"https:\/\/github.com\/hollance\/synth-plugin-book\">source code is on GitHub<\/a>, so you can already check out the finished synthesizer project. That repo also has some <a href=\"https:\/\/github.com\/hollance\/synth-plugin-book\/tree\/main\/Audio%20Demos\">audio demos<\/a> of what the synth sounds like.<\/p>\n<p>Here is a screenshot of the synth plug-in running in REAPER:<\/p>\n<figure class=\"image\">\n  <a href=\"https:\/\/machinethink.net\/images\/synth-book\/reaper@2x.jpg\"><img decoding=\"async\" src=\"https:\/\/machinethink.net\/images\/synth-book\/reaper.jpg\" alt=\"The synth on a track in a REAPER project\"\/><\/a><br \/>\n<\/figure>\n<p>The table of contents for the book:<\/p>\n<ul>\n<li>Introduction<\/li>\n<li>Chapter 1: What is a synth, exactly?<\/li>\n<li>Chapter 2: Getting started with JUCE<\/li>\n<li>Chapter 3: MIDI in, sound out<\/li>\n<li>Chapter 4: Handling MIDI events in JUCE<\/li>\n<li>Chapter 5: Introduction to oscillators<\/li>\n<li>Chapter 6: The sawtooth oscillator<\/li>\n<li>Chapter 7: Plug-in parameters<\/li>\n<li>Chapter 8: The ADSR envelope<\/li>\n<li>Chapter 9: Combining oscillators<\/li>\n<li>Chapter 10: Polyphony &amp; voice management<\/li>\n<li>Chapter 11: Modulation<\/li>\n<li>Chapter 12: The filter<\/li>\n<li>Chapter 13: User interface<\/li>\n<li>Chapter 14: Where to go from here<\/li>\n<\/ul>\n<p>If this sounds like something you\u2019d be interested in, <a href=\"https:\/\/leanpub.com\/synth-plugin\">go get the book<\/a>. Cheers!<\/p>","protected":false},"excerpt":{"rendered":"<p>It happened again, I wrote a new book! One of the places I hang out online is The Audio Programmer Discord, a nice and friendly community for people who are into creating audio software. New folks show up on a regular basis, wanting to learn how to create audio plug-ins such as synthesizers, and ask [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10189,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rop_custom_images_group":[],"rop_custom_messages_group":[],"rop_publish_now":"initial","rop_publish_now_accounts":[],"rop_publish_now_history":[],"rop_publish_now_status":"pending","footnotes":""},"categories":[1],"tags":[],"class_list":["post-10188","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-explore"],"_links":{"self":[{"href":"https:\/\/handoli.com\/index.php\/wp-json\/wp\/v2\/posts\/10188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/handoli.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/handoli.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/handoli.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/handoli.com\/index.php\/wp-json\/wp\/v2\/comments?post=10188"}],"version-history":[{"count":0,"href":"https:\/\/handoli.com\/index.php\/wp-json\/wp\/v2\/posts\/10188\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/handoli.com\/index.php\/wp-json\/wp\/v2\/media\/10189"}],"wp:attachment":[{"href":"https:\/\/handoli.com\/index.php\/wp-json\/wp\/v2\/media?parent=10188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/handoli.com\/index.php\/wp-json\/wp\/v2\/categories?post=10188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/handoli.com\/index.php\/wp-json\/wp\/v2\/tags?post=10188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}