-
Notifications
You must be signed in to change notification settings - Fork 174
WaveShaperNode: allow updating the curve #2655
Copy link
Copy link
Open
Labels
Needs DiscussionThe issue needs more discussion before it can be fixed.The issue needs more discussion before it can be fixed.category: new featureSubstantive changes that add new functionality. https://www.w3.org/policies/process/#class-4Substantive changes that add new functionality. https://www.w3.org/policies/process/#class-4
Metadata
Metadata
Assignees
Labels
Needs DiscussionThe issue needs more discussion before it can be fixed.The issue needs more discussion before it can be fixed.category: new featureSubstantive changes that add new functionality. https://www.w3.org/policies/process/#class-4Substantive changes that add new functionality. https://www.w3.org/policies/process/#class-4
Describe the feature
If I read the specification right, setting the curve on the WaveShaperNode multiple times is not allowed
https://webaudio.github.io/web-audio-api/#dom-waveshapernode-curve
Currently however, all browsers seem to allow this. Check for an example here: https://jsbin.com/vagevo/edit?js,output
Some usage in the wild depending on this behaviour
The web platform tests do not guard for this behaviour. Only a test for setting it back to null is present: https://github.com/web-platform-tests/wpt/blob/90f328adfdbd9ea14a8fc57f042525451980e862/webaudio/the-audio-api/the-waveshapernode-interface/waveshaper-simple.html#L50
To me it seems it would be useful and consistent if the curve could be changed. If we allow users to set it back to null, why not allow it to be set to any other curve? Similar to allowing multiple calls to OscillatorNode.setPeriodicWave
Is there a prototype?
All browsers appear to support this feature (tested on desktop Firefox, Chrome, Safari)
Describe the feature in more detail
Allow updating the curve in the next render quantum after the user has set the new value. This may produce artifacts if the curve is very different from the previous version.