Namespace: circuit

syngen.audio.circuit

Provides factories that create miscellaneous audio circuits with practical use cases.

Source:

Methods

(static) invert(optionsopt) → {GainNode}

Creates a GainNode that inverts a signal with scale.

Parameters:
Name Type Attributes Default Description
options Object <optional>
{}
Properties
Name Type Attributes Default Description
from AudioNode | AudioParam <optional>
scale Number <optional>
1
to AudioNode | AudioParam <optional>
Source:
Returns:
Type
GainNode

(static) lerp(optionsopt) → {Object}

Creates a circuit that interpolates an input signal linearly within [0, 1] to [min, max]. Beware that it leverages ConstantSourceNodes. Pass a chainStop or call the returned stop method to free resources when no longer in use.

Parameters:
Name Type Attributes Default Description
options Object <optional>
{}
Properties
Name Type Attributes Default Description
chainStop syngen.audio.synth~Synth <optional>
from AudioNode | AudioParam <optional>

Typically a ConstantSourceNode.

max Number <optional>
1
min Number <optional>
0
to AudioNode | AudioParam <optional>

Typically an AudioParam.

Source:
Returns:
Type
Object

(static) scale(optionsopt) → {Object}

Creates a circuit that scales an input signal linearly within [fromMin, fromMax] to [toMin, toMax]. Beware that it leverages ConstantSourceNodes. Pass a chainStop or call the returned stop method to free resources when no longer in use.

Parameters:
Name Type Attributes Default Description
options Object <optional>
{}
Properties
Name Type Attributes Default Description
chainStop syngen.audio.synth~Synth <optional>
from AudioNode | AudioParam <optional>

Typically a ConstantSourceNode.

fromMax Number <optional>
1
fromMin Number <optional>
0
to AudioNode | AudioParam <optional>

Typically an AudioParam.

toMax Number <optional>
1
toMin Number <optional>
0
Source:
Returns:
Type
Object