Designing Software Synthesizer Plugins in C++
eBook - ePub

Designing Software Synthesizer Plugins in C++

With Audio DSP

  1. 276 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Designing Software Synthesizer Plugins in C++

With Audio DSP

About this book

Designing Software Synthesizer Plugins in C++ provides everything you need to know to start designing and writing your own synthesizer plugins, including theory and practical examples for all of the major synthesizer building blocks, from LFOs and EGs to PCM samples and morphing wavetables, along with complete synthesizer example projects.

The book and accompanying SynthLab projects include scores of C++ objects and functions that implement the synthesizer building blocks as well as six synthesizer projects, ranging from virtual analog and physical modelling to wavetable morphing and wave-sequencing that demonstrate their use. You can start using the book immediately with the SynthLab-DM product, which allows you to compile and load mini-modules that resemble modular synth components without needing to maintain the complete synth project code. The C++ objects all run in a stand-alone mode, so you can incorporate them into your current projects or whip up a quick experiment. All six synth projects are fully documented, from the tiny SynthClock to the SynthEngine objects, allowing you to get the most from the book while working at a level that you feel comfortable with.

This book is intended for music technology and engineering students, along with DIY audio programmers and anyone wanting to understand how synthesizers may be implemented in C++.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Designing Software Synthesizer Plugins in C++ by Will C. Pirkle in PDF and/or ePUB format, as well as other popular books in Media & Performing Arts & Digital Media. We have over one million books available in our catalogue for you to explore.

Information

Publisher
Focal Press
Year
2021
Print ISBN
9780367510466
eBook ISBN
9781000375084

1 SynthLab Introduction

SynthLabā„¢ is the name of a set of C++ objects, structures, and functions designed to encapsulate and implement each of the functional blocks in a software synth, or soft-synth. There are scores of objects and structures, including abstract base classes, abstract interfaces, and all of the derived classes that implement the SynthLab synth projects. There are multiple projects for different types of synths, and you have access to all of the code for all of the objects and synth projects. But I’ve gone a step further to get you playing with the code and learning SynthLab without needing to integrate the objects into your plugin framework and then compile, debug, and test the complete synth projects, which are more complex than the audio effect plugins in my Designing Audio Effect Plugins in C++, 2nd ed. (I refer to this as ā€œmy FX plugin bookā€ in this text).
In addition to the C++ code and objects that you may compile and integrate into your own projects, you may also download the pre-compiled versions of each of the six different synths for VST3 (WindowsĀ® and MacOSĀ®) and AU (MacOS). These are called the SynthLab Dynamic Module (SynthLab-DM) projects. I designed SynthLab in a highly modular format to include the use of ā€œmodule coresā€ that are small, complete synth objects which implement the soft synth building blocks. You may design, compile, and then dynamically load your own modules into the host DM synths. This will allow you to study and learn each synth component, modify the code, or invent your own designs, then load those modules into the synth at runtime to debug, test, and voice. If you are interested in designing modular components for systems like VCVRack, then these tiny synth modules represent each of those modular building blocks – oscillators, filters, envelope generators, and the like.
In addition, all of the underlying building block objects feature a ā€œstand-alone modeā€ of operation, so you can integrate them into existing projects right away without needing to manage entire synth projects.
The base classes and interfaces, like all of the smaller helper objects and functions, may be accessed with just two includes: synthbase.h and synthfunctions.h, and their.cpp implementation files. You can find the C++ code and projects at www.willpirkle.com or https://github.com/willpirkleaudio/synthlab.

1.1 What You Need to Know to Use SynthLab Objects and Projects

You will notice that there is no mention of plugin APIs in this book – AAX, AU and VST are absent as they are covered in detail in my FX book. There is no discussion about specific plugin frameworks – ASPiK, JUCE, IPlug2, etc. Likewise, there are no analog or DSP theory chapters, so you will need to bring your own knowledge to the table or be willing to study it alongside this book. There is also no ā€œintro to MIDIā€ chapter. You need to know how MIDI messages work, what a MIDI ā€œCCā€ means, and the like. There are numerous books and sources available on all of these topics. These are prerequisites for getting the most out of this text.
This book is not designed to feature any particular framework or API but rather shows how I create software synthesizers in C++ using DSP theory and coding implementations. Most chapters begin with theory of operation, then show the C++ objects I use to implement that theory. You will need to download the code and study it side-by-side with the text as the book only includes very specific C++ code: stuff that is non-intuitive or very specific to audio or synthesis. Since all of the synth components use the same module-core paradigm and ten-control GUI implementations, the book figures and specifications are cleaner and easier to understand. This is in stark contrast to the book’s first edition, in which each project was vastly different in architecture and components.
If you intend to build the complete synth projects in this book, you need to have a solid grasp on your chosen plugin framework, and you especially need to understand how to generate your own GUIs within that framework; you will also need to understand some advanced GUI design topics, such as dynamic loading of string lists (remember that you are free to pick and use individual C++ objects and code as you like for your own synth projects). You will find that adding the synth objects to your framework’s processing object is very straightforward, but the GUI details may be challenging. Chapter 5 covers the details on using the module cores, designing with objects in stand-alone-mode, and connecting the synth engines to your framework, and you can always get more help and information from www.willpirkle.com/forum.

