Returns a function that iterates over an envelope

const e = Envelopes.adsr();

e(); // Yields current value

Starts the envelope the first time the return function is called. When the envelope finishes, it continues to return the releaseLevel of the envelope.

Options can be provided to set the shape of the envelope as usual, eg:

const e = Envelopes.adsr({
attackDuration: 1000,
releaseDuration: 500
});
  • Parameters

    Returns (() => number)

      • (): number
      • Returns number