App Notes

App Notes are documents that introduce signal processing and/or plug-in programming concepts; they are kind of like addendums to my book. Each App Note consists of a document and a sample RackAFX Plug-In Project. The two are intended to be used together for the study and understanding of a concept. On this page, the app note authors include myself, my students, and any contributions from RackAFX users. You can find more App Notes on the Bonus App Note page.

App Note Index:

AN-1: Multi-Rate Processing and Polyphase Filtering with Plug-In Example

AN-2: Threading an FFT for Parallel Processing in a Plug-In

AN-3: An Adaptive Filtering Plug-In using the FFT

AN-4: Virtual Analog (VA) Filter Implementation and Comparisons

AN-5: Virtual Analog (VA) Korg35 Lowpass Filter

AN-6: Virtual Analog (VA) Diode Ladder Filter

AN-7: Virtual Analog (VA) Korg35 Highpass Filter

AN-8: Virtual Analog (VA) Moog Half-Ladder Filter

AN-9: Rotary Speaker Modeling Plug-In

AN-10: Novel Hybrid Filters

AN-11: Phase Distortion Synthesis

AN-12: Easy FFT Processing without Multi-Threading

AN-1: Multi-Rate Processing and Polyphase Filtering with Plug-In Example by Will Pirkle (v1.1 updated 4.1.13)

This app note describes the concepts behind sample rate conversion for up and down-sampling. The accompanying project is an Oversampling WaveShaper. The WaveShaper is a non-linear processor that adds harmonics to the input signal. This can cause aliasing when the harmonics exceed Nyquist. One way to combat this is to oversample the signal and run the WaveShaper at a higher sample rate. After processing, the signal is down-sampled to the original rate. After studying the Plug-In code,  you are asked to optimize it. In doing so, you are introduced to the concept of Polyphase Filtering – a way to decompose a FIR filter into smaller sub-filters which ultimately can lower the CPU usage of the rate conversion.

oversampling_2

 

This video shows the Oversampling Waveshaper Plug-In (NOTE: if you compile the plug-in for yourself, make sure to build the Release version (not the Debug version) for fastest processing):

AN-1 PDF File

AN-1 Project Files

AN-2: Threading an FFT for Parallel Processing in a Plug-In by Will Pirkle

This App Note describes using a FFT for signal analysis in a Plug-In. The FFT is run on a separate thread, therefore this App Note includes concepts on multithreading and thread synchronization using Windows Events. It also covers double-buffering since we need to buffer new audio samples in parallel with processing current buffers of data. The accompanying project is called MTFFT (Multithreaded FFT) and the FFT of the input signal is used to drive the assignable LED Meters in RackAFX to produce a 10-band FFT spectrum analyzer. The FFT length can be changed programmatically. There is no signal processing in this plug-in, only signal analysis. The Plug-In uses the built-in RackAFX object CFFT (you enable this when you create or edit your Project Properties). However the reader is encouraged to try other FFT packages such as FFTW. The FFT in this project is bare-boned. There is no windowing or overlap/add for the FFT in order to keep the project as simple as possible however you are encouraged to implement windowing and overlap/add as your homework/exercise.

MTFFT_1
AN-2 PDF File

AN-2 Project Files

AN-3: An Adaptive Filtering Plug-In using the FFT by Will Pirkle

This App Note is a continuation of AN-2 where the same side-chained FFT processing is used to analyze the input signal. In addition to showing the spectrum on the LED Meters, it also analyzes the FFT to find the highest amplitude frequency component. This is then used to set the center frequency of a notch filter to adaptively remove this component. The FFT is in a feed-forward side-chain. The reader is asked to explore the same look-ahead technique from Chapter 13 of my book to improve the tracking of the notch filter. With this App Note and Project as a basis, you can come up with a variety of side-chained FFT adaptive filters.

AdaptiveNotch_1
AN-3 PDF File

AN-3 Project Files

AN-4: Virtual Analog (VA) Filter Implementation and Comparisons – UPDATE by Will Pirkle (v2.1 updated 12.7.16)

