# pink.envelopes

Envelope Generator Functions

### adsr140

`(adsr140 gatefn retrigger attack decay sustain release)`

### env

`(env pts)`

Generates an envelope given pairs of values (t0, v0, t1, v1 ...) where tx is duration of segment.

### exp-env

`(exp-env pts)`

Generates an exponential envelope given pairs of values (t0, v0, t1, v1 ...) where tx is duration of segment.

### get-line-pt

`(get-line-pt sample linedata)`

### hold

`(hold value duration)`

Simple envelope that holds a given value for a given
duration. Will zero out after duration if duration ends
mid-buffer, then return nil afterwards to signal
completion.

### transeg

`(transeg [start & segments])`

Line segment generator using formula for each segment:
ibeg + (ivalue - ibeg) * (1 - exp( i*itype/(n-1) )) /
(1 - exp(itype))
for n steps. Points are given in format of:
ia, idur, itype, ib, idur2, itype2, ic...
where i_ is a value, dur is time in seconds, and itype affects the curve of the segment (0 = straight line, < 0 = conve, > 0 = concave))

### xar

`(xar a r)`

Exponential Attack-Release Envelope