Re: Oscillators with time-domain custom wave shape

Hello Sébastien,

Monday, March 30, 2015, 4:10:45 PM, you wrote:
> In the past days I've struggled to get an oscillator that would
> output an exact sawtooth. The use case for me is to modulate an
> AudioParam and the approximative sawtooth provided by the
> OscillatorNode is not precise enough. For example, I wanted to loop
> through a sound file, using WaveShaperNode, and drive the read
> position in that file with a sawtooth, but since the decrease after
> the top of the sawtooth is not instant, you can hear a very loud
> artifact when you reach the end of the file (peak of the saw), a bit
> like fast rewind.

Not having an infinite slope is a feature, not a bug (this is
bandlimited synthesis, to minimize aliasing artifacts from frequencies
above Nyquist).

If you want a non-bandlimited sawtooth, you would need to make a
custom oscillator (and subsequent nodes may introduce bandlimiting).

To just iterate through file positions, this is just a loop, right?
Why drive this from a waveform? If you need both file position and
also a waveform, it would seem better to use a loop, the counter for
which is used directly to produce the file position and also to create
a phase pointer for whatever waveform you are generating.


-- 
Best regards,
 Chris Lilley, Technical Director, W3C Interaction Domain

Received on Tuesday, 31 March 2015 18:02:39 UTC