This App Note shows implementations, experiments and comparisons of Zavalishin’s Virtual Analog (VA) Filters with the traditional direct-form implementations as well as the Massberg Analog Modeling Filters. The VA filters are based around a structure that preserves the topologies of the original analog filter circuits, including delay-less loops. The first part of the document provides a bit more background on the trapezoidal integrator (aka bilinear integrator) and then VA Filter implementations and comparisons are made with the BZT-biquad realizations and the Massberg variations. Block diagrams for the filters are included along with sample code. The accompanying RackAFX project also implements 4X Oversampling for more comparisons and has all code for all filters. These include all the 1st and 2nd order filters in the VA book as well as the Massberg lowpass filters and the Stilson-Smith Ladder filter. Below is the block diagram of the VA Moog Ladder Filter from the App Note.

There was an error in my original implementation of the TPT Ladder Filter  that has now been corrected (July 2013). The TPT Ladder works correctly without oversampling right up to Nyquist and will self oscillate at the highest resonance setting. The derivation for the block diagram is fully worked out and the code has been corrected.

VAMoog3

 

AN-4 PDF File

AN-4 Project Files

AN-5: Virtual Analog (VA) Korg35 Lowpass Filter by Will Pirkle

This App Note derives the equations for the Korg35 resonant LPF found on the Korg MS10, early MS20 and Monotron series. The block diagram is synthesized from the equations and the delay-less feedback loop is resolved. A nonlinear processing block is added to simulate the clipping circuit in the original; both the naive and budget versions of nonlinear processing are implemented so that you can experiment with your own variations. The filter performs as expected and self-oscillates nicely, especially with the nonlinear processing block engaged. The block diagram below is for the Korg35LPF with naive Nonlinear Processing added in the feedback loop.

UPDATE v3.0: I have updated the Korg35 LPF to streamline the project as well as explaining why self oscillation occurs at K = 2 (rather than K = 3 in the analog version). In v3.0, I derive the equations for the filter directly from the signal flow graph (rather than the conceptual block diagram) which results in one less filter block to implement. There is no difference in the transfer function, frequency response or sound of the updated filter.

Korg35_3

v3.0 Files
AN-5 PDF File (v3.0)

AN-5 Project Files (v3.0)

AN-6: Virtual Analog (VA) Diode Ladder Filter by Will Pirkle

This App Note derives the equations for the VA Diode Ladder Filter. The Diode Ladder Filter was originally designed for the EMS VCS3 synth but is most famous as the resonant filter from the Roland TB-303 BassLine monophonic synth. The complete filter equations are derived and a block diagram is synthesized. Actual filter measurements have excellent agreement with the theoretical frequency response. Both linear and “budget” nonlinear versions are presented and implemented. The filter performs well across the spectrum and self-oscillates as expected without becoming unstable. The plot below is the measured output of the Plug-In for various values of feedback k.

diodeFR

AN-6 PDF File

AN-6 Project Files

AN-7: Virtual Analog (VA) Korg35 Highpass Filter by Will Pirkle

This App Note derives the equations for the Korg35 resonant HPF found on the Korg MS10 and early MS20. The block diagram is synthesized from the equations and the delay-less feedback loop is resolved. The interesting 6dB/octave behavior in this 2nd Order filter is also revealed and emulated. A nonlinear processing block is added to simulate the clipping circuit in the original; both the naive and budget versions of nonlinear processing are implemented so that you can experiment with your own variations. The filter performs as expected and self-oscillates nicely, especially with the nonlinear processing block engaged. The block diagram below is for the Korg35 HPF with naive Nonlinear Processing added in the feedback loop.

UPDATE: I have updated the Korg35 HPF model with a newer and greatly simplified version that eliminates three filtering blocks and has more simplified equations and implementation. The frequency response and transfer functions are identical to the original. The new version also simplifies the nonlinear processing.

Korg35HPF

AN-7A PDF File

AN-7A Project Files

AN-8: Virtual Analog (VA) Moog Half-Ladder Filter by Will Pirkle

This App Note derives the equations and shows the implementation of a 2nd Order Moog “half” ladder filter. I created this filter to give to my students as a project for deriving VA equations and implementing VA filters. I have not seen anything like it, though I only did a preliminary web search. This filter produces a 2nd order LPF using a similar Moog loop but with two LPFs and one APF instead of the cascade of 4 LPFs in the ordinary filter. As with the full ladder filter, passband gain is reduced as Q increases, but in the half-ladder filter the reduction is not as high. The sample RackAFX plug-in implements both the full (4th order) and half (2nd order) filters for comparison.

NOTE: This filter is nearly identical to another “half-ladder” filter that a well-known Japanese synthesizer company uses in its virtual analog model of one of its classic late 1970’s synths. In other words, half-ladder filters are far from useless! 😉

