Class EnvelopeGenerator

This private class is for Envelope Generator.

Implements

Implements

Constructors

Properties

activeCounter: number = 0
activeIndexes: number[] = []
attack: number = 0.01
context: AudioContext
decay: number = 0.3
generators: GainNode[] = []
isActive: boolean = true
release: number = 1.0
sustain: number = 0.5
MIN_GAIN: number = 1e-3

Methods

  • This method clears variables for managing instance of GainNode.

    Parameters

    • disconnected: boolean

      This argument is in order to determine whether disconnect AudioNode.

    Returns void

    This is returned for method chain.

  • This method gets instance of GainNode for Envelope Generator.

    Parameters

    • index: number

      This argument is index of array that contains instance of GainNode for Envelope Generator.

    Returns null | GainNode

    This is returned as instance of GainNode for Envelope Generator.

  • This method determines whether the all of gain schedulings have ended.

    Returns boolean

    If the all of gain schedulings have ended, this value is true. Otherwise, this value is false.

  • This method connects instance of AudioNode.

    Parameters

    • index: number

      This argument is in order to select instance of GainNode that is Envelope Generator.

    • input: null | AudioNode

      This argument is instance of AudioNode as input.

    • output: null | AudioNode

      This argument is instance of AudioNode as output.

    Returns void

  • This method sets instance of GainNode for Envelope Generator.

    Parameters

    • index: number

      This argument is index of array that contains instance of GainNode for Envelope Generator.

    Returns void

    This is returned for method chain.

  • This method changes gain (Attack or Decay or Sustain -> Release).

    Parameters

    • stopTime: number

      This argument is start time of Release.

    • Optional useCurve: boolean

      This argument is to use different methods. The default value is false.

    Returns void

Generated using TypeDoc