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

oscillators and the Web Audio API

From: Phil Burk <philburk@mobileer.com>
Date: Mon, 06 Feb 2012 18:19:05 -0800
Message-ID: <4F308A19.10109@mobileer.com>
To: public-audio@w3.org
I have begun doing some experiments with the Web Audio API described here:

<https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html>

In general, I really like the API. It will be great to have a flexible
set of synthesis modules available from JavaScript.  I was impressed
with the inclusion of FFT support, convolution, occlusion, etc. I was
also very happy to see that timestamps are supported. That is so crucial.

I am now trying to do some "Hello World" type examples and have hit a
few snags. Perhaps someone could help me.

My first test was to generate a tone using an oscillator.

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

But I could not find the oscillator class. I could use a looping buffer
but that would be difficult to use for FM or multi-octave sweeps. It is
also difficult to control aliasing with a looped wavetable, even with
multi-point interpolation.

Luckily I was able to use a JavaScriptNode to implement a simple sine
oscillator. It would be nice to have an AudioOscillator class with sine, 
sawtooth, square, pulse and impulse. The oscillator should accept
frequency values that can go negative for extreme modulation.

An AudioNoise class would also be very useful with white noise, pink
noise and red noise generation. Stochastic synthesis is very handy for
wind, explosions, percussive sounds, etc.

Thanks,
Phil Burk
Received on Tuesday, 7 February 2012 02:22:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 7 February 2012 02:23:00 GMT