logo资料库

Designing Audio Effect Plug-Ins in C++: With Digital Audio Signa....pdf

第1页 / 共650页
第2页 / 共650页
第3页 / 共650页
第4页 / 共650页
第5页 / 共650页
第6页 / 共650页
第7页 / 共650页
第8页 / 共650页
资料共650页,剩余部分请下载后查看
Half Title
Title Page
Copyright
Dedication
Contents
Introduction
Chapter 1: Digital Audio Signal Processing Principles
1.1 Acquisition of Samples
1.2 Reconstruction of the Signal
1.3 Signal Processing Systems
1.4 Synchronization and Interrupts
1.5 Signal Processing Flow
1.6 Numerical Representation of Audio Data
1.7 Using Floating-Point Data
1.8 Basic DSP Test Signals
1.8.1 DC and Step
1.8.2 Nyquist
1.8.3 ½ Nyquist
1.8.4 ¼ Nyquist
1.8.5 Impulse
1.9 Signal Processing Algorithms
1.10 Bookkeeping
1.11 The One-Sample Delay
1.12 Multiplication
1.13 Addition and Subtraction
1.14 Algorithm Examples and the Difference Equation
1.15 Gain, Attenuation, and Phase Inversion
1.16 Practical Mixing Algorithm
Bibliography
Chapter 2: Anatomy of a Plug-In
2.1 Static and Dynamic Linking
2.2 Virtual Address Space and DLL Access
2.3 C and C++ Style DLLs
2.4 Maintaining the User Interface
2.5 The Applications Programming Interface
2.6 Typical Required API Functions
2.7 The RackAFX Philosophy and API
2.7.1 __stdcall
Bibliography
Chapter 3: Writing Plug-Ins with RackAFX
3.1 Building the DLL
3.2 Creation
3.3 The GUI
3.4 Processing Audio
3.5 Destruction
3.6 Your First Plug-Ins
3.6.1 Project: Yourplugin
3.6.2 Yourplugin GUI
3.6.3 Yourplugin.h File
3.6.4 Yourplugin.cpp File
3.6.5 Building and Testing
3.6.6 Creating and Saving Presets
3.6.7 GUI Designer
3.7 Design a Volume Control Plug-In
3.8 Set Up RackAFX for Use
3.9 Setup Preferences
3.9.1 Project: Volume
3.9.2 Volume GUI
3.9.3 Configure a Slider Control
3.9.4 Volume.h File
3.9.5 Volume.cpp File
3.10 Design a Volume-in-dB Plug-In
3.10.1 Project: VolumedB
3.10.2 VolumedB GUI
3.10.3 VolumedB.h File
3.10.4 VolumedB.cpp File
3.11 Design a High-Frequency Tone Control Plug-In
3.11.1 Project: SimpleHPF
3.11.2 SimpleHPF GUI
3.11.3 SimpleHPF.h File
3.11.4 SimpleHPF.cpp File
3.12 Design a High-Frequency Tone Control with Volume Plug-In
3.12.1 Project: SimpleHPF
3.12.2 SimpleHPF GUI
3.12.3 SimpleHPF.h File
3.12.4 SimpleHPF.cpp File
3.13 The User Plug-In Menu in RackAFX
Chapter 4: How DSP Filters Work
4.1 First-Order Feed-Forward Filter
4.2 Design a General First-Order Feed-Forward Filter
4.3 First-Order Feed-Back Filter
4.4 Design a General First-Order Feed-Back Filter
4.4.1 Project FeedBackFilter
4.4.2 FeedBackFilter GUI
4.4.3 FeedBackFilter.h File
4.4.4 FeedBackFilter.cpp File
4.5 Observations
4.5.1 General
4.5.2 Feed-Forward Filters
4.5.3 Feed-Back Filters
Bibliography
Chapter 5: Basic DSP Theory
5.1 The Complex Sinusoid
5.2 Complex Math Review
5.3 Time Delay as a Math Operator
5.4 First-Order Feed-Forward Filter Revisited
5.4.1 Negative Frequencies
5.4.2 Frequencies Above and Below ±Nyquist
5.5 Evaluating the Transfer Function H⠃준)
5.5.1 DC ⠀  䠀稀)
5.5.2 Nyquist ⠃쀀)
5.5.3 ½ Nyquist ⠃쀀⼀㈀)
5.5.4 ¼ Nyquist ⠃쀀⼀㐀)
5.6 Evaluating ejω
5.7 The z Substitution
5.8 The z Transform
5.9 The z Transform of Signals
5.10 The z Transform of Difference Equations
5.11 The z Transform of an Impulse Response
5.12 The Zeros of the Transfer Function
5.13 Estimating the Frequency Response: Zeros
5.14 Filter Gain Control
5.15 First-Order Feed-Back Filter Revisited
5.16 The Poles of the Transfer Function
5.16.1 DC ⠀  䠀稀)
5.16.2 Nyquist ⠃쀀)
5.16.3 ½ Nyquist ⠃쀀⼀㈀)
5.16.4 ¼ Nyquist ⠃쀀⼀㐀)
5.17 Second-Order Feed-Forward Filter
5.17.1 DC ⠀  䠀稀)
5.17.2 Nyquist ⠃쀀)
5.17.3 ½ Nyquist ⠃쀀⼀㈀)
5.17.4 ¼ Nyquist ⠃쀀⼀㐀)
5.18 Second-Order Feed-Back Filter
5.18.1 DC ⠀  䠀稀)
5.18.2 Challenge
5.19 First-Order Pole-Zero Filter: The Shelving Filter
5.19.1 DC ⠀  䠀稀)
5.19.2 Challenge
5.20 The Bi-Quadratic Filter
Bibliography
Chapter 6: Audio Filter Designs: IIR Filters
6.1 Direct z-Plane Design
6.2 Single Pole Filters
6.2.1 First-Order LPF and HPF
6.3 Resonators
6.3.1 Simple Resonator
6.3.2 Smith-Angell Improved Resonator
6.4 Analog Filter to Digital Filter Conversion
6.4.1 Challenge
6.5 Effect of Poles or Zeros at Infinity
6.6 Generic Bi-Quad Designs
6.6.1 First-Order LPF and HPF
6.6.2 Second-Order LPF and HPF
6.6.3 Second-Order BPF and BSF
6.6.4 Second-Order Butterworth LPF and HPF
6.6.5 Second-Order Butterworth BPF and BSF
6.6.6 Second-Order Linkwitz-Riley LPF and HPF
6.6.7 First- and Second-Order APF
6.7 Audio Specific Filters
6.7.1 Modified Bi-Quad
6.7.2 First-Order Shelving Filters
6.7.3 Second-Order Parametric/Peaking Filter: Non-Constant-Q
6.7.4 Second-Order Parametric/Peaking Filter: Constant-Q
6.7.5 Cascaded Graphic EQ: Non-Constant-Q
6.7.6 Cascaded Graphic EQ: Constant-Q
6.8 Design a Resonant LPF Plug-In
6.8.1 Project: ResonantLPF
6.8.2 ResonantLPF GUI
6.8.3 ResonantLPF.h File
6.8.4 ResonantLPF.cpp File
6.9 The Massberg Analog-Matched Low-Pass Filter
6.9.1 First-Order Massberg LPF
6.9.2 Second-Order Massberg LPF
Bibliography
References
Chapter 7: Delay Effects and Circular Buffers
7.1 The Basic Digital Delay
7.2 Digital Delay with Wet/Dry Mix
7.2.1 Frequency and Impulse Responses
7.2.2 The Effect of Feedback
7.3 Design a DDL Module Plug-In
7.3.1 Project: DDLModule
7.3.2 DDLModule GUI
7.3.3 DDLModule.h File
7.3.4 DDLModule.cpp File
7.3.5 Declare and Initialize the Delay Line Components
7.3.6 DDLModule.h File
7.3.7 DDLModule.cpp File
7.4 Modifying the Module to Be Used by a Parent Plug-In
7.4.1 DDLModule.h File
7.4.2 DDLModule.cpp File
7.5 Modifying the Module to Implement Fractional Delay
7.5.1 DDLModule.cpp File
7.6 Design a Stereo Digital Delay Plug-In
7.6.1 Project: StereoDelay
7.6.2 StereoDelay GUI
7.6.3 StereoDelay.h File
7.6.4 StereoDelay.cpp File
7.7 Design a Stereo Crossed-Feedback Delay Plug-In
7.8 Enumerated Slider Variables
7.8.1 Constructor
7.8.2 PrepareForPlay⠀)
7.8.3 UserInterfaceChange⠀)
7.8.4 ProcessAudioFrame⠀)
7.9 More Delay Algorithms
7.9.1 Advanced DDL Module
7.9.2 Delay with LPF in Feedback Loop
7.9.3 Multi-Tap Delay
7.9.4 Ping-Pong Delay
7.9.5 LCR Delay
Bibliography
Chapter 8: Audio Filter Designs: FIR Filters
8.1 The IR Revisited: Convolution
8.2 Using RackAFX’s Impulse Convolver
8.2.1 Loading IR Files
8.2.2 Creating IR Files
8.2.3 The IR File Format
8.3 Using RackAFX’s FIR Designer
8.4 The Frequency Sampling Method
8.4.1 Linear-Phase FIR Using the Frequency Sampling Method
8.5 Complementary Filter Design for Linear Phase FIR Filters
8.6 Using RackAFX’s Frequency Sampling Method Tool
8.7 Designing a Complementary Filter
8.8 The Optimal ⠀倀愀爀欀猀ⴀ䴀挀䌀氀攀氀氀愀渀) Method
8.9 Using RackAFX’s Optimal Method Tool
8.10 Design a Convolution Plug-In
8.10.1 Project: Convolver
8.10.2 Convolver.h File
8.10.3 Convolver.cpp File
8.11 Numerical Method FIR Filters
8.11.1 Moving Average Interpolator
8.11.2 Lagrange Interpolator
8.11.3 Median Filter
Bibliography
Chapter 9: Oscillators
9.1 Direct Form Oscillator
9.1.1 Initial Conditions
9.2 Design a Direct Form Oscillator Plug-In
9.2.1 Project: DirectOscillator
9.2.2 DirectOscillator GUI
9.2.3 DirectOscillator.h File
9.2.4 DirectOscillator.cpp File
9.2.5 Improving the Oscillator Design
9.3 The Gordon-Smith Oscillator
9.4 Wave Table Oscillators
9.5 Design a Wave Table Oscillator Plug-In
9.5.1 Project: WTOscillator
9.5.2 WTOscillator GUI
9.5.3 WTOscillator.h File
9.5.4 WTOscillator.cpp File
9.6 Adding More Wave Tables
9.6.1 WTOscillator.h File
9.6.2 WTOscillator.cpp File
9.6.3 WTOscillator GUI
9.6.4 WTOscillator.h File
9.6.5 WTOscillator.cpp File
9.7 Band-Limited Additive Wave Tables
9.7.1 WTOscillator GUI
9.7.2 WTOscillator.h File
9.7.3 WTOscillator.cpp File
9.7.4 Saw-Tooth
9.7.5 Square Wave
9.8 Additional Oscillator Features ⠀䰀䘀伀)
9.8.1 WTOscillator.h File
9.8.2 WTOscillator.cpp File
9.8.3 WTOscillator.h File
9.8.4 WTOscillator.cpp File
9.9 Bipolar/Unipolar Functionality
9.9.1 WTOscillator GUI
9.9.2 WTOscillator.cpp File
Bibliography
Chapter 10: Modulated Delay Effects
10.1 The Flanger/Vibrato Effect
10.2 The Chorus Effect
10.3 Design a Flanger/Vibrato/Chorus Plug-In
10.3.1 Project: ModDelayModule
10.3.2 ModDelayModule GUI
10.3.3 ModDelayModule.h File
10.3.4 ModDelayModule.cpp File
10.3.5 PrepareForPlay⠀)
10.3.6 Challenge
10.4 Design a Stereo Quadrature Flanger Plug-In
10.4.1 Project: StereoQuadFlanger
10.4.2 StereoQuadFlanger GUI
10.4.3 StereoQuadFlanger.h File
10.4.4 StereoQuadFlanger.cpp File
10.4.5 Challenges
10.5 Design a Multi-Unit LCR Chorus Plug-In
10.5.1 Project: StereoLCRChorus
10.5.2 StereoLCRChorus GUI
10.5.3 StereoLCRChorus.h File
10.5.4 StereoLCRChorus.cpp File
10.6 More Modulated Delay Algorithms
10.6.1 Stereo Cross-Flanger/Chorus ⠀䬀漀爀最 吀爀椀琀漀渀글)
10.6.2 Multi-Flanger ⠀匀漀渀礀 䐀倀匀ⴀ䴀㜀글)
10.6.3 Bass Chorus
10.6.4 Dimension-Style ⠀刀漀氀愀渀搀 䐀椀洀攀渀猀椀漀渀 䐀글)
10.6.5 Deca-Chorus ⠀匀漀渀礀 䐀倀匀ⴀ䴀㜀글)
Bibliography
Chapter 11: Reverb Algorithms
11.1 Anatomy of a Room Impulse Response
11.1.1 RT60: The Reverb Time
11.2 Echoes and Modes
11.3 The Comb Filter Reverberator
11.4 The Delaying All-Pass Filter Reverberator
11.5 More Delaying All-Pass Filter Reverberators
11.6 Schroeder’s Reverberator
11.7 The Low-Pass Filter–Comb Reverberator
11.8 Moorer’s Reverberator
11.9 Stereo Reverberation
11.10 Gardner’s Nested APF Reverberators
11.11 Modulated APF and Comb/APF Reverb
11.12 Dattorro’s Plate Reverb
11.13 Generalized Feedback Delay Network Reverbs
11.14 Other FDN Reverbs
11.15 An Example Room Reverb
11.16 RackAFX Stock Objects
11.16.1 COnePoleLPF
11.16.2 CDelay
11.16.3 CCombFilter
11.16.4 CLPFCombFilter
11.16.5 CDelayAPF
11.17 Design the Room Reverb
11.17.1 Project: Reverb
11.17.2 Reverb GUI
11.17.3 Reverb.h
11.17.4 Reverb.cpp
11.18 Challenge
Bibliography
References
Chapter 12: Modulated Filter Effects
12.1 Design a Mod Filter Plug-In: Part I Modulated fc
12.1.1 Project: ModFilter
12.1.2 ModFilter GUI
12.1.3 ModFilter.h File
12.1.4 ModFilter.cpp File
12.2 Design a Mod Filter Plug-In: Part II, Modulated fc, Q
12.2.1 ModFilter GUI
12.2.2 ModFilter.h File
12.2.3 ModFilter.cpp File
12.3 Design a Mod Filter Plug-In: Part III, Quad-Phase LFOs
12.3.1 ModFilter GUI
12.3.2 ModFilter.cpp File
12.4 Design an Envelope Follower Plug-In
12.5 Envelope Detection
12.5.1 Project EnvelopeFollower
12.5.2 EnvelopeFollower GUI
12.5.3 EnvelopeFollower.h File
12.5.4 EnvelopeFollower.cpp File
12.6 Design a Phaser Plug-In
12.6.1 Project Phaser
12.6.2 Phaser GUI
12.6.3 Phaser.h File
12.6.4 Phaser.cpp File
12.7 Design a Stereo Phaser with Quad-Phase LFOs
12.7.1 Phaser GUI
12.7.2 Phaser.h File
12.7.3 Phaser.cpp File
Bibliography
References
Chapter 13: Dynamics Processing
13.1 Design a Compressor/Limiter Plug-In
13.1.1 Project: DynamicsProcessor
13.1.2 DynamicsProcessor: GUI
13.1.3 DynamicsProcessor.h File
13.1.4 DynamicsProcessor.cpp File
13.1.5 DynamicsProcessor.cpp File
13.2 Design a Downward Expander/Gate Plug-In
13.2.1 DynamicsProcessor.h File
13.2.2 DynamicsProcessor.cpp File
13.3 Design a Look-Ahead Compressor Plug-In
13.3.1 DynamicsProcessor: GUI
13.3.2 DynamicsProcessor.h File
13.3.3 DynamicsProcessor.cpp File
13.4 Stereo-Linking the Dynamics Processor
13.4.1 DynamicsProcessor: GUI
13.4.2 DynamicsProcessor.cpp File
13.5 Design a Spectral Compressor/Expander Plug-In
13.5.1 Project: SpectralDynamics
13.5.2 SpectralDynamics: GUI
13.5.3 Additional Slider Controls
13.5.4 Spectral Dynamics Buttons
13.5.5 Spectral Dynamics Metering
13.5.6 SpectralDynamics.h File
13.5.7 SpectralDynamics.cpp File
13.6 Alternate Side-Chain Configurations
Bibliography
References
Chapter 14: Miscellaneous Plug-Ins
14.1 Design a Tremolo/Panning Plug-In
14.1.1 Project: TremoloPanner
14.1.2 TremoloPanner: GUI
14.2 Design a Ring Modulator Plug-In
14.2.1 Project: RingModulator
14.2.2 RingModulator: GUI
14.2.3 RingModulator.h File
14.2.4 RingModulator.cpp File
14.3 Design a Wave Shaper Plug-In
14.3.1 Project: WaveShaper
14.3.2 WaveShaper: GUI
Bibliography
Appendix A: The VST® and AU® Plug-In APIs
A.1 Compiling as a VST Plug-In in Windows
A.2 Wrapping Your RackAFX Plug-In
A.3 Comparison of Objects/Methods/GUIs
A.4 VST Plug-In without Wrapping
A.4.1 Default GUI
A.4.2 Signal Processing
A.5 VST Plug-In with RackAFX Wrapping
A.5.1 Default GUI
A.6 AU Overview
A.6.1 Default GUI
A.6.2 Signal Processing
Appendix B: More RackAFX Controls and GUI Designer
B.1 The Alpha Wheel and LCD Control
B.2 The Vector Joystick Control
B.3 Using the sendUpdateGUI⠀) Method
B.4 Using GUI Designer
Index
Designing Audio Effect Plug-Ins in C++
Designing Audio Effect Plug-Ins in C++ With Digital Audio Signal Processing Theory Will Pirkle
First published 2013 by Focal Press 70 Blanchard Road, Suite 402, Burlington, MA 01803 Simultaneously published in the UK by Focal Press 2 Park Square, Milton Park, Abingdon, Oxon OX14 4RN Focal Press is an imprint of the Taylor and Francis Group, an Informa business © 2013 Taylor and Francis The right of Will Pirkle to be identified as author of this work has been asserted by him/her in accordance with sections 77 and 78 of the Copyright, Designs and Patents Act 1988. All rights reserved. No part of this book may be reprinted or reproduced or utilised in any form or by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying and recording, or in any information storage or retrieval system, without permission in writing from the publishers. Notices Knowledge and best practice in this field are constantly changing. As new research and experience broaden our understanding, changes in research methods, professional practices, or medical treatment may become necessary. Practitioners and researchers must always rely on their own experience and knowledge in evaluating and using any information, methods, compounds, or experiments described herein. In using such information or methods they should be mindful of their own safety and the safety of others, including parties for whom they have a professional responsibility. Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Library of Congress Cataloging-in-Publication Data Pirkle, William C., author. Designing audio effect plug-ins in C++ with digital audio signal processing theory/Will Pirkle. pages cm Includes bibliographical references and index. ISBN 978-0-240-82515-1 (paperback) 1. Computer sound processing. 2. Plug-ins (Computer programs) 3. C++ (Computer program language) I. Title. MT723.P57 2013 006.4’5—dc23 2012024241 ISBN: 978-0-240-82515-1 (pbk) ISBN: 978-0-123-97882-0 (ebk)
Typeset in Times Project Managed and Typeset by: diacriTech
Dedicated to my father and mother C.H. Pirkle and J.V. Pirkle
Contents Introduction Chapter 1: Digital Audio Signal Processing Principles 1.8.1 DC and Step 1.8.2 Nyquist 1.8.3 ½ Nyquist 1.8.4 ¼ Nyquist 1.8.5 Impulse 1.1 Acquisition of Samples 1.2 Reconstruction of the Signal 1.3 Signal Processing Systems 1.4 Synchronization and Interrupts 1.5 Signal Processing Flow 1.6 Numerical Representation of Audio Data 1.7 Using Floating-Point Data 1.8 Basic DSP Test Signals 1.9 Signal Processing Algorithms 1.10 Bookkeeping 1.11 The One-Sample Delay 1.12 Multiplication 1.13 Addition and Subtraction 1.14 Algorithm Examples and the Difference Equation 1.15 Gain, Attenuation, and Phase Inversion 1.16 Practical Mixing Algorithm Bibliography
Chapter 2: Anatomy of a Plug-In 2.1 Static and Dynamic Linking 2.2 Virtual Address Space and DLL Access 2.3 C and C++ Style DLLs 2.4 Maintaining the User Interface 2.5 The Applications Programming Interface 2.6 Typical Required API Functions 2.7 The RackAFX Philosophy and API Bibliography 2.7.1 __stdcall Chapter 3: Writing Plug-Ins with RackAFX 3.1 Building the DLL 3.2 Creation 3.3 The GUI 3.4 Processing Audio 3.5 Destruction 3.6 Your First Plug-Ins 3.7 Design a Volume Control Plug-In 3.8 Set Up RackAFX for Use 3.9 Setup Preferences 3.6.1 Project: Yourplugin 3.6.2 Yourplugin GUI 3.6.3 Yourplugin.h File 3.6.4 Yourplugin.cpp File 3.6.5 Building and Testing 3.6.6 Creating and Saving Presets 3.6.7 GUI Designer 3.9.1 Project: Volume 3.9.2 Volume GUI
分享到:
收藏