From 12a3fea472cb7c793f44fdb1d403b02f7a95630d Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Fri, 15 Aug 2025 15:55:46 -0700 Subject: [PATCH 1/2] Specify DynamicsCompressorNode makeup gain control --- index.bs | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 061124980..b15bb526e 100644 --- a/index.bs +++ b/index.bs @@ -7688,6 +7688,27 @@ macros: tail-time-notes: This node has a tail-time such that this node continues to output non-silent audio with zero input due to the look-ahead delay. +
+enum MakeupGainOptions {
+    "automatic"
+};
+
+ +
+ + + + + + + +
{{MakeupGainOptions}} Enumeration description
Enum ValueDescription
+ "automatic" + + Set the makeup gain as described in [=Computing the makeup gain=]. +
+
+
 [Exposed=Window]
 interface DynamicsCompressorNode : AudioNode {
@@ -7699,6 +7720,7 @@ interface DynamicsCompressorNode : AudioNode {
     readonly attribute float reduction;
     readonly attribute AudioParam attack;
     readonly attribute AudioParam release;
+    readonly attribute AudioParam makeupGain;
 };
 
@@ -7717,6 +7739,12 @@ Constructors be a private slot on this, that holds a floating point number, in decibels. Set {{[[internal reduction]]}} to 0.0. + Let [[automatic + makeup gain]] be a private slot on this, that + holds a boolean. Set {{[[automatic makeup gain]]}} to `true` + if the makeupGain option is {{MakeupGainOptions/automatic}} or + unspeficied, otherwise set it to `false`. +
             context: The {{BaseAudioContext}} this new {{DynamicsCompressorNode}} will be associated with.
             options: Optional initial parameter value for this {{DynamicsCompressorNode}}.
@@ -7805,6 +7833,25 @@ Attributes
             rate: "{{AutomationRate/k-rate}}"
             rate-notes: Has [=automation rate constraints=]
         
+ + : makeupGain + :: + The decibel value of the makeup gain applied to the signal. If + this attribute is written to or any automation events are + scheduled on it, set {{[[automatic makeup gain]]}} to `false`. + +
+        path: audioparam.include
+        macros:
+            default: 0
+            default-notes: Will be reset during object creation
+            min: most-negative-single-float
+            min-notes: Approximately -3.4028235e38
+            max: \(\approx 1541\)
+            max-notes: This value is approximately \(40\ \log_{10} \mathrm{FLT\_MAX}\) where FLT_MAX is the largest {{float}} value.
+            rate: "{{AutomationRate/k-rate}}"
+            rate-notes: Has [=automation rate constraints=]
+        

@@ -7822,6 +7869,7 @@ dictionary DynamicsCompressorOptions : AudioNodeOptions { float ratio = 12; float release = 0.25; float threshold = -24; + (float or MakeupGainOptions) makeupGain = "automatic"; }; @@ -7843,6 +7891,12 @@ Dictionary {{DynamicsCompressorOptions}} Members

: threshold :: The initial value for the {{DynamicsCompressorNode/threshold}} AudioParam. + + : makeupGain + :: The initial value for the {{DynamicsCompressorNode/makeupGain}} + AudioParam. If set to {{MakeupGainOptions/automatic}}, the + makeup gain will be calculated as described in [=Computing the + makeup gain=].

@@ -7984,9 +8038,12 @@ values. Those values persist accros invocation of this algorithm. increment by envelope rate, and add the result to compressor gain. - 9. Compute reduction gain to be compressor - gain multiplied by the return value of computing the - makeup gain. + 9. If {{[[automatic makeup gain]]}} is true, set + {{DynamicsCompressorNode/makeupGain}} to the return value + of computing the makeup gain + + 10. Compute reduction gain to be compressor + gain multiplied by {{DynamicsCompressorNode/makeupGain}}. 10. Compute metering gain to be reduction gain, converted to decibel. From 405773842d5c037cbd9bd02cc091a5a13ab6b47d Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Fri, 15 Aug 2025 16:02:53 -0700 Subject: [PATCH 2/2] Fix indentation --- index.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index b15bb526e..583132d0c 100644 --- a/index.bs +++ b/index.bs @@ -7894,9 +7894,9 @@ Dictionary {{DynamicsCompressorOptions}} Members

: makeupGain :: The initial value for the {{DynamicsCompressorNode/makeupGain}} - AudioParam. If set to {{MakeupGainOptions/automatic}}, the - makeup gain will be calculated as described in [=Computing the - makeup gain=]. + AudioParam. If set to {{MakeupGainOptions/automatic}}, the + makeup gain will be calculated as described in [=Computing the + makeup gain=].