[sdiy] Wavetables

Matthew Smith matt at smiffytech.com
Sat Jan 22 23:13:01 CET 2011


Quoth Paul Maddox at 23/01/11 04:38...
...
> ok, no worries, but if you're F/Fs update at 1.5Mhz, with 128 samples,
> my math equates that to 117Khz of update rate.

I was calculating 128 samples per cycle at a nominal 12kHz to get that 
figure - not saying I didn't get it wrong though!

> variable sample rate playback, fixed width sample :-)
> exactly how I did with the Monowave.

Well, that's good to hear. If I've arrived independently at a concept 
similar to something that works, it shows it isn't a totally 
hare-brained idea.

I'd like to clarify to all though that it had always been my intention 
to use a fix number of samples - think I may have conveyed the wrong 
impression at some point.  When I first figured out that there could be 
an aliasing issue down at the low frequency end, I briefly considered 
having, say, a tone generator for every two octaves (with different 
sized samples,) but rejected this out of hand as it didn't tie in with 
the simple/discrete hardware model which took nothing but a square wave 
into its counters. (Would require an assigner or something like that or 
some HORRENDOUS discrete logic.)

But as Tom reminds me that limited samples doesn't necessarily *sound* 
bad and Scott suggests providing the means to drop the sample rate - hmmm..

It's going to be a lot easier to set up the proof-of-concept by dropping 
the discrete logic (for the time being) and doing it all in software 
(which I was trying to avoid.) So the hardware becomes microcontroller 
talking directly to DAC - counting done internally, no square wave 
output to system. [Note to self: refer to Gordon's* and John L's** code 
whilst writing this.] And, to keep things really simple, just start out 
with a sine wave. At least I know what they should look like when I look 
at my scope ;-)

Doing this will allow me to experiment with different waveforms without 
having to muck around with programming external memory devices, until 
everything is proven.  Also means I can run through the table using 
i+=2, i+=4, ..., rather than just i++ - effectively dropping the sample 
rate. (Although I also have to remember to change the scan frequency 
accordingly.)

Mulling this all over since last night, I've decided that I might split 
the MIDI off as a separate section and have this subsystem controlled by 
an I2C message - the desired output frequency. (0 = turn it off.)  Think 
it should make the final system more flexible as tuning, (low) frequency 
modulation can be introduced numerically.

Many thanks again to all who have responded on this - I'm comfortable 
I've got a building block that will work and will proceed on the basis 
that the magic number is 128.

Cheers

M

*  http://www.gjcp.net/~gordonjcp/fmtoy.pde
** http://wiblocks.luciani.org/docs/app-notes/nb1a-nco.html


-- 
Matthew Smith
Smiffytech - Technology Consulting & Web Application Development
Business:      http://www.smiffytech.com/
Blog/personal: http://www.smiffysplace.com/
LinkedIn:      http://www.linkedin.com/in/smiffy
Skype:         msmiffy
Twitter:       @smiffy



More information about the Synth-diy mailing list