zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

filter.txt (4376B)


      1 [[filters]]
      2 Filters
      3 -------
      4 :Author: Mark McCurry
      5 :Date: June 24, 2012
      6 
      7 ZynAddSubFX offers several different types of filters, which can be used to
      8 shape the spectrum of a signal.
      9 The primary parameters that affect the characteristics of the filter are the
     10 cutoff, resonance, filter stages, and the filter type.
     11 
     12 * *Cutoff*: This value determines which frequency marks the changing point for
     13             the filter. In a low pass filter, this value marks the point where
     14             higher frequencies are attenuated.
     15 * *Resonance*: The resonance of a filter determines how much excess energy is
     16                present at the cutoff frequency. In ZynAddSubFX, this is
     17                represented by the Q-factor, which is defined to be the cutoff
     18                frequency divided by the bandwidth. In other words higher Q
     19                values result in a much more narrow resonant spike.
     20 * *Stages*: The number of stages in a given filter describes how sharply it is
     21             able to make changes in the frequency response.
     22 
     23 The basic 'analog' filters that ZynAddSubFX offers are shown below, with the
     24 center frequency being marked by the red line.
     25 The 'state variable' filters should look quite similar.
     26 For more warmth and to serve the hype there is also a 'moog', that does the 
     27 same as 'analog' but with a special character.
     28 
     29 image:images/filter0.png[]
     30 
     31 As previously mentioned, the Q value of a filter affects how concentrated the
     32 signal's energy is at the cutoff frequency; The result of differing Q values are
     33 below.
     34 
     35 TIP: For many classical analog sounds, high Q values were used on sweeping
     36 filters. A simple high Q low pass filter modulated by a strong envelope is
     37 usually sufficient to get a good sound. 
     38 
     39 image:images/filter1.png[]
     40 
     41 Lastly, the affect of the order of the filter can be seen below.
     42 This is roughly synonymous with the number of stages of the filter.
     43 For more complex patches it is important to realize that the extra sharpness in
     44 the filter does not come for free as it requires many more calculations being
     45 performed; This phenomena is the most visible in subsynth, where it is easy to
     46 need several hundred filter stages to produce a given note.
     47 
     48 image:images/filter2.png[]
     49 
     50 
     51 
     52 There are different types of filters. The number of poles define what will
     53 happen at a given frequency. Mathematically, the filters are functions which
     54 have poles that correspond to that frequency. Usually, two poles mean that the
     55 function has more "steepness", and that you can set the exact value of the
     56 function at the poles by defining the "resonance value". Filters with two poles
     57 are also often referenced
     58 as https://de.wikipedia.org/wiki/Butterworth-Filter[Butterworth Filters].
     59 
     60 ********************************************************************
     61 For the interested, functions having poles means that we are given a quotient of
     62 polynomials. The denominator has degree 1 or 2, depending on the filter having
     63 one or two poles. In the file _DSP/AnalogFilter.cpp_,
     64 _AnalogFilter::computefiltercoefs()_ sets the coefficients (depending on the
     65 filter type), and _AnalogFilter::singlefilterout()_ shows the whole polynomial
     66 (in a formula where no quotient is needed).
     67 ********************************************************************
     68 
     69 A special class of filter is the COMB Filter. It creates a spectrum with regular 
     70 spaced notches like a comb. It can 'simulate' the effect of the reflections
     71 of a surface next to a microphone using the type FWD. Or it can 'simulate' reflections
     72 that are created at the end of a string using type BWD or BOTH together.
     73 In the BWD setting with high Q setting the comb filter can self oscillate.
     74 Excited with a transient noise it can produce string like sounds.
     75 
     76 TIP: When using it in a voice make sure the Envelope doesn't sustain at 0 to prevent 
     77 the voice being killed while the filter is still making nice sounds. 
     78 
     79 User Interface
     80 ~~~~~~~~~~~~~~
     81 
     82 image:images/uifilter.png[]
     83 
     84 * *C.freq*: Cutoff frequency
     85 * *Q*: Level of resonance for the filter
     86 * *V.SnsA.*: Velocity sensing amount for filter cutoff
     87 * *V.Sns.*: Velocity sensing function
     88 * *freq.tr*: Frequency tracking amount. When this parameter is positive, higher
     89              note frequencies shift the filter's cutoff frequency higher.
     90 * *gain*: Additional gain/attenuation for filter
     91 * *St*: Filter stages
     92 
     93 NOTE: TODO add a lengthy section on the formant filter setup