[sdiy] Digital Waveshape Generator.

Donald Tillman don at till.com
Sun Jul 13 06:55:52 CEST 2025


On Jul 12, 2025, at 7:20 PM, brianw <brianw at audiobanshee.com> wrote:
> 
> 
> On Jul 12, 2025, at 3:04 PM, Donald Tillman wrote:
>> On Jul 11, 2025, at 4:30 PM, Richie Burnett wrote:
>>>> I don't see any advantages to a divider approach.  And there are a
>>>> number of disadvantages, such as the lack of portamento that you
>>>> mentioned in your writeup.
>>> 
>>> The advantage of this divider approach is that you don't get any aliasing because each pitch period is an integer number of samples at whatever (variable) sample rate the wavetable is currently being played out at.
>>> 
>>> This isn't the case for phase-accumulator / DDS based designs with a fixed sample rate, where you either have to have lots of copies of the waveform in memory with progressively fewer harmonics for the higher notes to eliminate aliasing _OR_ instead choose a *very* high sample rate and settle for whatever aliasing remains.
>> 
>> I believe it's standard operating procedure to store waveforms that won't alias at the intended frequencies.  And that this usually involves separate waveforms for each octave above a certain point.  And that's not really a problem because for each octave up you only need half as waveform many entries.
>> 
>> Not that I'm endorsing digital oscillators or anything...
> 
> Are you referring to variable-sample-rate circuits or phase-accumulator circuits?
> 
> In the case of hardware that can actually vary the sample rate, with exactly one new data value per D/A conversion, you are correct that it's possible to create waveforms that are not aliased. However, it's quite easy to use naïve techniques to generate algorithmic waveforms that are already aliased, so that all methods of playback would include inharmonic images. The best approach here is to calculate waveforms as a weighted sum of sine waves, stopping before the point of aliasing, rather than "drawing" the waveform without constraint.
> 
> In the case of phase-accumulator based designs with a fixed sample rate, data values may be repeated or skipped on each subsequent D/A conversion, and this process creates a mess of aliasing due to the non-bandlimited sample-rate-conversion that is occurring. Of course, many digital synths use this approach and the bright aliased harmonics are considered "sheen" to excite the LPF.

A variable sample rate oscillator, with sequential waveform values, is just playing back the samples.  The samples themselves could have aliasing issues, but those are easy to avoid, and they would just show up as harmonics of the fundamental.  (So you can always claim that you intended it that way.)

In the case of phase accumulator oscillators, any aliasing will show as non-harmonic artifacts.  That never sounds good.  So you need to address that.  It's not too difficult; use separate waveforms for higher pitches and make sure none of them alias.

Some side notes:

Oscillator waveforms in the Web Audio API are spec'd as sums of sine and cosine waves.  Similar reasoning.

My memory is telling me that the first Kurzweil keyboard used a sample for some number of consecutive notes, and a variable sample rate to avoid aliasing issues. 

Tim Stilson suggests storing band-limited impulses:
    "Alias-Free Digital Synthesis of Classic Analog Waveforms"
    https://ccrma.stanford.edu/~stilti/papers/blit.pdf

It might also be worth considering some variation on the ARP Soloist oscillator.  Then you can play the 7/4 solo from "Cinema Show".

  -- Don
--
Donald Tillman, Palo Alto, California
https://till.com




More information about the Synth-diy mailing list