Re: AudioBufferSource usage

On 22/07/2012 10:48, Peter van der Noord wrote:
> For some reason, i've been reasing over this sentence a few times
> without actually realizing what it meant:
>
> "Once an AudioBufferSourceNode has reached the FINISHED state it will
> no longer emit any sound. Thus noteOn() and noteOff() may not be
> issued multiple times for a given AudioBufferSourceNode."
>
> This strikes me as quite odd, what's the reasoning for this?

The philosophy appears to be that the buffers are "one shot" only, and
anything that they're connected to is potentially garbage collected as
soon as the sample is played.

All nodes appear to be considered short-lived, and if they're not 
connected to anything they'll get garbarge collected.   If you need to 
play the sample again, it's considered "cheap" to instantiate a new 
node, and reconnect it.

Like you, I would prefer to think of nodes as the parts of a modular 
synth, that stay around until they're explicitly disconnected from all 
of their inputs and outputs.

Ray

Received on Sunday, 22 July 2012 10:36:32 UTC