Reference p5.Effect

p5.Effect

Effect is a base class for audio effects in p5.
This module handles the nodes and methods that are common and useful for current and future effects.

This class is extended by p5.Distortion, p5.Compressor, p5.Delay, p5.Filter, p5.Reverb.

Syntax

p5.Effect([ac], [input], [output], [_drywet], [wet])

Parameters

ac
Object:

Reference to the audio context of the p5 object

input
AudioNode:

Gain Node effect wrapper

output
AudioNode:

Gain Node effect wrapper

_drywet
Object:

Tone.JS CrossFade node (defaults to value: 1)

wet
AudioNode:

Effects that extend this class should connect to the wet signal to this gain node, so that dry and wet signals are mixed properly.

Methods

amp

Set the output volume of the filter.

chain

Link effects together in a chain Example usage: filter.chain(reverb, delay, panner); May be used with an open-ended number of arguments

drywet

Adjust the dry/wet value.

connect

Send output to a p5.js-sound, Web Audio Node, or use signal to control an AudioParam

disconnect

Disconnect all output.

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