[sdiy] "AVR synthesizer"
tsheets at saturn5.com
tsheets at saturn5.com
Tue Feb 15 18:46:19 CET 2005
So no resonance on the filter?
-troy
On Tue, Feb 15, 2005 at 05:54:14PM +0100, Jaroslaw Ziembicki wrote:
> > Could you give us a very high-level description on how you programmed
> > the oscillator, and especially the filter?
>
> OSCILLATOR:
> I used the "direct frequency synthesis". A three-byte counter (= phase) is
> being incremented by a value which is proportional to the sound frequency
> (= phase delta). The increment takes place every sampling period, i.e. each
> 32 us. The most significant byte of the counter is the sawtooth wave.
> The square wave is a result of comparing the sawtooth wave to 128.
> Each oscillator has its own "phase" and "phase delta" registers.
> The contents of each "phase delta" register depends on the frequency
> being generated:
> PHASE DELTA = 2^24 * Freq / SamplingFreq
> where:
> SamplingFreq = 31250 Hz
> Freq = 440 * 2^((n-69+d)/12)
> where in turn:
> n = MIDI note number
> d = transpose/detune (in halftones)
>
> FILTER:
> This is probably the simplest low pass digital filter ever invented; the
> formula is:
> y[i] = y[i-1] + m*( x[i] - y[i-1] )
> The greater the m, the higher the cutoff frequency. For m=0 there is no
> AC signal on the output, and for m=1 the output is a copy of the input.
> I used 16 bit shifts in order to multiply by m because the AT90S8535
> has no multiplier.
>
> OK, I hope it helps.
> Regards, Jarek
--
------------------------------------------------------------------------------
tsheets at saturn5.com <- You have found me
http://www.ferrapsylix.com <- sub atomic breakbeat
"I just don't have the discipline to be a hippie" <- Homer J. Simpson
More information about the Synth-diy
mailing list