## Simple Oscillator in Gen~

Sep 20 2012 | 6:07 pm
Ok bear with me while ask what must be very mundane questions for you Gen wizards.
I want to make an oscillator from scratch in gen~. I was looking on page 3 of this paper for an implementation model: http://www.icst.net/fileadmin/data/pdf/dsg/Digital_Sound_Generation_1.pdf
I'm having some trouble correlating the block diagram to what I should be doing in gen~, but here's my meager attempt at making a sine wave. I'm using a biquad for the "postfilter."
How can I get rid of the rest of the upper frequencies? It seems I need a way to boost the signal the lower I set the cutoff frequency. Are there any other articles or sources that explain how to do this better?
Thanks for humoring me. :)
Dave

• Sep 24 2012 | 7:48 pm
You're missing the mapping function (here it's: y = sin(2*pi*x)), so you're getting a lowpass-filtered sawtooth (also with quite a bit of DC offset!). You actually don't need the post filter probably. By using a big-enough lookup table (or calculating the result) you shouldn't need post-filtering. That's usually more a way of correcting some of the spectral inaccuracies in certain oscillator designs. (for instance, the DPW algorithm)
Note that if you don't need instantaneous phase reset (e.g. hard sync) you can just use phasor for your phase incrementer. If you want to be really simple, you can just use cycle, but I'm guessing that may be beside the point of what you're trying to do.
• Oct 04 2012 | 7:40 pm
Thanks for replying Peter, and sorry for not responding. I've been in filterland all this time and the oscillator is kind of a side project. Implementing the mapping function is doing my head in. Simply using Gen~ operators that are analogous to the components of the equation (e.g. pi) doesn't seem to do much. Any hints on how to implement the mapping function?
The rest of what you said in your post tells me that perhaps I need to study more before I try this again…
Dave
• Oct 04 2012 | 8:24 pm
Just take your 0-1 phasor-ish signal, multiply by 2*pi, and take the sine. You could do it in expr as: sin(2*PI*in1)