[sdiy] Digital accumulator VCO core?

Gordonjcp gordonjcp at gjcp.net
Wed Feb 10 20:21:05 CET 2021


On Wed, Feb 10, 2021 at 11:28:32AM +0100, Vladimir Pantelic wrote:
> On 10.02.21 09:40, Gordonjcp wrote:
> > On Tue, Feb 09, 2021 at 09:34:00AM +0000, Tom Wiltshire wrote:
> >> There was someone here some years ago who’d done a voltage-controlled oscillator on a dsPIC. The cunning part of that was that the output waveform was a triangle instead of a ramp. That massively reduces the aliasing problems, and since triangle-core oscillators are common, there’s a lot of wave shaper designs you can tack on the end. But the exponential conversion was done inside the chip for obvious reasons. The ADC sample rate was fast enough for it to do convincing FM.
> > 
> > Here's a really simple one on an Arduino that generates an antialiased saw at about 32kHz sample rate.
> > 
> > https://github.com/ErroneousBosh/slttblep
> 
> this line gives me physical pain:
> 
>   theta = pow(2,32) * adc / ref;  // calculate phase shift per sample
> 
> 
> but then, what's a double precision floating point exponential function,
> a multiplication and a division on an 8 bit CPU between friends ;)
> 

Once you add in expo pitch conversion it makes the difference between the main loop running at ~350Hz and 4kHz.  It's a monument to my sins.

In a slightly saner version that I'm not done with yet, the whole damn thing is a precooked lookup table.

-- 
Gordonjcp



More information about the Synth-diy mailing list