music-score-1.7.1: Musical score and part representation.

Portabilitynon-portable (TF,GNTD)
Stabilityexperimental
Maintainerhans@hanshoglund.se
Safe HaskellNone

Music.Time.Reactive

Contents

Description

 

Synopsis

Reactive type

data Reactive a Source

Forms an applicative as per Behavior, but only switches at discrete points.

Construction

initial :: Reactive a -> aSource

Get the initial value.

final :: Reactive a -> aSource

Get the final value.

intermediate :: Transformable a => Reactive a -> [Note a]Source

Get all intermediate values.

discrete :: Reactive a -> Behavior aSource

Realize a Reactive value as a discretely changing behavior.

updates :: Reactive a -> [(Time, a)]Source

Deprecated:

Get the time of all updates and the value switched to at this point.

occs :: Reactive a -> [Time]Source

Deprecated:

atTime :: Reactive a -> Time -> aSource

Deprecated:

splitReactive :: Reactive a -> Either a ((a, Time), [Note a], (Time, a))Source

Deprecated:

Split a reactive into notes, as well as the values before and after the first/last update

Combinators

switchR :: Time -> Reactive a -> Reactive a -> Reactive aSource

switch t a b behaves as a before time t, then as b.

Sampling and discretization

continous :: Reactive (Segment a) -> Behavior aSource

Realize a Reactive value as an continous behavior.

See also concatSegment and concatB.

continousWith :: Segment (a -> b) -> Reactive a -> Behavior bSource

Realize a Reactive value as an continous behavior.

See also concatSegment and concatB.

sample :: [Time] -> Behavior a -> Reactive aSource

Sample a Behavior into a reactive.