Sound.SC3.UGen.Envelope.Construct

Description

Functions to generate break point data for standard envelope types.

Synopsis

# Documentation

envCoord :: Num a => [(a, a)] -> a -> a -> Envelope_Curve a -> Envelope a Source

Co-ordinate based static envelope generator.

```let e = envCoord [(0,0),(1/4,1),(1,0)] 1 1 EnvLin
in envelope_sc3_array e == Just [0,2,-99,-99,1,1/4,1,0,0,3/4,1,0]```

envTrapezoid :: (Num a, OrdE a) => a -> a -> a -> a -> Envelope a Source

Trapezoidal envelope generator. The arguments are: 1. `shape` determines the sustain time as a proportion of `dur`, zero is a triangular envelope, one a rectangular envelope; 2. `skew` determines the attack/decay ratio, zero is an immediate attack and a slow decay, one a slow attack and an immediate decay; 3. `duration` in seconds; 4. `amplitude` as linear gain.

envPerc' :: Num a => a -> a -> a -> Envelope_Curve2 a -> Envelope a Source

Variant `envPerc` with user specified 'Envelope_Curve a'.

envPerc :: Num a => a -> a -> Envelope a Source

Percussive envelope, with attack, release, level and curve inputs.

envTriangle :: (Num a, Fractional a) => a -> a -> Envelope a Source

Triangular envelope, with duration and level inputs.

```let e = envTriangle 1 0.1
in envelope_sc3_array e = Just [0,2,-99,-99,0.1,0.5,1,0,0,0.5,1,0]```

envSine :: (Num a, Fractional a) => a -> a -> Envelope a Source

Sine envelope, with duration and level inputs.

```let e = envSine 0 0.1
in envelope_sc3_array e == Just [0,2,-99,-99,0.1,0,3.0,0,0,0,3,0]```

data LINEN a Source

Parameters for LINEN envelopes.

Constructors

 LINEN Fieldslinen_attackTime :: a linen_sustainTime :: a linen_releaseTime :: a linen_level :: a linen_curve :: Envelope_Curve3 a

envLinen_r :: Num a => LINEN a -> Envelope a Source

Record (`LINEN`) variant of `envLinen`.

envLinen' :: Num a => a -> a -> a -> a -> Envelope_Curve3 a -> Envelope a Source

Variant of `envLinen` with user specified 'Envelope_Curve a'.

envLinen :: Num a => a -> a -> a -> a -> Envelope a Source

Linear envelope parameter constructor.

```let {e = envLinen 0 1 0 1
;s = envelope_segments e
;p = pack_envelope_segments s}
in p == (env_levels e,env_times e,env_curves e)```

Parameters for ADSR envelopes. The sustain level is given as a proportion of the peak level.

Constructors

envADSR :: Num a => a -> a -> a -> a -> a -> Envelope_Curve a -> a -> Envelope a Source

Attack, decay, sustain, release envelope parameter constructor.

Record (`ADSR`) variant of `envADSR`.

Parameters for Roland type ADSSR envelopes.

Constructors

envADSSR :: Num a => a -> a -> a -> a -> a -> a -> a -> Envelope_Curve a -> a -> Envelope a Source

Attack, decay, slope, sustain, release envelope parameter constructor.

Record (`ADSSR`) variant of `envADSSR`.

data ASR a Source

Parameters for ASR envelopes.

Constructors

 ASR Fieldsasr_attackTime :: a asr_sustainLevel :: a asr_releaseTime :: a asr_curve :: Envelope_Curve2 a

envASR :: Num a => a -> a -> a -> Envelope_Curve a -> Envelope a Source

Attack, sustain, release envelope parameter constructor.

```let {c = 3
;r = Just [0,2,1,-99,0.1,3,c,0,0,2,c,0]}
in envelope_sc3_array (envASR 3 0.1 2 EnvSin) == r```

envASR_r :: Num a => ASR a -> Envelope a Source

Record (`ASR`) variant of `envASR`.

envStep :: [a] -> [a] -> Maybe Int -> Maybe Int -> Envelope a Source

All segments are horizontal lines.

Variant with default values for all inputs. `gate` and `fadeTime` are `control`s, `doneAction` is `RemoveSynth`, `curve` is `EnvSin`.