Skip to content
This repository has been 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

Open
sole opened this issue Aug 1, 2016 · 0 comments

Comments

@sole
Copy link
Contributor

sole commented Aug 1, 2016

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant