Class: Waveform

Waveform()

new Waveform()

The Waveform class makes a draggable rectangle representing the waveform of an audio file, which can be moved around the interior of a larger rectangle instantiated by the Waveforms class.

Methods

get_wav_summary(buff) → {Array}

Gets and returns summary of amplitude values in the waveform, which can be stored in a graphics buffer to avoid unncessary recalculation when rendering the interface.

Parameters:
Name Type Description
buff Object

The audio buffer from which we can extract (typically) the RMS, providing a summary of amplitude values in the waveform.

Returns:

An array of pairs: the first element of each pair is the proprtion through the waveform; the second element is (typically) the RMS associated with the corresponding time window of the waveform.

Type
Array

Waveform(_sketch)

new Waveform(_sketch)

Constructor for making a new instance of the Waveform class.

Parameters:
Name Type Description
_sketch Object

The p5 sketch in which one or more instances of the Waveform class will exist.

Methods

get_wav_summary(buff) → {Array}

Gets and returns summary of amplitude values in the waveform, which can be stored in a graphics buffer to avoid unncessary recalculation when rendering the interface.

Parameters:
Name Type Description
buff Object

The audio buffer from which we can extract (typically) the RMS, providing a summary of amplitude values in the waveform.

Returns:

An array of pairs: the first element of each pair is the proprtion through the waveform; the second element is (typically) the RMS associated with the corresponding time window of the waveform.

Type
Array