W3C home > Mailing lists > Public > public-audio@w3.org > October to December 2012

Re: BufferSourceNode to AudioParam Connection

From: Chris Rogers <crogers@google.com>
Date: Tue, 6 Nov 2012 10:34:08 -0800
Message-ID: <CA+EzO0=V-xD0DKTZhzqVDuirRejoPupDkMh8Tc9gUrfkHK=cXg@mail.gmail.com>
To: Nick Thompson <ncthom91@gmail.com>
Cc: public-audio@w3.org
On Mon, Nov 5, 2012 at 5:40 PM, Nick Thompson <ncthom91@gmail.com> wrote:

> Hey all,
> I'm currently experimenting with sidechain implementations, and I've
> noticed a discrepancy in the way AudioNode's connect to AudioParams.
> If you route an Oscillator into an audioparam, the output of the
> Oscillator does not reach AudioContext.destination unless you specifically
> connect it thereto. Example: http://jsfiddle.net/Ddz3y/1/ In this
> example, the output of one oscillator simply modulates the gain on the
> output of another oscillator, as you would expect.
> However, if you route a BufferSourceNode into an AudioParam, the output of
> the BufferSourceNode still reaches AudioContext.destination even if you
> don't specifically make that connection. Example:
> http://jsfiddle.net/VdLf6/ Here, you'll notice the same setup as in the
> previous example, and you'll notice that the output of the OscillatorNode
> is clearly audible when the buffer sample's kick drum is played, but at the
> same time, the buffer itself is fully audible even though I did not specify
> a connection to AudioContext.destination (unless you're counting the
> connection from bufferNode -> gain.gain, gain -> context.destination).
> I'm not sure what to make of the discrepancy here. A bug in the
> implementation? Or perhaps that's the expected behavior? If that's the
> case, I feel the documentation should be updated to reflect that, as it was
> pretty unexpected. Or maybe I'm just approaching/using this feature
> incorrectly? If that's so, please correct me!

Hi Nick, cool demo!  I'm pretty sure it's working correctly and what you're
hearing is the frequency-shifted (higher and lower) versions of the drum
beat.  This is ring-modulation and it's normal for it to sound this way.
 Notice that if you tweak the oscillator frequency much higher (like 8000),
the character of the drum is very different.  Also keep in mind that with
an AudioGainNode, it doesn't matter which one is the input and which one is
controlling the .gain param since the two signals are just being
multiplied.  In other words, x*y is the same as y*x

So, there is no "direct" sound of the drums, and what you're hearing is a
processed version.


> Thanks
> -Nick
Received on Tuesday, 6 November 2012 18:34:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:03:14 UTC