Re: Web Audio API questions and comments

>
> I think my last question on this is what is the recommended way of
> creating the equivalent to variables?  So say I wanted to add a dc
> offset of 50 to a signal, am I expected to use a JavaScriptAudioNode
> which outputs 50s, waveshape an oscillator so it outputs 1 and use an
> AudioGainNode to scale it up to 50, or do something else clever which
> I haven't thought of?  I still think a node which just outputs the
> value of an AudioParam would be nicer than either of these two
> solutions.
>

I'd just use a WaveShaperNode here of f(x) = x + 50

I've currently got a (hacky) helper function in my toolbox that creates
WaveShaperNodes from arbitrary JS transforms for this kind of thing, and I
fully expect such a thing to become an essential and integral part of every
non-trivial Web Audio framework.

(Of course, why you'd want to add a DC offset in the first place to an AC
signal is something of mystery to me but exploratory DSP respects no
limits.)


Anthony.

Received on Thursday, 21 June 2012 10:22:28 UTC