oscillators and the Web Audio API

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 UTC