Bug 78937 - Implement static compression curve parameters for DynamicsCompressorNode
Summary: Implement static compression curve parameters for DynamicsCompressorNode
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Rogers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-17 14:45 PST by Chris Rogers
Modified: 2012-02-27 14:15 PST (History)
4 users (show)

See Also:


Attachments
Patch (20.26 KB, patch)
2012-02-17 15:15 PST, Chris Rogers
no flags Details | Formatted Diff | Diff
Patch (19.95 KB, patch)
2012-02-24 17:12 PST, Chris Rogers
kbr: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Rogers 2012-02-17 14:45:45 PST
Implement static compression curve parameters for DynamicsCompressorNode
Comment 1 Chris Rogers 2012-02-17 15:15:36 PST
Created attachment 127665 [details]
Patch
Comment 2 Chris Rogers 2012-02-17 15:21:53 PST
Dynamic range compression has parametric control of the static compression curve:
threshold: the dB value above which the compression will start taking effect
knee: historically this has often been simply "hard" or "soft" knee, but this is a value (in dB) representing the range above the threshold where the curve smoothly transitions to the "ratio" portion
ratio: this value represents the amount of dB change in input for a 1 dB change in output

The "reduction" parameter is a read-only value for metering purposes, representing the current amount of gain reduction that the compressor is applying to the signal
Comment 3 Chris Rogers 2012-02-17 15:54:13 PST
Here's an interactive graphing app to show the parametric curve:
http://chromium.googlecode.com/svn/trunk/samples/audio/compression-curve2.html
Comment 4 Chris Rogers 2012-02-24 17:12:49 PST
Created attachment 128832 [details]
Patch
Comment 5 Kenneth Russell 2012-02-24 18:32:21 PST
Comment on attachment 128832 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=128832&action=review

This looks fine per your walking through the algorithm with me offline. A couple of minor nits. r=me

> Source/WebCore/platform/audio/DynamicsCompressor.cpp:58
> +    if (parameterID < ParamLast)

Is this worth an ASSERT?

> Source/WebCore/platform/audio/DynamicsCompressorKernel.cpp:174
> +        k = sqrt(minK * maxK);

sqrtf?

> Source/WebCore/webaudio/DynamicsCompressorNode.idl:33
> +        readonly attribute AudioParam reduction; // in Decibels

I assume these changes are being specified?
Comment 6 Chris Rogers 2012-02-27 14:15:22 PST
Committed r109023: <http://trac.webkit.org/changeset/109023>