ixfx
    Preparing search index...

    Base class for an ADSR envelope.

    It outputs values on a scale of 0..1 corresponding to each phase.

    Hierarchy (View Summary)

    Index

    Accessors

    Constructors

    Methods

    • Computes a stage's progress from 0-1

      Parameters

      • allowStateChange: boolean = true
      • allowLooping: boolean = true

      Returns [stage: string, amount: number, prevStage: string]

    • Changes state based on timer status

      Parameters

      • allowLooping: boolean

      Returns boolean

      True if state was changed

    • Triggers envelope, optionally holding it.

      If hold is false (default), envelope will run through all stages, but sustain stage won't have an affect.

      If hold is true, it will run to, and stay at the sustain stage. Use release to later release the envelope.

      If event is already trigged it will be retriggered. Initial value depends on opts.retrigger

      • false (default): envelope continues at current value.
      • true: envelope value resets to opts.initialValue.

      Parameters

      • hold: boolean = false

        If true envelope will hold at sustain stage

      Returns void

    Properties

    attackDuration: number
    decayDuration: number
    decayDurationTotal: number
    releaseDuration: number
    shouldLoop: boolean

    If true envelope will loop