W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2012

Re: Web Audio API ambient drone

From: Chris Wilson <cwilso@google.com>
Date: Thu, 19 Jul 2012 06:51:20 -0700
Message-ID: <CAJK2wqUoxa6GXQXqjRGN_3WYn4wvZwDTs1eNa+WXnTQ4KnHknw@mail.gmail.com>
To: lonce wyse <lonce.wyse@zwhome.org>
Cc: public-audio@w3.org
No, I knew that - Matt had said when he looped it previously, he could hear
a perceptual looping effect.
On Jul 19, 2012 6:32 AM, "lonce wyse" <lonce.wyse@zwhome.org> wrote:

>
> Hello,
>
>     I don't think anything is broken.
>     If you listen to his drone (with non-looping noise) you can hear a
> slow evolution of timbre. This is due to the subtle differences in
> frequency content being generated by the different noise sources over time,
> combined with his extremely narrow filters on each source.
>     If you can hear the slow variation in time given his original
> algorithm, then it is clear that using 2-second looping noise sources
> (assuming they all had the same loop durations) would create an audible
> 2-second repeating pattern.
>     No need to fix anything!
>
> - lonce
> --
> Lonce Wyse, Associate Professor
> Communications and New Media
> Director, IDMI Arts and Creativity Lab
> National University of Singapore
> www.anclab.org <http://anclap.org>
>
>
> On 17/7/2012 12:49 AM, Chris Wilson wrote:
>
> Hmm.  If there is a perceptible looping effect, that's broken and should
> be fixed.  (I used looped noise in the web audio vocoder (
> webaudiovocoder.appspot.com, needs Chrome Dev channel or better), and
> never noticed a problem.)  If you happen to run across it again, could you
> forward me a repro case?
>
>  -C
>
>
> On Sun, Jul 15, 2012 at 1:06 PM, Matt Diamond <mdiamond@jhu.edu> wrote:
>
>> Thanks for the tip! An earlier version of this did in fact use
>> pre-computed noise buffers, but I felt there was a vaguely perceptible
>> "looping" effect because of the looping noise sample (it was a cool effect
>> though). Another reason was that I was presenting a version of this script
>> at a meetup, and felt like utilizing a JavaScriptAudioNode for real-time
>> noise generation would be more interesting to demonstrate... but yes, it
>> certainly takes a bit of a toll, and running a bunch of AudioBufferSource
>> nodes would probably be much less taxing.
>>
>>  Still, I'm pretty impressed that the API is able to handle so much,
>> even if it's only on higher-end machines (I'm running it on a year-old
>> MacBook Pro).
>>
>>  Matt
>>
>>
>>  On Sun, Jul 15, 2012 at 8:03 AM, Chris Wilson <cwilso@google.com> wrote:
>>
>>> Hey Matt-
>>>
>>>  Neat!  I like the apparent pitch generated by bandpass filter.
>>>
>>>  One comment - instead of continually generating noise via
>>> JavaScriptAudioNodes, you'd probably find it much more performant to
>>> pre-generate a couple of seconds (to avoid any detectable periodicity) of
>>> noise in a Buffer and playing it as an AudioNode.  That would probably be a
>>> bit more performant than continually calling Math.random for each sample.
>>>
>>>  var lengthInSamples =  2 * audioContext.sampleRate;
>>> var noiseBuffer = audioContext.createBuffer(1, lengthInSamples,
>>> audioContext.sampleRate);
>>> var bufferData = noiseBuffer.getChannelData(0);
>>> for (var i = 0; i < lengthInSamples; ++i) {
>>>     bufferData[i] = (2*Math.random() - 1);
>>>  }
>>>
>>> On Sat, Jul 14, 2012 at 12:26 PM, Matt Diamond <mdiamond@jhu.edu> wrote:
>>>
>>>> Hey all,
>>>>
>>>>  Put together a little experiment in synthesizing an ambient sound
>>>> texture using the Web Audio API:
>>>>
>>>>  http://matt-diamond.com/drone.html
>>>>
>>>>  Matt
>>>>
>>>
>>>
>>
>
>
>
>  <http://anclap.org>
>
Received on Thursday, 19 July 2012 13:51:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 19 July 2012 13:51:54 GMT