HalfLadder

AN-8 PDF File

AN-8 Project Files

AN-9: Rotary Speaker Modeling Plug-In by Ross Penniman

This App Note describes a Leslie Rotary Speaker Modeling Plug-In that models both the rotating HF horn and rotating LF bass scoop. Here is an excerpt: “The pick-up of sound is assumed to be two virtual microphones placed at the corners of a square which inscribes the path of the rotating horn (as shown in Fig. 2). These microphones are assumed to be omnidirectional with flat frequency response and are placed in anechoic surroundings (not very realistic, but it saves quite a bit of additional DSP).

1) A circular delay buffer is used to simulate the propagation time from the mouth of the horn to the left and right microphones. As the delay time shortens and lengthens, the Doppler effect will happen automatically. Only one delay line is needed since there is only one source. The left and right signals each have their own read index which moves independently through the buffer.
2) The relative distance between the horn and microphones is used as the basis for the amplitude (tremolo) effect. This will be applied as a simple modulated gain.
3) A second order Butterworth low-pass filter with changing cutoff frequency is used to simulate the tonal modulation effect.”

This is the first App Note that Will Pirkle did not write. Thanks to my colleague and former grad student Ross Penniman for submitting it! NOTE: because it uses geometry for several calculations, you can implement impossible (or at least very impractical) Leslie simualtions, for example the pair of horns could be 20 feet apart, or the bass scoop rotational rate could be ridiculous, like 10kHz…

BlockDigram

 

AN-9 PDF File

AN-9 Project Files

AN-10: Novel Hybrid VA Filters: AES Paper 9195 by Will Pirkle

This brief App Note accompanies the Novel Hybrid Filters project. This is based on two papers I recently delivered at the 137th AES Convention in Los Angeles, 2014. All of the theoretical detail can be found in these papers so it is not replicated in the App Note. You can get the papers here:

Resolving Delay Free Loops: Modified Harma Method
Novel Hybrid Filters

The project files below go with the second paper, but it references the first paper so you may want to get both. If you have my Synth Book, the Modified Harma Method is covered in detail.

Also, see the short You Tube Video before using the project as it shows some details you need to understand about the project. Below are some plots of the unique 2nd order doubly-resonant lowpass filter which is one of the novel filters in the paper.

BlockDigram

 

AN-10 PDF File

AN-10 Project Files

AN-11: Phase Distortion Synthesis by Davis Sprague

This App Note demonstrates basic phase distortion synthesis theory, and the companion plugin allows a variety of phase distortion controls producing many interesting waveforms. Davis Sprague wrote this App note as a senior Music Engineering student in the University of Miami’s Music Engineering Technology program – he is now a Software Engineer at Korg Research and Development. PD synthesis can produce aliased waveforms, and alias suppression is accomplished with BLEP. However, as Mr. Sprague points out, there are some waveforms for which this kind of correction is useless so you will need to address aliasing with other methods such as oversampling. The code is well commented and easy to read. The sawtooth waveform below is created by distorting the phase increment pointer in a sinusoidal wavetable. Davis also demonstrates using the PD method to create waveforms that appear to be filtered with a resonant lowpass filter, when in fact PD synthesis is filter-less.

PDSawtooth

 

AN-11 PDF File

AN-11 Project Files

AN-12: Basic FFT Processing without Multi-Threading by Andrew Stockton

This App Note shows you how to do basic frequency domain processing using the FFT and IFFT. Andrew Stockton, a senior Music Engineering student in the University of Miami’s Music Engineering Technology program, put together a great sample project and short App Note that shows you how to do the FFT and IFFT processing without using multi-threading or buffer-based signal processing. Everything is done in processAudioFrame() and it is portable to MacOS (VST2/3 and AU). Mr. Stockton also gives you optimized FFT/IFFT functions that run very efficiently, allowing plenty of spare CPU cycles for processing. He covers windowing with a Hann window, overlap-and-add, and gives you four algorithms to try:

– Low Shelving Filter
– High Shelving Filter
– Magnitude/Phase Swapper
– simple Pitch Shifting (start with the Value control at 1.0 and then lower it)

The project is very well done, concise coding and plenty of comments – Andrew shows you which lines to alter for your own processing. The image below is the plot of the two shelving filters.

BlockDigram

 

AN-12 PDF File

AN-12 Project Files

Comments are closed.