-- | Envelopes
module Csound.Catalog.Envelope(
    percussive, revPercussive        
) where

import Csound.Base

-- | An exponential envelope for the percussive sound. It takes in a time of the decay section.
percussive :: D -> Sig
percussive :: D -> Sig
percussive D
dec = [D] -> D -> D -> Sig
expsegr [D
0.001, D
0.01, D
1, D
dec, D
0.001] D
0.001 (D
dec D -> D -> D
forall a. Fractional a => a -> a -> a
/ D
2)

-- | A reversed exponential envelope for the percussive sound. It takes a time of the decay section
-- of the original envelope.
revPercussive :: D -> Sig
revPercussive :: D -> Sig
revPercussive D
dec = [D] -> D -> D -> Sig
expsegr [D
0.001, D
dec, D
1, D
0.01, D
0.001] D
0.001 D
0.01