W3C home > Mailing lists > Public > public-audio@w3.org > January to March 2012

Re: Generators

From: Phil Burk <philburk@mobileer.com>
Date: Tue, 13 Mar 2012 12:06:28 -0700
Message-ID: <4F5F9AB4.2050901@mobileer.com>
To: public-audio@w3.org
Hello Chris,

 > has any one seen a simple example of generating a sine
 > wave that can be swept using a slider,

This web page has an example of a sine wave oscillator.

< http://www.softsynth.com/webaudio/tone.php>

It maintains a phase variable that is incremented for each sample. The 
frequency can be swept or modulated without glitching by updating the 
phaseIncrement variable.

 > for example, up to high
 > frequencies without aliasing?

You don't have to worry about aliasing when using a sine wave unless you 
are modulating it at audio rates. Aliasing is a big problem with 
sawtooth and square waves because they contain high frequency partials 
that go above the Nyquist rate.

Phil Burk
Received on Tuesday, 13 March 2012 19:07:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 13 March 2012 19:07:07 GMT