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

Re: BufferSourceNode to AudioParam Connection

From: Chris Wilson <cwilso@google.com>
Date: Tue, 6 Nov 2012 00:14:20 -0800
Message-ID: <CAJK2wqU0wTL7jiYCt01T+Q1T4osk+8G4VOvG54Ltz-xqEoHL_A@mail.gmail.com>
To: Nick Thompson <ncthom91@gmail.com>
Cc: "public-audio@w3.org" <public-audio@w3.org>
Hey Nick-

I believe what you are hearing is correct.  Remember, gain.gain is an
a-rate AudioParam - so you're modulating that A-440 sine wave with an
audio-rate signal, essentially "every sample".  Your drum pattern is
heavily noise-based - so that noise is modulating your sine wave every
sample, and what you get back is essentially filtered noise.  You notice it
doesn't sound precisely the same - it's essentially being filtered.  You
may notice that it's dropping any frequencies lower than 440Hz.

I think what you're trying to do is modulate your oscillator source with an
envelope follower of sorts - that is, have the oscillator "pulse" in time
with the drum beat?  We don't really have an envelope follower node today
(I've mentioned this request to Chris) - you can sort of use a
DynamicsProcessor to do it, but 1) that doesn't have an AudioNode output
that you can connect() anywhere, and 2) I recently discovered that the
reduction doesn't drop quickly enough to be super-useful for some
scenarios; that's just by design for a dynamics processor, I think.


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!
> Thanks
> -Nick
Received on Tuesday, 6 November 2012 08:14:49 UTC

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