After matrixsynth.com picked up “My Sine Oscillator Experiment,” doktor future started a discussion about different ways of emulating analog oscillators in digital. Adam S mentioned that he thought the Plan B sine looked like a piecewise quadratic to him and provided the following function:
y=
-(4/pi^2)[x – (pi/2)]^2+1, x from 0 to pi
(4/pi^2)[x-(3pi/2)]^2-1, x from pi to 2pi
After having checked it out in grapher.app myself, and confirmed it did look similar to the Plan B sine, I implemented this as a wave table in Csound. See piecewise.csd.
Piecewise + Plan B Model 15
In this image, I have superimposed Adam’s recommended piecewise function over the Plan B’s Model 15 sine wave. As you can see, their contours are not quite identical, though very, very similar.
After listening to both waves side-by-side, the harmonic distortion in the piecewise sine example is a tad louder, and the frequencies are just slightly off. At least to my ears. However, I consider it to be a wonderful approximation of the Model 15.
Oh, the Irony
Peter Grenader, the principle designer at Plan B, has this written in his bio:
“In 2001 , Peter returned to analog after a 22 year hiatus because he tired of trying to force digital instruments to behave in like manner.”
I’m finding this whole discussion a bit humorous as the three of us are doing exactly this, trying to force digital instruments to sound like analog. In this case, Mr. Grenader’s analog oscillator.