[sdiy] Wavetable Design Update

Dave Manley dlmanley at sonic.net
Wed Feb 2 10:10:34 CET 2011


On 2/2/2011 12:49 AM, Matthew Smith wrote:
> Quoth Veronica Merryfield at 02/02/11 18:59...
>> Use a spreadsheet to do it all with the percentage
>  > error, then pick the best. Should take about an hour
>  > to get the formulas done then it's just about picking
>  > the values.
>
> Similar idea - I was guessing I was going to tackle this in Perl, building the rules as I saw what got spat out.
>
> But this is the "static" method - would this mean that me picking values would mean that an on-the-fly calculation simply isn't feasible?
>
>> Also, have a think about cutting the top end. The upper harmonic
>  > content will be from the sample rate and you won't need
>  > anything about 20Khz. However, some say 10Khz is enough
>  > in practise although midi note 127 is 12khz.
>
> I'm only covering the MIDI note range, so 12.n kHz is the ceiling.
>
>> If you have a low pass filter at 12Khz, a square wave would do
>  > for note 127 since the ear is not too good at hearing
>  > 24Khz. However, this may be heresy to some :)
>
> I know what you mean. I keep telling myself that I'm building a musical instrument, NOT a piece of laboratory test gear!
>
> But changing the waveform dependent on frequency would add quite a huge complication to the design. As it is, the whole system is pretty 'dumb' - it just takes a note, generates a clock frequency of
> f*256, scans the EEPROM, outputs to DAC. Getting f is my biggest problem!
>
> For reference, this is my note frequency lookup table generator:
>
> www.smiffysplace.com/files/miditab.pl
>
> ...and this is the resultant .csv formatted with OpenOffice Calc:
>
> www.smiffysplace.com/files/miditab.ods
>
> If I need to do further calculations, I'll just tweak miditab.pl
>
> Cheers
>
> M

Earlier I threw your top freq into a spreadsheet, divided down by 2^(1/12) 126
times and got to your bottom number, then divided the lot by 256 and
got the correct frequencies.  So your calcs are correct.

I just downloaded the AVR doc:

AVR130: Using the timers on tinyAVR and megaAVR devices

Since you're limited to integer divides, I think the errors are going to be
pretty large at the higher frequencies.  Perhaps you could use different load
values and jitter the clock to better approximate the required fractional divide.

It's too late for me to do anything more tonigh and be of any value at work tomorrow. |-)

Dump the frequency generation in the AVR and have your CPLD do a fractional
divider!

-Dave



More information about the Synth-diy mailing list