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

Re: Node lifetime question

From: Raymond Toy <rtoy@google.com>
Date: Mon, 3 Oct 2016 15:20:55 -0700
Message-ID: <CAE3TgXH_i11oZ5SJ-nektE4yTqd3dBcFzLbsg4cR_n0k0N+3NQ@mail.gmail.com>
To: Joe Berkovitz <joe@noteflight.com>
Cc: Audio Working Group <public-audio@w3.org>
Once oscB has stopped, and because you've dropped all references to both A
and B, does it matter anymore?  Nothing is observable anymore and you can't
make them observable, so it seems to me we don't have to say anything.  The
implementation can do whatever it wants now.

On Mon, Oct 3, 2016 at 8:04 AM, Joe Berkovitz <joe@noteflight.com> wrote:

> But in that case, A and B both have "playing" references as per the
> Lifetime section of the spec, so JS references are irrelevant.
>
> So here is an improved and hopefully more troubling statement of the
> question:
>
> Let's say that osc A is modulating the frequency of osc B, but that B
> reached its stop time (and A has no stop time). Would we keep B alive
> anyway, because retained node A is modulating it, in spite of the fact that
> B can only produce silence?
>
> Example:
>   var oscA = new OscillatorNode(...);
>   var oscB = new OscillatorNode(...);
>   oscA.connect(oscB.frequency);
>   oscB.connect(ctx.destination);
>   oscA.start();
>   oscB.start();
>   oscB.stop(ctx.currentTime + 1);
>   oscA = oscB = null;
>
>
> .            .       .    .  . ...Joe
>
> Joe Berkovitz
> President
> Noteflight LLC
>
> +1 978 314 6271
>
> 49R Day Street
> Somerville MA 02144
> USA
>
> "Bring music to life"
> www.noteflight.com
>
> On Fri, Sep 30, 2016 at 7:18 PM, Raymond Toy <rtoy@google.com> wrote:
>
>> I think it should.  If A and B are both oscillators and A is connected
>> to, say, B.frequency, I expect to hear the modulated B even if A and B have
>> no Javascript references to them.
>>
>> On Fri, Sep 30, 2016 at 1:22 PM, Joe Berkovitz <joe@noteflight.com>
>> wrote:
>>
>>> I sat down to work on https://github.com/WebAudio/we
>>> b-audio-api/issues/944 and discovered a question.
>>>
>>> So: we already know (I think) that when AudioNode A's output is
>>> connected to AudioNode B's input, then A has a "connection reference" to B.
>>> Thus, if A is retained, B is retained too.
>>>
>>> But what about the case where AudioNode A is connected to an AudioParam
>>> exposed by AudioNode B? Does A keep B alive in this case?
>>>
>>> .            .       .    .  . ...Joe
>>>
>>>
>>
>
Received on Monday, 3 October 2016 22:21:28 UTC

This archive was generated by hypermail 2.3.1 : Monday, 3 October 2016 22:21:29 UTC