[sdiy] super cheap synthisizers
Theo
t.hogers at home.nl
Tue Jun 11 22:18:58 CEST 2002
No the AVR won't do.
I think a timer speed of 4Mhz is about the minimum for good results.
Even at 16 Mhz, a 1 Mhz timer interrupt means there are
only 16 clock cycles between two interrupts.
Because we need some jumps and jumps take more time,
in practice this translates to about 10 instructions.
This is barely enough for jumping to the interrupt handler and updating
and evaluating two 16 bit "soft timers" and setting the output bit.
Let alone evaluating midi or do a envelope or two.
However AVR do have what it takes to make a single oscillator voice.
One 16 bit timer for the oscillator and the remaining 2 timers can be
"multiplexed" into 4 PWM channels for cutoff, resonance, PWM and
VCA control voltages.
Because with the timer method a DCO takes very little processor time
there is plenty left for; midi handling, LFO, envelopes and other fun.
Maybe adding a external timer IC like the 8254 is a solution.
That would be 3 independent 16bit counters, enough for 3 DCOs
leaving an other 3 timers inside the AVR free for generating CVs.
But this is no longer a "single" IC solution.
Its just a personal taste, but IMO running a interrupt at a normal
sample rate and do phase accumulation with DAC output as
someone proposed is out of the question.
The goal is analogue oscillators with digital timing correction.
Although a 16 Mhz AVR could do 4 or maybe more phase
accumulation oscillators. I think in this kind of setup it would make
more sense to use a cheap DSP and go all digital.
Theo
From: Ingo Debus <debus at cityweb.de>
>
>
> Paul Maddox wrote:
> > If you have TWO internal counters (just adding two 16bit numbers) you
only
> > need ONE timer..
> >
> > I mean;-
> >
> > Have a timer so it goes at say 1Mhz, yes?
> > Now have TWO speed values
> > Freq_a and Freq_b
> > use TWO accumulators
> > acc_a and Acc_b
> >
> > each time the timer fires (1Mhz) you do this
> >
> > acc_a = acc_a + freq_a
> > and
> > acc_b = acc_b + freq_b
> >
> > bingo two oscillators ONE timer...
>
> Ugh. Are AVRs really that fast?
> Can it still process incoming MIDI now and then?
>
> Using a 12 Mhz 8051 clone (shortest instruction execution time 1
> microsecond) right now I'm not even dreaming of that speed. But then
> it's fast enough for my purpose.
>
> Ingo
>
>
More information about the Synth-diy
mailing list