Re: Behaviour of AudioParam.cancelScheduledValues

Hi Christoph and all,

thank you for the link. This indeed answers my first question, 
especially Joe Berkovitz' comment in issue 344. [1]
But I think the spec itself is still a bit vague about these 
discontinuities that Joe is talking about.

The sentence, that has been merged here [2], says: "Active 
setTargetAtTime automations (those with startTime less than the supplied 
time value) will also be cancelled."

Maybe I am missing something, but why not mention linearRampToValue, 
exponentialRampToValue and setValueCurveAtTime there?
Is anyone of the spec editors on this list? I wonder what they think 
about this.

I would propose something like: "Active setTargetAtTime, 
linearRampToValue, exponentialRampToValue and setValueCurveAtTime 
automations (those with startTime less than the supplied time value) 
will also be cancelled. This could cause discontinuities, because the 
original value (from before these automations) is restored immediately."

I am happy to create a PR if this is acceptable.

Best,
Sebastian

[1] 
https://github.com/WebAudio/web-audio-api/issues/344#issuecomment-151687206

[2] 
https://github.com/WebAudio/web-audio-api/pull/580/commits/9ded4034328d628aa6ebd28cbc07c9078907932c




Am 25.11.2016 um 15:27 schrieb Christoph Guttandin:
> Hi Sebastian,
>
> I’m not sure if that helps, but there was a very similar discussion on 
> GitHub a while ago: https://github.com/WebAudio/web-audio-api/pull/580.
>
> Greetings
> Christoph
>
>> Am 22.11.2016 um 13:25 schrieb Sebastian Zimmer <sebzim2@web.de 
>> <mailto:sebzim2@web.de>>:
>>
>> Hi fellow developers,
>>
>> I have two questions regarding AudioParam automation in the Web Audio 
>> spec:
>>
>> 1.
>>
>> To me, it is unclear what happens, when calling 
>> AudioParam.cancelScheduledValues while an automation curve is active.
>>
>> An example:
>>
>> gainNode.gain.value = 0.5;
>> gainNode.gain.linearRampToValueAtTime(0, context.currentTime + 3);
>> /* One second later, while the linear curve is active, we call */
>> gainNode.gain.cancelScheduledValues(context.currentTime);
>>
>> Of course, the linear ramp will be cancelled, because endTime of 
>> linearRampToValue is greater than the cancelTime in 
>> cancelScheduledValues.
>> I assume that the value should immediately jump back to the initial 
>> one, i.e. 0.5. Or am I wrong?
>>
>> 2.
>>
>> Currently, there is this sentence in the spec at 
>> AudioParam.cancelScheduledValues [1]:
>> "Active setTargetAtTime automations (those with cancelTime less than 
>> the supplied time value) will also be cancelled."
>>
>> Would this not also apply to active linearRampToValueAtTime, 
>> setValueCurveAtTime and exponentialRampToValue automations?
>>
>> Thank you,
>> Sebastian
>>
>> [1] 
>> https://webaudio.github.io/web-audio-api/#widl-AudioParam-cancelScheduledValues-AudioParam-double-cancelTime
>>
>>
>

Received on Saturday, 26 November 2016 16:38:54 UTC