Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 15 additions & 27 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -10376,11 +10376,6 @@ Constructors</h4>
path: audionode-init.include
</pre>

Also, let <dfn attribute for="WaveShaperNode">[[curve set]]</dfn> be an internal
slot of this {{WaveShaperNode}}. Initialize this slot to <code>false</code>. If
{{WaveShaperNode/constructor(context, options)/options}} is given and specifies a
{{WaveShaperOptions/curve}}, set {{[[curve set]]}} to <code>true</code>.

<pre class=argumentdef for="WaveShaperNode/constructor()">
context: The {{BaseAudioContext}} this new {{WaveShaperNode}} will be <a href="#associated">associated</a> with.
options: Optional initial parameter value for this {{WaveShaperNode}}.
Expand Down Expand Up @@ -10449,30 +10444,23 @@ Attributes</h4>
</xmp>
</div>

<span class="synchronous">A {{InvalidStateError}} MUST be thrown if this
attribute is set with a {{Float32Array}} that has a
<code>length</code> less than 2.</span>

When this attribute is set, an internal copy of the curve is
created by the {{WaveShaperNode}}. Subsequent
modifications of the contents of the array used to set the
attribute therefore have no effect.
This attribute can be set more than once. Subsequent modifications of
the contents of an array used to set the attribute have no effect.

<div algorithm="WaveShaperNode.curve">
To set the {{WaveShaperNode/curve}} attribute, execute these steps:

1. Let <var>new curve</var> be a {{Float32Array}} to be assigned to {{WaveShaperNode/curve}} or <code>null</code>.
.

2. If <var>new curve</var> is not <code>null</code> and
{{WaveShaperNode/[[curve set]]}} is true, throw an
{{InvalidStateError}} and abort these steps.

3. If <var>new curve</var> is not <code>null</code>, set
{{WaveShaperNode/[[curve set]]}} to true.

4. Assign <var>new curve</var> to the {{WaveShaperNode/curve}}
attribute.
The {{WaveShaperNode/curve}} setter steps are:

1. If the given value is not <code>null</code> and its
<code>length</code> is less than 2, throw an {{InvalidStateError}}
and abort these steps.
2. If the given value is <code>null</code>, assign <code>null</code>
to the {{WaveShaperNode/curve}} attribute and abort these steps.
3. Otherwise:
1. Let <var>copy</var> be a new {{Float32Array}} with the same
<code>length</code> as the given value.
2. For each index in the given value, copy the element at
that index to the same index in <var>copy</var>.
3. Assign <var>copy</var> to the {{WaveShaperNode/curve}} attribute.
</div>

Note: The use of a curve that produces a non-zero
Expand Down
Loading