bqrez
bqrez --  A second-order multi-mode filter. 
Description
A second-order multi-mode filter. 

Syntax
ar bqrez asig, xfco, xres [, imode]

Initialization
imode (optional, default=0) -- low-pass, high-pass, band-pass,
band-reject, or all-pass mode:
     0 = low-pass (default)
     1 = high-pass
     2 = band-pass
     3 = band-reject
     4 = all-pass

Performance
asig -- input signal 

xfco -- filter cut-off frequency in Hz. As of version 3.50, may i-,k-,
or a-rate. 

xres -- amount of resonance. Values of 1 to 100 are typical. Resonance
should be one or greater.  100 gives a 20dB gain at the cutoff
frequency.

bqrez is a resonant low-pass filter created using the laplace s-domain
equations for low-pass, high-pass, and band-pass filters normalized to
a frequency.  The bi-linear transform was used which contains a
frequency transform constant from s-domain to z-domain to exactly match
the frequencies together.  Alot of trigonometric identities where used
to simplify the calculation.  It is very stable across the working
frequency range up to the nyquist frequency.  

All filter modes can be frequency modulated as well as the the resonance
can also be frequency modulated.

Examples
Here is an example of the bqrez opcode. It uses the files bqrez.orc and
bqrez.sco. 

Example 1. Example of the bqrez opcode borrowed from the "rezzy" opcode
in Kevin Conder's manual.

/* bqrez.orc */
/* Written by Matt Gerassimof from example by Kevin Conder */
; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Instrument #1.
instr 1
  ; Use a nice sawtooth waveform.
  asig vco 32000, 220, 1

  ; Vary the filter-cutoff frequency from .2 to 2 KHz.
  kfco line 200, p3, 200

  ; Set the resonance amount to one.
  kres init 25

  a1 bqrez asig, kfco, kres

  out a1
endin
/* bqrez.orc */
        
/* bqrez.sco */
/* Written by Kevin Conder */
; Table #1, a sine wave for the vco opcode.
f 1 0 16384 10 1

; Play Instrument #1 for three seconds.
i 1 0 3
e
/* bqrez.sco */
        

See Also
biquad, moogvcf, rezzy 

Credits
Author: Matt Gerassimoff

November 2002


