New issue
Advanced search Search tips

Issue 613590 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

setValueCurveAtTime followed by other automation discards setValueCurve

Project Member Reported by rtoy@chromium.org, May 20 2016

Issue description

OS: All

What steps will reproduce the problem?
(1) Running the following snippet at hoch.github.io/canopy:
var osc = context.createOscillator();
var gain = context.createGain();

osc.frequency.setValueAtTime(261.6, 0.0);
gain.gain.setValueAtTime(1,0);

gain.gain.setValueCurveAtTime(Float32Array.from([2,.5]), 0.25, .25)
.linearRampToValueAtTime(3, 1)
;

osc.connect(gain);
gain.connect(context.destination);

osc.start();


What is the expected output?
The output should have amplitude 1 until time 0.25.  Then it should change instantly to 2 and linearly ramp to an amplitude of 0.5 by time 0.5.  Then a new linear ramp should start from there and ramp to amplitude 3 by time 1.

What do you see instead?
That part from setValueCurveAtTime isn't there at all.  You get a linear ramp starting from 0 at time 0.25 going to 3 at time 1.



 

Comment 1 by rtoy@chromium.org, May 20 2016

Actually, the spec for linearRampToValueAtTime is fairly clear. T0 is the time of the previous element which is the start time of the setValueCurve.  It should be a linear ramp.

But I certainly expected the curve to happen and the linear ramp to start at the end of the setValueCurve.

Comment 2 by rtoy@chromium.org, May 27 2016

See https://github.com/WebAudio/web-audio-api/issues/821

Looks like the spec will change this so that the ramp will start from the end of the setValueCurve.

Comment 3 by rtoy@chromium.org, Jun 3 2016

Owner: rtoy@chromium.org
Status: Started (was: Available)
Project Member

Comment 4 by bugdroid1@chromium.org, Jun 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/de853bc3e87d40c16d82ddedc2688b95d50be435

commit de853bc3e87d40c16d82ddedc2688b95d50be435
Author: rtoy <rtoy@chromium.org>
Date: Tue Jun 14 21:45:27 2016

setValueCurveAtTime has implicit setValueAtTime at end

So that the value curve is always run even if there's a linearRamp or
exponentialRamp afterwards, call setValueAtTime to establish an event
at the end of the curve which will be used as the starting event for
any future event.  In this way, the value curve is always run.

This also exposed a bug in the implementation of SetValueCurveAtTime where
the current time would sometimes get reset to 0 instead of monotonically increasing.

WebAudio spec issue: https://github.com/WebAudio/web-audio-api/issues/821
Resolved by https://github.com/WebAudio/web-audio-api/pull/832

BUG= 613590 
TEST=audioparam-setValueCurve-end.html

Review-Url: https://codereview.chromium.org/2028773002
Cr-Commit-Position: refs/heads/master@{#399788}

[add] https://crrev.com/de853bc3e87d40c16d82ddedc2688b95d50be435/third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-end-expected.txt
[add] https://crrev.com/de853bc3e87d40c16d82ddedc2688b95d50be435/third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-end.html
[modify] https://crrev.com/de853bc3e87d40c16d82ddedc2688b95d50be435/third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-exceptions-expected.txt
[modify] https://crrev.com/de853bc3e87d40c16d82ddedc2688b95d50be435/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp

Project Member

Comment 5 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/de853bc3e87d40c16d82ddedc2688b95d50be435

commit de853bc3e87d40c16d82ddedc2688b95d50be435
Author: rtoy <rtoy@chromium.org>
Date: Tue Jun 14 21:45:27 2016

setValueCurveAtTime has implicit setValueAtTime at end

So that the value curve is always run even if there's a linearRamp or
exponentialRamp afterwards, call setValueAtTime to establish an event
at the end of the curve which will be used as the starting event for
any future event.  In this way, the value curve is always run.

This also exposed a bug in the implementation of SetValueCurveAtTime where
the current time would sometimes get reset to 0 instead of monotonically increasing.

WebAudio spec issue: https://github.com/WebAudio/web-audio-api/issues/821
Resolved by https://github.com/WebAudio/web-audio-api/pull/832

BUG= 613590 
TEST=audioparam-setValueCurve-end.html

Review-Url: https://codereview.chromium.org/2028773002
Cr-Commit-Position: refs/heads/master@{#399788}

[add] https://crrev.com/de853bc3e87d40c16d82ddedc2688b95d50be435/third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-end-expected.txt
[add] https://crrev.com/de853bc3e87d40c16d82ddedc2688b95d50be435/third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-end.html
[modify] https://crrev.com/de853bc3e87d40c16d82ddedc2688b95d50be435/third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-exceptions-expected.txt
[modify] https://crrev.com/de853bc3e87d40c16d82ddedc2688b95d50be435/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp

Comment 6 by rtoy@chromium.org, Jun 17 2016

Status: Fixed (was: Started)

Sign in to add a comment