[sdiy] Analog Modeling, with a computer!

Sean Costello seancostello2003 at comcast.net
Wed Sep 14 21:38:07 CEST 2005


Hi Jeff, Antti:

One thing that is important to realize: Cheating is OK when it comes to
computer audio. For most of the industry, the goal is to get a good sound,
but as CHEAPLY as possible. Cheap, in terms of CPU cycles, memory usage,
etc. The less CPU cycles, the more voices you can get, and/or the cheaper
the DSP you can use.

There are a few different schools of modelling, both physical and analog.

- One school is based on absolute accuracy - difference equations,
mass-spring, modal synthesis for physical models, and circuit level models
for analog models. You tend to find more of this in Europe - IRCAM, HUT,
etc.
- Another takes shortcuts, based on the assumption that the exact physical
model is not as important as the sonic results. This school uses waveguides
for physical modelling, and other shortcuts for analog modelling that
emulate the filters and oscillators that are used, but use some design
tricks to avoid oversampling. This is centered around Stanford.

There are other schools, of course, but they fall under the categories of
completely cheating (i.e. wavetables with a simple filter on the output,
totally linear - or using FM or some other filterless synthesis technique to
emulate subtractive synthesis) or just not getting it.

For example, here is an incomplete history of emulating VCFs in digital,
from a slight CCRMA slant (I am not a student there, but work with a lot of
CCRMA folks):

- 1980 - Hal Chamberlin publishes digital derivation of state variable
filter in Musical Applications of Microproccesors. No description of how it
is derived, no discussion about how it blows up at 1/6th the sampling rate.
Still, it sounds great, and works well, especially in fixed point (where it
will NOT blow up the way it does in floating point - try it some time). The
filter is linear, but Chamberlin does discuss embedding nonlinearities in
the filter for percussive sound generation, so even at this early stage
nonlinearities are discussed.
- Late 1980's - Bernie Hutchins publishes a paper in Electronotes on a
digital version of the Moog filter. Unfortunately, his derivation does not
include the one-sample delay that is unavoidable in a digital realization,
so his results are probably skewed. Linear only.
- 1992 - Dave Rossum publishes a paper in ICMC proceedings, discussing how
to make digital filters sound more analog. His examples show how the summing
junction of a standard 2-pole filter can contain a nonlinearity, that
results in more "analog" behavior (response of resonant peak when input
amplitude increases, mode locking, etc.). Rossum discusses both the implicit
nonlinearity of saturation math on a fixed point DSP, as well as designing
an S-shaped nonlinearity for more analog behavior.
- Mid 1990's - Perry Cook designs a digital Moog filter for some company.
Not published, but a lot of this stuff is not published.
- 1996 - Tim Stilson publishes paper on digital realizations of the Moog
filter. Discusses root locus, as well as fact that feedback delay needs to
be accounted for. The paper discusses a lot of different realizations,
including a compromise setting of the zeros in the first order cascaded
filters that has a reasonably flat Q response as frequency is swept, thus
eliminating a lookup table for Q. The assumption is that oversampling is not
necessary (which is important when working with a modular synthesis language
such as SynthBuilder or MAX/MSP, when you are working with delays and
buffers that are running at the output sampling rate). Paper does not
discuss nonlinearities, but nonlinearities are assumed at code level (see
the CLM Moog example as an illustration).
- 1996 - Stilson's filter ported from fixed point to floating point. The
implicit saturation that was found in the fixed point version is replaced by
explicit clipping, tanh distortion, and other waveshaping in various
experiments.
- 1998 - Harvey Thornburg has presentation on various configurations of
nonlinearities in Stilson's filter architecture. Discussions on where
nonlinearities should go, as well as what types of nonlinearities
(polynomial waveshaping used, that is not necessarily tanh based). Thornburg
publishes paper in 1999 discussing the nonlinearities, but not in the
specific Moog filter context.
- 1998 - Paper published in ICMC by an author I forget (Duane Wise, maybe?),
discussing emulating Moog filter with allpass filter feedback configuration
(to create resonant peak) and 4 1 pole filters (to emulate lowpass
filtering).
- 1998 - first moogVCF unit generator in Csound. Implemented incorrectly.
- 1999ish - Native Instruments Generator ships with 4-pole filter emulation,
that uses 4 1-pole filters with soft clipping after each stage, and feedback
around the whole unit. By the time Reaktor 3.0 is released, this has been
wrapped up as a unit generator, where the type of clipping is selectable
(selecting the lowest quality turns off the clipping, which makes the filter
blow up when audio rate FM is used). Other Generator examples use cascaded
2nd order filters, with nonlinearities in between, to emulate 4th order
filter of TB-303.
- Late 1990's - early 2000's - Lots of virtual analog filters created by
music industry. Some of them are obviously Chamberlin filters, while some of
them seem to be copying Stilson et al.  Others seem to be using Rossum
method, or some other method where 2nd order sections are combined with
nonlinearities to create 4th order responses. Nothing is published on this
subject - just a few hints on Music DSP list.
- 2004 - Antti Huovilainen publishes paper describing derivation of Moog
filter from circuit modelling perspective. Ported over to Csound and
Supercollider. Excellent sound. Assumes oversampling. Uses multiple
instances of tanh - 8 per instance of filter (where the filter instance
increases with oversampling). Filter nonlinearities embedded within one-pole
filters, which was implicit in older Moog modules that used saturation in
fixed point, but was generally not found in floating point models (where the
saturation tended to be between filter stages).

As far as Antti's statement:

> There are two possible ways to go about modelling a particular synth
> circuits (say a filter): You can measure the response, tuning etc of the
> circuit and try to tweak your digital model to fit that or you can start
> from the schematic and derive a model based on that. Most people do the
> first while I much favor the latter.

There is also the perspective of starting from a physical or circuit model
of the thing to be modelled, coming up with a digital realization, and then
working with that model and simplifying it in order to get similar sonic
results at lower cost.

Sean Costello




More information about the Synth-diy mailing list