Reference p5.Compressor

p5.Compressor

Compressor is an audio effect class that performs dynamics compression on an audio input source. This is a very commonly used technique in music and sound production. Compression creates an overall louder, richer, and fuller sound by lowering the volume of louds and raising that of softs. Compression can be used to avoid clipping (sound distortion due to peaks in volume) and is especially useful when many sounds are played at once. Compression can be used on indivudal sound sources in addition to the main output.

This class extends p5.Effect. Methods amp(), chain(), drywet(), connect(), and disconnect() are available.

Fields

compressor

The p5.Compressor is built with a Web Audio Dynamics Compressor Node

Methods

process

Performs the same function as .connect, but also accepts optional parameters to set compressor's audioParams

set

Set the paramters of a compressor.

attack

Get current attack or set value w/ time ramp

knee

Get current knee or set value w/ time ramp

ratio

Get current ratio or set value w/ time ramp

threshold

Get current threshold or set value w/ time ramp

release

Get current release or set value w/ time ramp

reduction

Return the current reduction value

Notice any errors or typos? Please let us know. Please feel free to edit lib/addons/p5.sound.js and open a pull request!

Related References