hsc3-0.15.1: Haskell SuperCollider

Safe HaskellSafe-Inferred




Envelope generators.



data Envelope a Source

SC3 envelope segment model




env_levels :: [a]

Set of n levels, n is >= 1

env_times :: [a]

Set of n-1 time intervals

env_curves :: [Envelope_Curve a]

Possibly empty curve set

env_release_node :: Maybe Int

Maybe index to release node

env_loop_node :: Maybe Int

Maybe index to loop node


Eq a => Eq (Envelope a) 
Show a => Show (Envelope a) 

envelope :: [a] -> [a] -> [Envelope_Curve a] -> Envelope a Source

Variant without release and loop node inputs (defaulting to nil).

envelope_duration :: Num n => Envelope n -> n Source

Duration of Envelope, ie. sum . env_times.

envelope_n_segments :: (Num n, Integral i) => Envelope n -> i Source

Number of segments at Envelope, ie. length . env_times.

envelope_segment_ix :: (Ord a, Num a) => Envelope a -> a -> Maybe Int Source

Determine which envelope segment a given time t falls in.

type Envelope_Segment t = (t, t, t, t, Envelope_Curve t) Source

A set of start time, start level, end time, end level and curve.

envelope_segment :: Num t => Envelope t -> Int -> Envelope_Segment t Source

Extract envelope segment given at index i.

envelope_segments :: Num t => Envelope t -> [Envelope_Segment t] Source

Extract all segments.

pack_envelope_segments :: Num t => [Envelope_Segment t] -> ([t], [t], [Envelope_Curve t]) Source

Transform list of Envelope_Segments into lists (env_levels,env_times,env_curves).

envelope_is_normal :: (Eq n, Num n) => Envelope n -> Bool Source

An envelope is normal if it has no segments with zero duration.

envelope_normalise :: (Num a, Ord a) => Envelope a -> Envelope a Source

Normalise envelope by deleting segments of zero duration.

envelope_at :: (Ord t, Floating t) => Envelope t -> t -> t Source

Get value for Envelope at time t, or zero if t is out of range. By convention if the envelope has a segment of zero duration we give the rightmost value.

envelope_render :: (Ord t, Floating t, Enum t) => t -> Envelope t -> [(t, t)] Source

Render Envelope to breakpoint set of n equi-distant places.

envelope_table :: (Ord t, Floating t, Enum t) => t -> Envelope t -> [t] Source

Contruct a lookup table of n places from Envelope.

envelope_curves :: Num a => Envelope a -> [Envelope_Curve a] Source

Variant on env_curves that expands the, possibly empty, user list by cycling (if not empty) or by filling with EnvLin.

envelope_sc3_array :: Num a => Envelope a -> Maybe [a] Source

Linear SC3 form of Envelope data.

Form is: l0 #t reset loop l1 t0 c0 c0' ...

let {l = [0,0.6,0.3,1.0,0]
    ;t = [0.1,0.02,0.4,1.1]
    ;c = [EnvLin,EnvExp,EnvNum (-6),EnvSin]
    ;e = Envelope l t c Nothing Nothing
    ;r = [0,4,-99,-99,0.6,0.1,1,0,0.3,0.02,2,0,1,0.4,5,-6,0,1.1,3,0]}
in envelope_sc3_array e == Just r

envelope_sc3_ienvgen_array :: Num a => Envelope a -> Maybe [a] Source

IEnvGen SC3 form of Envelope data. Offset not supported (zero).

let {l = [0,0.6,0.3,1.0,0]
    ;t = [0.1,0.02,0.4,1.1]
    ;c = [EnvLin,EnvExp,EnvNum (-6),EnvSin]
    ;e = Envelope l t c Nothing Nothing
    ;r = [0,0,4,1.62,0.1,1,0,0.6,0.02,2,0,0.3,0.4,5,-6,1,1.1,3,0,0]}
in envelope_sc3_ienvgen_array e == Just r

env_delay :: Envelope a -> a -> Envelope a Source

Delay the onset of the envelope.

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

Connect releaseNode (or end) to first node of envelope.



d_dx :: Num a => [a] -> [a] Source

dx_d :: Num n => [n] -> [n] Source

d_dx' :: Num n => [n] -> [n] Source

dx_d' :: Num n => [n] -> [n] Source