soundbank-dipper
A global side-chain compressor for the Web Audio API. Modulate the amplitude of AudioNodes based on the amplitude of other AudioNodes.
A dipper is global to the current audioContext. If you need separate dipper contexts, use var newContext = Object.create(audioContext)
.
Intended for use as a processor in soundbank, but it is compatible with any Web Audio API AudioNode set up.
Install
$ npm install soundbank-dipper
API
var Dipper =
Dipper(audioContext)
Create an AudioNode instance. In "source"
mode, audio flows straight through, but is used to modulate the amplitude of all dipper nodes in "modulate"
mode.
node.mode (get/set)
Either 'source'
, or 'modulate'
.
AudioParam)
node.ratio (Amount of dip effect to apply. Defaults to 1
.
Example
Side-chain background
oscillator against source
:
var Dipper = var audioContext = var sourceDipper = sourceDippermode = 'source' var sidechainDipper = sidechainDippermode = 'modulator' sourceDippersidechainDipper var background = audioContextbackgroundtype = 'sawtooth'backgroundbackgroundstart