Advanced Formant Filter in Reaktor, Part II
In this tutorial, I’ll continue building a formant filter in Reaktor.
Last time, I laid out how we can morph between vowel sounds when providing frequency and bandwidth data to our filter. This week, I’ll lay out the structure of the filter itself, first proposed by Dennis Klatt in this paper.
The diagram for the resonator filter looks like so:
Translating into Reaktor is a trivial task once you understand what each element of the diagram does. The Unit Delay boxes are building blocks available to Reaktor builders in both Primary (The Unit Delay module) and Core (the z^-1 macro). The circled boxes with letters A, B and C are multiplications (A,B and C being filter coefficients). Finally, the box with the addition symbol is simply a mixer, or an adder.
All in all, the basic Reaktor translation looks like this:
Our final formant filter will use five of these structures in a serial format. We still need to provide values for A, B and C. Klatt provides the following equations:
Where values F (Frequency) and BW (Bandwidth) are given by the structure. The Exp() function is another way of saying the numerical constant e (2.71828) raised to the power in the parantheses.
Hence, we can build the following structure to calculate these values:
RETRIEVING THE PARAMETERS
As I mentioned in the previous tutorial, a very important feature of a formant filter is to be able to morph between vowel sounds, preferably using an XY module. To that end, I built a simple Core Cell with two tables that could morph between four different values.
The Cell contained six inputs. V1-v4 hold the index values for the vowel data to be read from the table. P1 and P2 control the morphing between values on the X-axis and Y-axis, respectively.
The formant information is stored in the tables such that the X-axis controls morphing between the vowels A, E, I, O and U in that order. So then the X-axis is set all the way to the left, the output will be the parameters for vowel A, and all the way to the right it will give the values for U. The Y-axis controls gender voicing.
We need 5 such structures, one for each formant in our filter. For the first formant, the table values given are from the ‘F1’ column in this chart . Filling the tables is tedious work, but gives a nice final product.
So now we need a way to provide this Cell with the inputs it needs. A basic setup might look something like this:
The XY module has a range of 0-4 on both axes. The outputs of the XY are stripped of their decimal values, which are used to control the position of the morph later on. The remaining integers are used to control the four points to morph between.
This structure could of course be improved in many ways. We should probably add some snap values to the output of the XY so the user can save and recall presets, I’ll leave that to the user as it should be easy enough. Receiving modulation inputs is also an important feature, but it will unfortunately have to wait for a future tutorial.
PUTTING IT ALL TOGETHER
Okay, so we can connect the XY macro just shown to the inputs of our Core Cells controlling the parameter tables. The outputs of the Core Cells can then be used to calculate the coefficients of our resonator filter structures.
However, when the vowel position changes suddenly (say, by changing the position of the XY module), the resulting jump in coefficient values can sound very ugly. It is therefore necessary to use a smoother on the coefficients to prevent an unpleasant screeching sound whenever the position of the filter is changed.
The larger structure looks like this:
Okay, I know that was a lot to follow, so I’ve included an upload of today’s work as well.
If there is interest we can continue to develop this filter.