Dual LFO with choice of waveforms using PT8211 and Blue Pill

Post your cool example code here.
User avatar
RogerClark
Posts: 7478
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Dual LFO with choice of waveforms using PT8211 and Blue Pill

Post by RogerClark » Wed Nov 29, 2017 11:28 pm

I presume you will need to control the speed at which the DMA sends the wave table, otherwise you will have no control over the frequency of the output waveform, as it will just go as fast as the DMA can push it to the SPI bus, i.e 36Mhz if you want...

User avatar
KenLaszlo
Posts: 18
Joined: Sun Oct 29, 2017 3:28 pm

Re: Dual LFO with choice of waveforms using PT8211 and Blue Pill

Post by KenLaszlo » Wed Nov 29, 2017 11:49 pm

Well this appears to be the thing :)

My approach was that the frequency was controlled by a phase accumulator variable, rather than a set frequency in which data is sent via DMA.
So (in simple terms) the data send rate is set, but the amount of samples being sent changes.
In fact, I have done just this. I have written some code for a VCO (DCO) running with multiple waveforms output up to about 12Khz and fully controllable. The problem is . . . terrible aliasing for anything above 1.2Khz caused by not being able to run at a high-enough sample rate.

Ken

User avatar
RogerClark
Posts: 7478
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Dual LFO with choice of waveforms using PT8211 and Blue Pill

Post by RogerClark » Thu Nov 30, 2017 12:24 am

I didnt look at your code, but are you interpolating values your wavetable ? to generate extra data ?

I'm no expert in this, but I presume to get the best resolution on the output, you always need to run at the max sample rate and build the DMA buffer accordingly, e.g. by interpolating intermediate value between those in your wavetables

However depending on your interpolation algorithm and how many points you'd need to create, the processor speed will be the limitation.

Post Reply