diff --git a/index.html b/index.html index 5b1bce414..801179f89 100644 --- a/index.html +++ b/index.html @@ -2918,9 +2918,11 @@
-This interface represents a processing node which positions an incoming audio -stream in a stereo image using a low-cost equal-power panning algorithm. This -panning effect is common in positioning audio components in a stereo stream.
+ This interface represents a processing node which positions an incoming audio + stream in a stereo image using a low-cost equal-power panning algorithm. This panning effect + is common in positioning audio components in a stereo stream. +
numberOfInputs : 1
@@ -2932,17 +2934,25 @@ The StereoPannerNode Interface
- The input of this node is stereo (2 channels) and cannot be increased. Connections from nodes with fewer or more channels will be up-mixed or down-mixed appropriately, but a NotSupportedError will be thrown if an attempt is made to set channelCount to a value great than 2 or if channelCountMode is set to "max".
+ The input of this node is stereo (2 channels) and cannot be increased.
+ Connections from nodes with fewer or more channels will be up-mixed or down-mixed
+appropriately, but a NotSupportedError will be thrown if an attempt is made
+to set channelCount to a value great than 2 or if channelCountMode is set to
+"max".
-The output of this node is hard-coded to stereo (2 channels) and cannot be configured. + The output of this node is hard-coded to stereo (2 channels) and cannot be + configured.
The following algorithm must be used to calculate the azimuth
- and elevation:
+ and elevation: for the PannerNode
@@ -6335,87 +6347,129 @@Panning Algorithm
The following algorithms must be implemented:
This is a simple and relatively inexpensive algorithm which provides - basic, but reasonable results. It is commonly used when panning musical sources. -
- The elevation value is ignored in this panning algorithm. -
- The following steps are used for processing:
+ This is a simple and relatively inexpensive algorithm which provides
+ basic, but reasonable results. It is used for the
+ StereoPannerNode, and for the
+ PannerNode when the panningModel
+ attribute is set to "equalpower", in which case the the
+ elevation value is ignored.
- The azimuth value is first contained to be within the range -90 <= azimuth <= +90 according to: -
-- // Clamp azimuth to allowed range of -180 -> +180. - azimuth = max(-180, azimuth); - azimuth = min(180, azimuth); - - // Now wrap to range -90 -> +90. - if (azimuth < -90) - azimuth = -180 - azimuth; - else if (azimuth > 90) - azimuth = 180 - azimuth; --
PannerNode, the following algorithm MUST be
+ implemented.
+ azimuth be the value computed in the azimuth and
+ elevation section.
+ + The azimuth value is first contained to be within the range -90 <= azimuth <= +90 according to: +
+
+ // Clamp azimuth to allowed range of -180 -> +180.
+ azimuth = max(-180, azimuth);
+ azimuth = min(180, azimuth);
+
+ // Now wrap to range -90 -> +90.
+ if (azimuth < -90) {
+ azimuth = -180 - azimuth;
+ } else if (azimuth > 90) {
+ azimuth = 180 - azimuth;
+ }
+
+ - A 0 -> 1 normalized value x is calculated from azimuth for mono->stereo as: -
-- x = (azimuth + 90) / 180 -+
+ A 0 -> 1 normalized value x is calculated from azimuth for mono->stereo as: +
++ x = (azimuth + 90) / 180 ++ +
+ Or for stereo->stereo as: +
+
+ if (azimuth <= 0) { // from -90 -> 0
+ // inputL -> outputL and "equal-power pan" inputR as in mono case
+ // by transforming the "azimuth" value from -90 -> 0 degrees into the range -90 -> +90.
+ x = (azimuth + 90) / 90;
+ } else { // from 0 -> +90
+ // inputR -> outputR and "equal-power pan" inputL as in mono case
+ // by transforming the "azimuth" value from 0 -> +90 degrees into the range -90 -> +90.
+ x = azimuth / 90;
+ }
+
+
- Or for stereo->stereo as:
+ For a StereoPannerNode, the following algorithm MUST
+ be implemented.
+
azimuth be the computedValue of the
+ pan AudioParam of this
+ StereoPannerNode.
+ azimuth value to [0; 1]. From mono to
+ stereo:
+ + x = (azimuth + 1) / 2; ++ Or when panning stereo to stereo: +
+ if (azymuth <= 0) {
+ x = azimuth + 1;
+ } else {
+ x = azimuth;
+ }
+
+
- if (azimuth <= 0) { // from -90 -> 0
- // inputL -> outputL and "equal-power pan" inputR as in mono case
- // by transforming the "azimuth" value from -90 -> 0 degrees into the range -90 -> +90.
- x = (azimuth + 90) / 90;
- } else { // from 0 -> +90
- // inputR -> outputR and "equal-power pan" inputL as in mono case
- // by transforming the "azimuth" value from 0 -> +90 degrees into the range -90 -> +90.
- x = azimuth / 90;
- }
-
- - Left and right gain values are then calculated: -
-- gainL = cos(0.5 * PI * x); - gainR = sin(0.5 * PI * x); --
For mono->stereo, the output is calculated as:
-- outputL = input * gainL - outputR = input * gainR --
Else for stereo->stereo, the output is calculated as:
-
- if (azimuth <= 0) { // from -90 -> 0
- outputL = inputL + inputR * gainL;
- outputR = inputR * gainR;
- } else { // from 0 -> +90
- outputL = inputL * gainL;
- outputR = inputR + inputL * gainR;
- }
-
- + Left and right gain values are calculated: +
++ gainL = cos(0.5 * Math.PI * x); + gainR = sin(0.5 * Math.PI * x); ++
+ For mono->stereo, the output is calculated as: +
++ outputL = input * gainL; + outputR = input * gainR; ++
+ Else for stereo->stereo, the output is calculated as: +
+
+ if (azimuth <= 0) {
+ outputL = inputL + inputR * gainL;
+ outputR = inputR * gainR;
+ } else {
+ outputL = inputL * gainL;
+ outputR = inputR + inputL * gainR;
+ }
+
+