Synthesizer Performance, Part 4

Jan 21, 2014 10:46

I found that the virtual analog filter takes about half the total CPU time. Half of that seems to be the soft saturation function in the filter feedback path. I'm using a rational polynomial approximation of hyperbolic tangent that's faster than tanh() but not by as much as I had hoped. A simpler cubic curve and a hard clipping function (clamp) were faster still but don't have the soft saturation characteristics that make tanh() work so well.

(The filter is 2x oversampled so it gets run 1,536,000 times a second for 16 voices. Even simple operations can take a while when done that many times.)

I have two graphs on Desmos that compare saturation function response curves and what they do to a sine wave. (I should probably combine those two graphs into one.)

synthesizer, programming, music

Previous post Next post
Up