Designing Audio Effect Plugins in C++
eBook - ePub

Designing Audio Effect Plugins in C++

For AAX, AU, and VST3 with DSP Theory

Will Pirkle

Compartir libro
  1. 656 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Designing Audio Effect Plugins in C++

For AAX, AU, and VST3 with DSP Theory

Will Pirkle

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

Designing Audio Effect Plugins in C++ presents everything you need to know about digital signal processing in an accessible way. Not just another theory-heavy digital signal processing book, nor another dull build-a-generic-database programming book, this book includes fully worked, downloadable code for dozens of professional audio effect plugins and practically presented algorithms.

Sections include the basics of audio signal processing, the anatomy of a plugin, AAX, AU and VST3 programming guides; implementation details; and actual projects and code. More than 50 fully coded C++ audio signal-processing objects are included. Start with an intuitive and practical introduction to the digital signal processing (DSP) theory behind audio plug-ins, and quickly move on to plugin implementation, gain knowledge of algorithms on classical, virtual analog, and wave digital filters, delay, reverb, modulated effects, dynamics processing, pitch shifting, nonlinear processing, sample rate conversion and more. You will then be ready to design and implement your own unique plugins on any platform and within almost any host program.

This new edition is fully updated and improved and presents a plugin core that allows readers to move freely between application programming interfaces and platforms. Readers are expected to have some knowledge of C++ and high school math.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Designing Audio Effect Plugins in C++ un PDF/ePUB en línea?
Sí, puedes acceder a Designing Audio Effect Plugins in C++ de Will Pirkle en formato PDF o ePUB, así como a otros libros populares de Technology & Engineering y Acoustical Engineering. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Editorial
Routledge
Año
2019
ISBN
9780429954313

Chapter 1
Introduction

The first affordable digital audio devices began appearing in the mid-1980s. Digital signal processing (DSP) mathematics had been around since the 1960s. Commercial digital recordings first appeared in the early 1970s, but the technology did not become available for widespread distribution until about 15 years later when the advent of the compact disc ushered in the age of digital audio. Digital sampling refers to the acquisition of data points from a continuous analog signal. The data points are sampled on a regular interval known as the “sample period” or “sample interval.” The inverse of the sample period is the sampling frequency, which we denote as fs. A compact disc uses a sampling frequency of 44,100 Hz, producing 44,100 discrete samples per channel each second, with a sample interval of about 22.7 microseconds (μS). While digital sampling applies to many different systems, this book is focused on only one of those applications: audio. Prior to the early 1990s digital audio effects and synthesizers were implemented in hardware devices that consisted of microprocessors, microcontrollers, DSP chips, and other components. These devices almost exclusively featured analog input and output connections at first, and then later began to incorporate digital I/O. Digital audio workstations (DAWs) appeared in the late 1980s and audio software began to bloom. Microsoft released a software development kit (SDK) called DirectX® aimed at what was originally termed multimedia—a phrase many used at the time, but few really understood. Within DirectX were signal processing specifications to process audio and video data streams, and in short time the first DAWs appeared that supported DirectX “plugins.” Around the same time, Steinberg Media Technology published a specification for its Virtual Studio Technology (VST), which became arguably the most popular plugin format ever conceived.
During the course of this book, you will learn both DSP theory and C++ software applications. You have instant access to dozens of C++ objects that implement every signal processing algorithm in the book, and Chapters 9 through 22 will specifically reveal the conversion of the algorithms into C++ code. Each of these chapters will include one to three of these C++ objects. These objects are not tied to any plugin format or operating system. You may easily combine them with other signal processing objects or frameworks, and you have license to use them as you wish for commercial or noncommercial plugins. The resulting products sound fantastic. You will get great satisfaction when you begin inventing your own unique plugins, or implementing cutting-edge audio algorithms as soon as they are published.

1.1 Using This Book

