Skip to content

Bilinear (First Order IIR) Filter


Filters its inputs by a first order IIR filter controlled by a set of three coefficients.

Syntax and Default Values

The bilinear-filter controller can be created using the following Lisp or mlys.lua (in Modalys for Max) syntax:

(make-controller 'bilinear-filter
This controller takes 3 parameters.

                          input=<controller of any dimension>,

The dimension is automatically the same as the input controller.
The coefficients parameter can be a controller (3-dimensional), but if passed as a table of 3 values, it can be modified dynamically via Max messages with MyBilinearFilter@coefficients


  • dimension: number of dimensions of the input and output controllers.
  • coefficients: a 3-dimensional controller specifying the 3 bilinear filter coefficients.
  • input: filter input (a controller).

dimension must be the same as the input controller's dimension.
The coefficients controller should be 3-dimensional representing the a0, a1 and b1 coefficients.
This controller is updated at every sample (period = 0).


This filter implements a general first-order (one-pole one-zero) filter which can be used for a variety of purposes, including smoothing out envelopes, and filtering sound-file, signal or other controllers. The following example is shown in one of the graphs (with a 1 Hz cutoff) in the above image:

(setq sp (get-info 'sample-period))
(setq my-env (make-controller 'envelope 1 
         (list '(0 0.0) '(0.1 0) (list (+ 0.1 sp) 1) '(1.5 1) (list (+ 1.5 sp) 0)) ))
(setq cutoff 1)
(setq val (sin (* cutoff 2 pi sp)))
(setq my-coef-ctl (const (list val 0 (- val 1))))
(setq my-filtered-env (make-controller 'bilinear-filter 1 my-coef-ctl my-env))
You should probably consider using it or the biquadratic-filter, instead of the older filtering functions. However, you will need to generate your own sets of coefficients from higher level parameters such as center/cutoff frequency, etc....

★     ★