You are previewing Designing Software Synthesizer Plug-Ins in C++.
O'Reilly logo
Designing Software Synthesizer Plug-Ins in C++

Book Description

Bridging the gap from theory to programming, Designing Software Synthesizer Plug-Ins in C++ For RackAFX, VST3 and Audio Units contains complete code for designing and implementing software synthesizers for both Windows and Mac platforms. You will learn synthesizer operation, starting with the underlying theory of each synthesizer component, and moving on to the theory of how these components combine to form fully working musical instruments that function on a variety of target digital audio workstations (DAWs). Containing some of the latest advances in theory and algorithm development, this book contains information that has never been published in textbook form, including several unique algorithms of the author’s own design.

The book is broken into three parts: plug-in programming, theory and design of the central synthesizer components of oscillators, envelope generators, and filters, and the design and implementation of six complete polyphonic software synthesizer musical instruments, which can be played in real time. The instruments implement advanced concepts including a user-programmable modulation matrix. The final chapter shows you the theory and code for a suite of delay effects to augment your synthesizers, introducing you to audio effect processing.

The companion website, www.focalpress.com/cw/pirkle, gives you access to free software to guide you through the application of concepts discussed in the book, and code for both Windows and Mac platforms. In addition to the software, it features bonus projects, application notes, and video tutorials. A reader forum, monitored by the author, gives you the opportunity for questions and information exchange.

