Module Audio.Mono.Effect.ADSR

module ADSR: sig .. end

ADSR (Attack/Decay/Sustain/Release) envelopes.


type t 

An ADSR enveloppe.

val make : int -> float * float * float * float -> t

Create an envelope with specified Attack/Decay/Sustain/Release times in seconds (excepting sustain which is an amplification coefficient between 0. and 1.). Negative sustain means that that notes should be released just after decay.

type state 

Current state in the ADSR envelope.

val init : unit -> state

Initial state for processing.

val release : state -> state
val dead : state -> bool
val process : t ->
state ->
Audio.Mono.buffer -> int -> int -> state