Included are individual chapters for the three major commercially available effects specifications AAX (Avid Audio eXtension), Audio Unit (AU), and VST3 (Steinberg Media Technology GmbH). Plugin specifications are also known as APIs. The most important aspect of the book design is that you may use whatever platform you wish for writing and testing your plugins on MacOS or Windows and in the DAW of your choice. The DSP algorithms encapsulated in the aforementioned C++ objects are platform and API neutral. As you study the API-specific chapters, you will learn that all three of these APIs are really very similar in their internal functionality, but the implementation details for the different APIs can be overwhelming. This has lead to the use of third party plugin development frameworks.
You may already be using one of these frameworks, such as JUCE—if so, that is fine. You can easily incorporate the C++ signal processing objects into these frameworks because the objects are not API or platform centric. Make sure you adhere to any licensing restrictions that these frameworks require and follow their rules for software release or code publication. You will need to know how to get audio in and out of the frameworks as well as how to design your graphical user interface (GUI) and handle parameter changes from the GUI or DAW automation so please refer to documentation for those frameworks for that information.
If you are like most readers you probably have not developed a plugin using one of those frameworks—or perhaps you tried, but got bogged down in the steep learning curves and the new implementation details that the frameworks were supposed to help alleviate. Or you may have downloaded one of the SDKs and were bewildered by its contents. That is also fine because we’ve spent the last three years developing a fully functional, truly professional, license-free platform for you to use called ASPiK™ (which stands for “Audio Specific PlugiIn Kernel”). ASPiK consists of a set of C++ objects that are custom tailored to interface directly with AAX, AU, and VST3 plugins, along with a mechanism for easily generating new plugin projects.
The projects for the book are packaged as ASPiK plugin projects and are simple to integrate into other third party frameworks if you would rather use them instead. All of the plugin projects in the book are written in a way that will make the code simple to transport to other development systems. In addition, the code in the individual chapters does not focus on any API, or on ASPiK itself. The fundamental goal of the book is to help you understand audio signal processing algorithms and how to convert them into C++ objects; it tries to be as platform, framework, and API neutral as possible.
Included in the ASPiK framework is a complete, platform-independent GUI design system called the PluginGUI object, with a drag-and-drop interface for creating beautiful and professional looking GUIs without writing a single line of code. If you want to experiment with GUI programming, you can find out about custom GUI design in Chapter 21.
If you are new to plugin programming, or you want to develop new plugins or test algorithms in the most efficient manner possible, you might want to use the RackAFX™ software, however this book is not RackAFX-centric nor requires it for use. There is absolutely no RackAFX-specific code in ASPiK or its accompanying objects. However, RackAFX simplifies plugin programming and design by allowing you to quickly define the plugin parameters and user interface, and it includes tools for testing your plugin algorithm such as an oscillator, oscilloscope, spectrum analyzer, and more. You may also use RackAFX to generate ASPiK projects based off of your designs, and these ASPiK projects do not rely upon, nor include anything RackAFX-specific. Almost all of the real-time response plots you see in this book—including frequency, impulse, step, and phase responses—were done using RackAFX’s plugin analyzer, which can make analytical measurements on your plugin’s algorithm while it is running.

1.2 Fundamentals of Audio Signal Processing

Because plugins are software variations on hardware designs, it’s worth examining how the hardware systems operate: acquisition of data, audio reconstruction, and numerical representation of the audio signal. Then we define our analytical test signals and the basic signal processing blocks.

1.2.1 Acquisition of Audio Samples

The incoming analog audio signal is sampled with an analog to digital converter (ADC or A/D). Analog to digital converters must accurately sample and convert an incoming signal, producing a valid digitally coded number that represents the analog voltage within the sampling interval. This means that for CD audio, a converter must produce an output every 22.7 μS. Figure 1.1a shows the block diagram of the input conversion system with low-pass filter, A/D, and encoder while Figure 1.1b demonstrates the Nyquist frequency’s encoding consisting of only two points.
The sampling theorem states that a continuous analog signal can be sampled into discrete data points and then reconstructed into the original analog signal without any loss of information—including inter-sample fluctuations—if and only if the input signal has been band-limited so that it contains no frequencies higher than half the sample rate, also known as the Nyquist frequency or Nyquist rate. Band-limited means low-pass filtered (LPF). Band-limiting the input signal prior to sampling is known as adhering to the Nyquist criteria.
Violating the Nyquist criteria will create audible errors in the signal in the form of an erroneously encoded signal. We will refer to the Nyquist frequency simply as “Nyquist” from now on. Frequencies higher than Nyquist will fold back into the spectrum. This effect is called aliasing since the higher-than-Nyquist frequencies are encoded “in disguise” or as an “alias” of the actual frequency. This is easiest explained with a picture of an aliased signal shown in Figure 1.1c where the encoding error is shown in the dotted waveform—it is clearly not the correct frequency.
Once the aliased signal is created it will remain as a permanent error in the signal. The LPF that band-limits the signal at the input is called the “anti-aliasing filter.” Another form of aliasing occurs at the movies. An analog movie camera takes 30 pictures (frames) per second. However, it must often film objects that are rotating at much higher rates than 30 per second, like helicopter blades or car wheels.
Figure 1.1: (a) An analog-to-digital encoding system. (b) The Nyquist frequency is the highest frequency that can be encoded with two samples per period. (c) Increasing the frequency above Nyquist but keeping the sampling interval the same results in an obvious coding error—the aliased signal (dotted line) is the result.
Figure 1.1: (a) An analog-to-digital encoding system. (b) The Nyquist frequency is the highest frequency that can be encoded ...

Índice