1.2 SynthLab Synth Projects

To demonstrate how to use and combine these objects, and how they work together, I have created a set of synth projects based on the same fundamental architecture which only differ in their oscillators and waveform rendering. All synths feature monophonic, unison, and polyphonic operational modes. These projects include:
  • SynthLab-WT: four-oscillator wavetable synth that includes ordinary wavetable, morphing wavetable, and one-shot drum and sound effect (SFX) wavetable implementations; the various oscillators may be used in any combination
  • SynthLab-PCM: PCM sample playback synth with four separate PCM oscillators; this synth uses.wav files for its PCM sample storage and retrieval
  • SynthLab-VA: four-oscillator virtual analog synth using virtual analog oscillators and filters
  • SynthLab-KS: physical modeling synth that uses the Karplus-Strong plucked string algorithm to generate realistic acoustic and electric guitar and bass sounds
  • SynthLab-DX: four-operator FM synth that produces the classic Yamaha DX synth sounds
  • SynthLab-WS: wave sequencing synth based on the Korg Wavestate’s Ā® multi-lane, independent looping wave sequencer that allows use of both normal and morphing wavetable oscillators during the sequencing operation; the wave sequencing oscillator demonstrates how to create an amalgam of modules encapsulated in a single object
In addition, each of these has a precompiled dynamic module (DM) version which you can download from www.willpirkle.com/synthlab using the DM subscript/prefix: for example, SynthLab-WSDM is the dynamic module version of the wave sequencing synth, and the dynamic module synths are collectively referred as SynthLab-DM.

1.2.1 SynthLab Documentation

SynthLab is fully documented with the DoxygenĀ® tool and is available to download at www.willpirkle.com/synthlab-docs/. This includes every C++ object, interface, structure, and function, with every member variable and member function. You should bookmark this page and refer to it often. Synth projects are considerably complex, and there is not enough room in the book to document every object.
The C++ listings in this book represent the interesting, difficult, or highly synth-oriented code that connects to the theory portions of each chapter. You will need to use the documentation and review the sample project code to get the most out of this book and understand how to select and use whichever C++ objects you like in your own plugin projects.

1.3 Synth Components

Most hardware and software synthesizers are designed from the same set of basic building blocks that will be used throughout this book. Table 1.1 lists these components, their abbreviations, and their descriptions, as applied to the SynthLab projects.
Table 1.1 Synthesizer components, my abbreviations, and descriptions, as used in SynthLab
Component
Abbreviation
Description
Synth engine
Engine
The entire synth, in one object that manages a set of voices
Synth voice
Voice
This term is not always used the same way, but for SynthLab, it is the object that renders each note-event; a voice contains a collection of one or more of the components below (LFO, EG, etc.)
Low frequency oscillator
LFO
An oscillator with frequency fo on the range of about 0.02 to 20.0 Hz, though numerous variations on these limits are allowable
Envelope generator
EG
Produces a unipolar control signal used to modulate other components; it is most closely associated with the output amplifier, where it sets the time-domain contour of the rendered signal
Digitally controlled amp
DCA
A variable gain and panning amplifier used on the output of each voice
Virtual analog filter
VAFilter
A synth filter des...

Table of contents

  1. Cover
  2. Half Title
  3. Title Page
  4. Copyright Page
  5. Dedication
  6. Table of Contents
  7. List of Figures
  8. List of Tables
  9. Preface
  10. 1 SynthLab Introduction
  11. 2 The Synth Engine
  12. 3 Synth Voices, Synth Modules, and Module Cores
  13. 4 Synth Operational Modes: Polyphony and Voice-Stealing
  14. 5 Learning and Using the SynthLab Objects & Projects
  15. 6 Modulation: Theory and Calculations
  16. 7 Envelope Generators and DCA
  17. 8 Low Frequency Oscillators
  18. 9 Wavetable Oscillators
  19. 10 Virtual Analog Oscillators
  20. 11 PCM Sample Playback Oscillators
  21. 12 Synthesizer Filters
  22. 13 Karplus-Strong Plucked String Model
  23. 14 The Modulation Matrix
  24. 15 Wave Morphing and Wave Sequencing
  25. 16 The SynthLab Synth Projects
  26. Index