Reference p5.Pulse

p5.Pulse

Creates a Pulse object, an oscillator that implements Pulse Width Modulation. The pulse is created with two oscillators. Accepts a parameter for frequency, and to set the width between the pulses. See p5.Oscillator for a full list of methods.

Examples

Syntax

p5.Pulse([freq], [w])

Parameters

freq
Number:

Frequency in oscillations per second (Hz)

w
Number:

Width between the pulses (0 to 1.0, defaults to 0)

Methods

width

Set the width of a Pulse object (an oscillator that implements Pulse Width Modulation).

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