[sdiy] Wavetables
Matthew Smith
matt at smiffytech.com
Sat Jan 22 09:35:21 CET 2011
Quoth Scott Nordlund at 22/01/11 17:21...
...
> How are you clocking this?
Microcontroller doing MIDI to square wave at f.n, where n is the samples
per cycle.
I'm working on a single waveform generator at present. If I were to
attempt polyphony, I'd have one microcontroller as an "assigner" (to use
Roland terminology) reading in the MIDI, then passing out to a waveform
generator using SPI or I2C.
So the clock rate to the system should always be pretty accurate,
allowing for crystal variation.
>... Another option is to use
> multisamples. This can also mean that your clock source doesn't have
> be adjustable over such a wide range.
I did wonder whether to split into, say, 4 units, each with a different
number of samples per cycle - but if the hardware can handle the maximum
clock rate, didn't think it necessary in the end.
> Your waveform can correctly represent n/2 harmonics for n samples.
> Above this the spectrum will be inverted and repeated. Historically 128
> or 256 has been reasonable. Very low resolution waveforms are too buzzy.
> It may be useful to reduce this resolution, which you can do by switching
> off address bits.
Ah, now I have a magic number!
128 samples per cycle x 12544Hz (MIDI note 127) = 1.6MHz (ish.)
Have to check that my old rail of flipflops are OK up to that speed - if
not, I might just simplify the whole thing, store the wavetables in
microcontroller FLASH and do it that way. (Might also get me a working
prototype this year rather than who knows when!)
Certainly no problems getting the clock speed from the microcontroller,
as the timer only needs to toggle at 3.2MHz - I'd be running at 12MHz or
even 20MHz.
Many thanks for your input!
Cheers
M
--
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