Table of Contents

  1. Cover
  2. Half Title
  3. Title
  4. Copyright
  5. Dedication
  6. Contents
  7. Preface
  8. Foreword
  9. Chapter 1 Synthesizer Fundamentals
    1. 1.1 Synth Components
    2. 1.2 Oscillators
    3. 1.3 Filters
    4. 1.4 Amplifiers
    5. 1.5 Envelope Generators
    6. 1.6 Basic Synth Architecture
    7. 1.7 Fundamental Goals of Synth Patch Design
    8. 1.8 Audio Data Formats for Plug-Ins
    9. 1.9 Signal Processing Review
    10. 1.10 Continuous Signals
    11. 1.11 Discretized Signals
    12. 1.12 The Laplace and z-Transforms
    13. 1.13 Aliasing
  10. Chapter 2 Writing Plug-Ins
    1. 2.1 Dynamic-Link Libraries
    2. 2.2 C and C++ Style DLLs
    3. 2.3 The Application Programming Interface (API)
    4. 2.4 API Function Comparisons
    5. 2.5 The RackAFX Philosophy and API
    6. 2.6 Writing RackAFX Plug-ins
    7. 2.7 Setting Up RackAFX
    8. 2.8 Designing the User Interface in the Prototype Phase
    9. 2.9 Setting up Continuous Controls
    10. 2.10 Setting up Indexed Controls: Radio Buttons
    11. 2.11 Setting up Indexed Controls: Sliders
    12. 2.12 Placing Controls Inside the LCD Control
    13. 2.13 Using the RackAFX GUI Designer
    14. 2.14 The RackAFX Plug-in Object
    15. 2.15 Writing VST3 Plug-ins
    16. 2.16 VST3: Processor and Controller
    17. 2.17 The Common Object Model: COM
    18. 2.18 VST3 Synth Plug-in Architecture
    19. 2.19 Processor and Controller Declarations
    20. 2.20 The Class Factory
    21. 2.21 VST3 Conventions
    22. 2.22 Implementing a VST3 Plug-in: Controller
    23. 2.23 VST3 Controller Initialization
    24. 2.24 VST3 Controller Serialization
    25. 2.25 VST3 Controller MIDI Mapping
    26. 2.26 Implementing a VST3 Plug-in: Processor
    27. 2.27 VST3 Processor Initialization
    28. 2.28 VST3 Processor Serialization
    29. 2.29 VST3 Note Events, Control Changes and Rendering
    30. 2.30 Implementing a VST3 Plug-in: GUI Design
    31. 2.31 Using the VSTGUI Drag-and-Drop Interface
    32. 2.32 VSTGUI Design Example
    33. 2.33 Implementing a VST3 Plug-in: Debugging
    34. 2.34 Writing Audio Unit (AU) Plug-ins
    35. 2.35 AU XCode Projects
    36. 2.36 The Info.plist File
    37. 2.37 Managing AU Parameters
    38. 2.38 AU Conventions
    39. 2.39 AUSynth and AUInstrumentBase Class
    40. 2.40 Implementing the AUSynth Object
    41. 2.41 Implementing the Cocoa View Objects
    42. 2.42 WPRotaryKnob
    43. 2.43 WPOptionMenuGroup
    44. 2.44 The View Factory and CocoaSynthView.plist
    45. 2.45 The View Event Listeners
    46. 2.46 The View Interface and Initialization
    47. 2.47 Implementing an AU Plug-in: Debugging
  11. Chapter 3 MIDI
    1. 3.1 MIDI Messages
    2. 3.2 Channel Voice Messages
    3. 3.3 Project: NanoSynth
    4. 3.4 NanoSynth: RackAFX
    5. 3.5 RackAFX Status Window
    6. 3.6 NanoSynth: VST3
    7. 3.7 MIDI Events in VST3
    8. 3.8 MIDI Controllers in VST3
    9. 3.9 NanoSynth: AU
  12. Chapter 4 Analog and Digital Signal Processing
    1. 4.1 Analog and Digital Building Blocks
    2. 4.2 Analog and Digital Transfer Functions
    3. 4.3 Digital Delay
    4. 4.4 Digital Differentiation
    5. 4.5 Analog and Digital Integration
    6. 4.6 The Bilinear z-Transform
    7. 4.7 Virtual Analog Filters
    8. 4.8 Analog Block Diagrams
    9. 4.9 First Order VA Lowpass Filter
    10. 4.10 First Order VA Highpass Filter
    11. 4.11 Second Order VA Filters
    12. 4.12 Series and Parallel VA Filters
    13. 4.13 Resolving Delay-less Loops: Modified Härmä Method
    14. 4.14 Resolving Delay-less Loops: Zavalishin’s Method
    15. 4.15 Analog Signal Flow Graphs
    16. 4.16 Wave Shaping
    17. 4.17 Challenges
  13. Chapter 5 Synthesizer Oscillator Design
    1. 5.1 Trivial Oscillator Algorithms
    2. 5.2 Trivial Sawtooth Oscillator
    3. 5.3 Trivial Square Wave Oscillator
    4. 5.4 Trivial Triangle Wave Oscillatora
    5. 5.5 Quasi Bandlimited Oscillator Algorithms
    6. 5.6 Bandlimited Impulse Trains (BLIT)
    7. 5.7 Bandlimited Step Functions (BLEP)
    8. 5.8 Wider Window BLEP
    9. 5.9 Polynomial BLEP (PolyBLEP)
    10. 5.10 Coding the BLEP and PolyBLEP Algorithms
    11. 5.11 Wave Shaped BLEP Sawtooth Oscillator
    12. 5.12 BLEP Square Wave Oscillator
    13. 5.13 Differentiated Parabolic Waveform Oscillators
    14. 5.14 DPW Triangle Wave Oscillator
    15. 5.15 Other Non-Sinusoidal Oscillators
    16. 5.16 White Noise Oscillator
    17. 5.17 Pseudo Random Noise (PN Sequence) Oscillator
    18. 5.18 Random Sample and Hold Oscillator
    19. 5.19 Exponential Decay Oscillator
    20. 5.20 Wavetable Oscillators
    21. 5.21 Bandlimited Wavetable Oscillators
    22. 5.22 Sinusoidal Oscillators by Approximation
    23. 5.23 Pitched Oscillator Calculations
    24. 5.24 Sources of Modulation
    25. 5.25 Pitched Oscillator Starting Phase Consideration
    26. 5.26 LFO Features
    27. 5.27 Designing the Oscillator Objects
    28. 5.28 The COscillator Base Class
    29. 5.29 NanoSynth: Oscillators
    30. 5.30 NanoSynth Oscillators: RackAFX/VST3/AU
    31. 5.31 The CLFO Object
    32. 5.32 The CQBLimitedOscillator Object
    33. 5.33 The CWTOscillator Object
    34. 5.34 NanoSynth Oscillators: Processing Code
    35. 5.35 NanoSynth Oscillators: RackAFX
    36. 5.36 NanoSynth Oscillators: VST3
    37. 5.37 NanoSynth Oscillators: AU
    38. 5.38 NanoSynth: Wavetables
    39. 5.39 Challenges
  14. Chapter 6 Envelope Generators and Controlled Amplifiers
    1. 6.1 Analog Envelope Generators
    2. 6.2 Triggers, Gates, and Reset to Zero
    3. 6.3 Note on Modes
    4. 6.4 Note offModes
    5. 6.5 Digital Envelope Generators
    6. 6.6 Envelope Generator Variations
    7. 6.7 Iterative Generation of the Exponential Function
    8. 6.8 Biased Envelope Generator Output
    9. 6.9 Envelope Generator Intensity Controls and Connections
    10. 6.10 Envelope Generator Implementation
    11. 6.11 The CEnvelopeGenerator Object
    12. 6.12 Digitally Controlled Amplifi
    13. 6.13 The CDCA Object
    14. 6.14 NanoSynth: EG/DCA
    15. 6.15 NanoSynth EG/DCA Audio Rendering
    16. 6.16 NanoSynth EG/DCA: RackAFX
    17. 6.17 NanoSynth EG/DCA: VST3
    18. 6.18 NanoSynth EG/DCA: AU
    19. 6.19 Challenges
  15. Chapter 7 Synthesizer Filter Design
    1. 7.1 Virtual Analog Filters
    2. 7.2 Oberheim SEM State Variable Filter Model
    3. 7.3 Korg35 Sallen-Key Filter Model
    4. 7.4 Korg35 LPF Model
    5. 7.5 Korg35 HPF Model
    6. 7.6 Moog Ladder Filter Model
    7. 7.7 Moog Ladder Filter Gain Compensation
    8. 7.8 Oberheim XPander Variations
    9. 7.9 Nonlinear Moog Ladder Filter Models
    10. 7.10 The Second Order Moog Half-Ladder Filter
    11. 7.11 The Diode Ladder Filter Model
    12. 7.12 Designing the Filter Objects
    13. 7.13 The CFilter Base Class
    14. 7.14 The CVAOnePoleFilter Object
    15. 7.15 The CSEM Filter Object
    16. 7.16 The CKThreeFiveFilter Object
    17. 7.18 The CDiodeLadderFilter Object
    18. 7.19 Filter Key Tracking Modulation
    19. 7.20 NanoSynth: Filters
    20. 7.21 NanoSynth: Filters Audio Rendering
    21. 7.22 NanoSynth Filters: RackAFX
    22. 7.23 NanoSynth Filters: VST3
    23. 7.24 NanoSynth Filters: AU
    24. 7.25 Build and Test
    25. 7.26 Challenges
  16. Chapter 8 Modulation Matrix, Polyphony, and Global Parameterization
    1. 8.1 Modulation Routings
    2. 8.2 The Modulation Matrix Object
    3. 8.3 Using and Programming the Modulation Matrix
    4. 8.4 NanoSynth MM Part One: RackAFX
    5. 8.5 NanoSynth MM Part One: VST3
    6. 8.6 NanoSynth MM Part One: AU
    7. 8.7 More MIDI Modulation Routings
    8. 8.8 NanoSynth MM Part Two: RackAFX
    9. 8.9 NanoSynth MM Part Two: VST3
    10. 8.10 NanoSynth MM Part Two: AU
    11. 8.11 User Controlled Modulation Routings
    12. 8.12 NanoSynth MM Part Three: RackAFX
    13. 8.13 NanoSynth MM Part Three: VST3
    14. 8.14 NanoSynth MM Part Three: AU
    15. 8.15 Polyphony Part One
    16. 8.16 Dynamic Voice Allocation
    17. 8.17 Poly NanoSynth: RackAFX
    18. 8.18 Poly NanoSynth: VST3
    19. 8.19 Poly NanoSynth: AU
    20. 8.20 Global Parameterization
    21. 8.21 Final NanoSynth: RackAFX
    22. 8.22 Final NanoSynth: VST3
    23. 8.23 Final NanoSynth: AU
  17. Chapter 9 MiniSynth: Analog Modeling Synthesizer
    1. 9.1 Voice Architectures and CVoice
    2. 9.2 CVoice Initialization
    3. 9.3 Portamento
    4. 9.4 MiniSynth Specifications
    5. 9.5 CMiniSynthVoice Object
    6. 9.6 Polyphony Part Two
    7. 9.7 MiniSynth Files
    8. 9.8 MiniSynth: RackAFX
    9. 9.9 MiniSynth: VST3
    10. 9.10 MiniSynth: AU
    11. 9.11 Challenges
  18. Chapter 10 DigiSynth: Sample Playback Synthesizer
    1. 10.1 Audio Samples
    2. 10.2 .wav Files
    3. 10.3 Multi-Samples
    4. 10.4 Splits, Layers, and Note Regions
    5. 10.5 The CWaveData Object
    6. 10.6 The CSampleOscillator Object
    7. 10.7 Audio File Location
    8. 10.8 DigiSynth Specifications
    9. 10.9 The CDigiSynthVoice Object
    10. 10.10 DigiSynth Files
    11. 10.11 DigiSynth: RackAFX
    12. 10.12 DigiSynth: VST3
    13. 10.13 DigiSynth: AU
    14. 10.14 Challenges
  19. Chapter 11 VectorSynth and AniSynth: Vector Synthesizers
    1. 11.1 The Vector Joystick
    2. 11.2 Vector Paths
    3. 11.3 Rotors and Orbits
    4. 11.4 Combining Paths and Orbits
    5. 11.5 The Moog AniMoog Anisotropic Synthesizer
    6. 11.6 VectorSynth and AniSynth Path Modes
    7. 11.7 The Vector Joystick and JS Program in RackAFX
    8. 11.8 The Vector Joystick in VST3
    9. 11.9 The Vector Joystick in AU
    10. 11.10 Programming a Vector Path: VST3 and AU
    11. 11.11 VectorSynth Specifications
    12. 11.12 The CVectorSynthVoice Object
    13. 11.13 VectorSynth Files
    14. 11.14 VectorSynth: RackAFX
    15. 11.15 VectorSynth: VST3
    16. 11.16 VectorSynth: AU
    17. 11.17 AniSynth
    18. 11.18 AniSynth Specifications
    19. 11.19 The CAniSynthVoice Object
    20. 11.20 AniSynth Files
    21. 11.21 AniSynth: RackAFX, VST3, and AU
    22. 11.22 Challenges
  20. Chapter 12 DXSynth: FM Synthesizer
    1. 12.1 FM and PM Theory
    2. 12.2 FM Spectra
    3. 12.3 FM/PM Rules
    4. 12.4 Dynamic Spectra
    5. 12.5 DXSynth Specifications
    6. 12.6 FM and PM in Oscillator Objects
    7. 12.7 Yamaha DX100 vs. DXSynth
    8. 12.8 The CDXSynthVoice Object
    9. 12.9 DXSynth Files
    10. 12.10 DXSynth: RackAFX
    11. 12.11 DXSynth: VST3
    12. 12.12 DXSynth: AU
    13. 12.13 Challenges
  21. Chapter 13 Delay Effects
    1. 13.1 Circular Buffers
    2. 13.2 Delay Effect Topologies
    3. 13.3 The CDelayLine Object
    4. 13.4 The CStereoDelayFX Object
    5. 13.5 Using the CStereoDelayFX Object in Your Plug-ins
    6. 13.6 MiniSynth +
    7. 13.7 MiniSynth + FX: VST3
    8. 13.8 MiniSynth +
    9. 13.9 Challenges
  22. Appendix A
    1. A.1 Converting the VST3 Template Synth (Nine Steps)
    2. A.2 Converting the AU Template Synth (Ten Steps)
  23. Index