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
Units & examples used in DynamicsCompressorNode are ambiguous #2393
Comments
Thanks for looking in to this; it's much appreciated. About your questions, I think yes if you have the time and desire. Clarity in the units is important as well as in the example functions if they are basically wrong. |
I filed this issue as a first step since I am new to the spec and because I'm worried that I will miss certain times where the units are misused. I'm happy to take a first pass at this, though! |
Teleconf: We wish to limit the scope of new issues on V1 to critical ones. Propose to move this issue to V2. |
Moving to v2. |
AudioWG virtual F2F:
|
@padenot Thanks for the update! Are you asking if I'd like to give it a shot? I'm happy to do so, but it will take a bit. |
We encourage group participation, so if you can, we'd appreciate a pull request with the fixes you have in mind. If can't, we'll eventually get around to fixing these. |
In #2273, I proposed a fix to ambiguous unit usage (linear units vs decibel units) in the specification for the DynamicsCompressorNode. That change fixes a specific ambiguity in the units used for calculating the knee thresholds for the compression curve function.
However, upon working further with the API, it seems that:
For that reason, I decided to file this bug (per @rtoy's advice).
Ambiguous units
The units in Step 5 of the compression curve are unclear:
Since implementers have both linear and exponential units to choose from, the compression curve may behave exponentially differently depending on unit choice. For example, choosing to apply the curve to the decibel value would be off by ~
10^(1/ratio)
versus using linear values.We should be clearer here that the ratio applies to the decibel values:
See also Chromium's code(dynamics_compressor_kernel.cc):
float y_db = yknee_threshold_db_ + slope_ * (x_db - knee_threshold_db_);
Non-continuous compression curve
The spec is unambiguous at several points that the compression curve must be
continuous and piece-wise differentiable
, but the example functions provided, while linear, are not continuous with the other parts of the function and may provide a false impression to implementers (I made this mistake 😄):Chromium implements this as (dynamics_compressor_kernel.cc):
While the example function in the spec may simply be to illustrate linear functions, I believe it is confusing and it should be replaced with a more applicable function. Perhaps the above or:
(Or we should remind readers that the example function is just an example of a linear function).
This also affects the Processing overview:
Ask
Thanks!
The text was updated successfully, but these errors were encountered: