[sdiy] Help with math, please
Matthew Smith
matt at smiffytech.com
Wed Aug 10 00:45:11 CEST 2011
Quoth Tom Wiltshire at 10/08/11 07:23...
...
> For your envelope generator, you can use your linear value as an index
> into "exponential curve" lookup table and get the required value out
> quickly and easily. If necessary, interpolation can be used between
> table entries to prevent stepping and provide a piecewise-linear
> approximation to the required curve. As a side-benefit, this
> method works for arbitrary curves, so you can easily alter your
> alter your envelope generator to tweak the response,
> or provide responses which aren't available on standard envelopes.
I was about to say the second part of this until I re-read it properly
and saw that Tom already had ;-)
From discussions earlier this year regarding my digital ADSR design, it
became apparent that attack/decay/etcetera parts could be of any shape
required (including ones that would be hard to calculate on-the-fly with
limited resources) using lookup tables (LUTs) - and that a shape can be
used in both directions, simply by reading the table in reverse
(decrementing the counter.)
Really no different from the way I am implementing my wavetable DCO
design: a series of samples (whether waves or curves) of equal length
are held in memory, one after the other. Selecting the appropriate
wave/curve is just a matter of adding an index value to the address
counter stepping through the memory. [My current DCO design uses the
otherwise unused upper three most significant bits of an EPROM address.
These are switched to select one of eight different waveforms.]
Cheers
M
--
Matthew Smith
Business: http://www.smiffytech.com
Blog: http://www.smiffysplace.com
Linkedin: http://www.linkedin.com/in/smiffy
Flickr: http://www.flickr.com/photos/msmiffy
Twitter: http://twitter.com/smiffy
More information about the Synth-diy
mailing list