Namespace: shape

syngen.audio.shape

Provides a variety of curves and curve generators that can be used with WaveShaperNodes.

Source:

Methods

(static) constant(offsetopt) → {Float32Array}

Generates a curve that applies constant offset.

Parameters:
Name Type Attributes Default Description
offset Number <optional>
0
Source:
Returns:
Type
Float32Array

(static) createBitcrush(depthopt, samplesopt) → {Float32Array}

Generates a linear curve of arbitrary bit depth of samples length.

Parameters:
Name Type Attributes Default Description
depth Number <optional>
16
samples Number <optional>
2**16
Source:
Returns:
Type
Float32Array

(static) createNoise(gainopt, samplesopt) → {Float32Array}

Generates a linear curve with noise at gain of samples length.

Parameters:
Name Type Attributes Default Description
gain Number <optional>
1
samples Number <optional>
2**16
Source:
Returns:
Type
Float32Array

(static) createRandom(stepsopt, seedopt) → {Float32Array}

Generates a curve having random steps with seed.

Parameters:
Name Type Attributes Default Description
steps Number <optional>
3
seed String <optional>
Source:
Returns:
Type
Float32Array

(static) createSigmoid(amountopt, samplesopt) → {Float32Array}

Generates a sigmoid curve with amount in radians of samples length. Smaller values tend to be warmer, whereas larger values tend to be more distorted.

Parameters:
Name Type Attributes Default Description
amount Number <optional>
0
samples Number <optional>
2**16
Source:
Returns:
Type
Float32Array

(static) createTuple(timesopt) → {Float32Array}

Generates a curve that bounces a number of times before its zero crossing. This effectively adds times harmonics to a signal at decreasing amplitudes similar to a sawtooth wave.

Parameters:
Name Type Attributes Default Description
times <optional>
1
Source:
Returns:
Type
Float32Array

(static) createTuplePulse(timesopt) → {Float32Array}

Generates a rectified curve that bounces a number of times.

Parameters:
Name Type Attributes Default Description
times <optional>
1
Source:
Returns:
Type
Float32Array

(static) crush4() → {Float32Array}

Applies a 4-bit resolution.

Source:
Returns:
Type
Float32Array

(static) crush6() → {Float32Array}

Applies a 6-bit resolution.

Source:
Returns:
Type
Float32Array

(static) crush8() → {Float32Array}

Applies an 8-bit resolution.

Source:
Returns:
Type
Float32Array

(static) crush12() → {Float32Array}

Applies a 12-bit resolution.

Source:
Returns:
Type
Float32Array

(static) distort() → {Float32Array}

Applies a heavy overdrive.

Source:
Returns:
Type
Float32Array

(static) dither() → {Float32Array}

Applies dither, or -96 decibels of noise.

Source:
Returns:
Type
Float32Array

(static) double() → {Float32Array}

A double tuple. The result of syngen.audio.shape.createTuple(2)

Source:
Returns:
Type
Float32Array

(static) doublePulse() → {Float32Array}

A double pulse tuple. The result of syngen.audio.shape.createTuplePulse(2)

Source:
Returns:
Type
Float32Array

(static) equalFadeIn() → {Float32Array}

Returns an equal-power fade-in curve. This is useful

Source:
Returns:
Type
Float32Array

(static) equalFadeOut() → {Float32Array}

Returns an equal-power fade-out curve.

Source:
Returns:
Type
Float32Array

(static) hot() → {Float32Array}

Applies a moderate overdrive.

Source:
Returns:
Type
Float32Array

(static) invert() → {Float32Array}

Inverts a signal.

Source:
Returns:
Type
Float32Array

(static) invertShape() → {Float32Array}

Returns an inverted copy of shape.

Parameters:
Type Description
Source:
Returns:
Type
Float32Array

(static) linear() → {Float32Array}

Identity curve resulting in no shaping.

Source:
Returns:
Type
Float32Array

(static) noise() → {Float32Array}

Noise curve with 0 decibels of noise.

Source:
Returns:
Type
Float32Array

(static) noise2() → {Float32Array}

Applies -3 decibels of noise.

Source:
Returns:
Type
Float32Array

(static) noise4() → {Float32Array}

Applies -6 decibels of noise.

Source:
Returns:
Type
Float32Array

(static) noise8() → {Float32Array}

Applies -9 decibels of noise.

Source:
Returns:
Type
Float32Array

(static) noise16() → {Float32Array}

Applies -12 decibels of noise.

Source:
Returns:
Type
Float32Array

(static) noise32() → {Float32Array}

Applies -15 decibels of noise.

Source:
Returns:
Type
Float32Array

(static) offsetShape(shape, offsetopt) → {Float32Array}

Applies a constant offset to a copy of shape.

Parameters:
Name Type Attributes Default Description
shape Float32Array
offset Number <optional>
0
Source:
Returns:
Type
Float32Array

(static) one() → {Float32Array}

Always one.

Source:
Returns:
Type
Float32Array

(static) pulse() → {Float32Array}

Omits troughs so only positive values are audible.

Source:
Returns:
Type
Float32Array

(static) pulseShape(shape) → {Float32Array}

Returns a copy of shape with troughs set to zero.

Parameters:
Name Type Description
shape Float32Array
Source:
Returns:
Type
Float32Array

(static) rectify() → {Float32Array}

Rectifies a signal so it's always positive.

Source:
Returns:
Type
Float32Array

(static) rectifyShape(shape) → {Float32Array}

Returns a rectified copy of shape.

Parameters:
Name Type Description
shape Float32Array
Source:
Returns:
Type
Float32Array

(static) reverseShape(shape) → {Float32Array}

Returns a reversed copy of shape.

Parameters:
Name Type Description
shape Float32Array
Source:
Returns:
Type
Float32Array

(static) square() → {Float32Array}

Applies a hard threshold where values round to -1 or 1.

Source:
Returns:
Type
Float32Array

(static) triple() → {Float32Array}

A triple tuple. The result of syngen.audio.shape.createTuple(3)

Source:
Returns:
Type
Float32Array

(static) triplePulse() → {Float32Array}

A triple pulse tuple. The result of syngen.audio.shape.createTuplePulse(3)

Source:
Returns:
Type
Float32Array

(static) warm() → {Float32Array}

Applies a slight overdrive

Source:
Returns:
Type
Float32Array

(static) zero() → {Float32Array}

Always zero.

Source:
Returns:
Type
Float32Array