Skip to content
This repository was archived by the owner on Jan 9, 2019. It is now read-only.
This repository was archived by the owner on Jan 9, 2019. It is now read-only.

In the DynamicsCompressor example, add a way to modify the other compressor parameters #1

@sole

Description

@sole

Compressor nodes have a number of attributes we're not accessing: https://webaudio.github.io/web-audio-api/#the-dynamicscompressornode-interface

  • threshold
  • knee
  • ratio
  • attack
  • release

These are AudioParams so they can be automated etc (see the reference for the allowed value ranges per attribute).

It would be great to have sliders (<input type="range">) that let us change these values to see how the compression node reacts and how it sounds differently.

For these purposes we could change them immediately without using AudioParam automations, e.g. add a listener to the change event on the threshold slider and then do something like

var value = thresholdSlider.value;
var now = audioContext.currentTime;
compressor.threshold.setValueAtTime(value, now);

The DynamicsCompressor example is at: https://github.com/mozdevs/WebAudio-examples/tree/gh-pages/DynamicsCompressor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions