-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note that setting AudioParam.value will be ignored when any automation events have been set on the object #128
Comments
|
Hmm, I seem to recall a different resolution here. http://lists.w3.org/Archives/Public/public-audio/2012JulSep/0632.html Was there another discussion resulting in a different resolution, or am I mixing things up? |
Thanks Olivier, you're right... |
Hmm, the semantics of AudioParam.value are really really broken... :( |
Which way should it work, and which way does it work at present in UAs? |
In Chrome, setting AudioParam value with the |
Is that true for when a setValueAtTime is scheduled in far future, or only On Wed, Oct 22, 2014 at 10:44 AM, Hongchan Choi [email protected]
|
@cwilso Well, you got it right.
However, the behavior of This observation is purely from my JS testing code and I need to look into the actual implementation in Chrome to see how it is really done internally. (Again, not sure about how other browsers work.) Just to simplify the mechanism, can we cancel the automation when the setter sets the value? |
I think we need to roll this into the decision once and for all about de-zippering, and really describe how this works. |
Agreed — automation and de-zippering and setter interaction are all part of one issue that has been dangling for a long time. |
Issue #108 is also part of this nest of questions. |
Issue #172 is related and says setting AudioParam.value effectively cancels the automation and sets the value. |
The other related issue here (maybe this should be a separate issue) is the getter for |
I still don't understand why param.value = x isn't equivalent to param.setValueAtTime(x, context.currentTime). The difference causes a lot of confusion. I suspect the reason is "it's too late, changing it now would break code". But it sounds like the semantics aren't really that well defined, so maybe it's not too late. |
The reason is that |
Oh yeah, I wasn't thinking about dezippering. But that seems like a separate issue from how the value setter interacts with automation methods. You could instead say that |
@adelespinasse Yup, I think that this is buried in the details of #76 and dezippering is essentially, as you say, an alias to calling a pair of primitive ramp automation methods. So the interaction between dezippering and automation is really just the interaction between, um, automation and automation. |
@adelespinasse To be precise, there are some differences in using the setter and a chain of automation methods. The setter does not rely on Raymond and I talked about the possibility of replacing the setter with Back to the original question:
In my opinion, the setter is designed to be abused when the strongly-timed transition is not needed. It is relatively cheap and easy to use. The unfortunate thing to know is once you use the automation method, there is no going back. (the setter won't work) It might matter when the client has low memory or processing power. |
On Thu, Apr 9, 2015 at 1:35 PM, Hongchan Choi [email protected]
I think this is an implementation detail of Chrome. Currently, Chrome I think Hongchan and I agreed that this has a certain appeal to make
Ray |
It sounds like my earlier comment about dezippering mapping to internal automation calls may have been inaccurate. But if there is a way to make such a mapping official, it would be simpler and more economical. I think that the question of what internal state the getter returns can be layered on top of this mapping. |
Another idea to throw into this discussion: The setter could be defined to specifically cancel all automation when it's called. So using the setter basically says "I want to set the the value to X (with dezippering?), and that over-rules everything else I said earlier". That way just as it's easy to switch into the automation mode (by calling any of the automation methods) it would be easy to switch out of automation. |
Why not just use cancelScheduledValues()? At least on chrome, that seems On Thu, Apr 9, 2015 at 5:28 PM, Chinmay Pendharkar <[email protected]
Ray |
My mistake. cancelScheduledValues() doesn't allow the getter/setter to On Thu, Apr 9, 2015 at 5:41 PM, Raymond Toy [email protected] wrote:
Ray |
Yup. It's some sort of "last stable" value. |
@notthetup Yes, that was the one of ideas. I think this is reasonable thing and a useful escape hatch.
However, what if the setter was triggered at x second and the scheduler has some value scheduled later than x? Also we have to consider that the timing x second will not be sample-accurate. So basically it is about deleting sample-accurate scheduled values with a non-sample-accurate manner. I like this idea but its flakiness slightly bothers me. |
Yup. Makes sense. This is something that will be hard to pin down when going from the sample-accurate (automation) 'mode' into the non-sample-accurate (non-automation) 'mode'. Both with setters and getters. |
Can't help but think this would be simpler if someone could propose a way to determine -- with sample accuracy -- the exact block-boundary time at which a setter-caused value change would take place. I also think it makes sense to consider allowing cancelScheduledValues() to restore the getter/setter action. |
Isn't currentTime an accurate determination of that? It represents the beginning of the next sample block. |
Audio-time marches on :) Perhaps mid-way through a JS calculation. Waiting for a render doesn't offer much help either:
(I'm not suggesting that anyone actually uses this) In the spec, currentTime doesn't seem very well defined. |
See #381... agreement on the definition not so simple apparently. |
Resolution: state that setting the .value attribute is equivalent to 1) calling |
Fix #128: clarify effect of setting the value attribute with respect …
We should note that if the author sets the value property on an AudioParam which has any automation events scheduled, the new value will be silently ignored without any exception being raised.
The text was updated successfully, but these errors were encountered: