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

Copyright(c) Hans Hoglund 2012-2014
LicenseBSD-style
Maintainerhans@hanshoglund.se
Stabilityexperimental
Portabilitynon-portable (TF,GNTD)
Safe HaskellNone
LanguageHaskell2010

Music.Time.Reactive

Contents

Description

 

Synopsis

Reactive type

data Reactive a Source

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

Instances

Functor Reactive 
Applicative Reactive 
Monoid a => Monoid (Reactive a) 
Wrapped (Reactive a) 
Semigroup a => Semigroup (Reactive a) 
IsPitch a => IsPitch (Reactive a) 
IsInterval a => IsInterval (Reactive a) 
IsDynamics a => IsDynamics (Reactive a) 
Transformable (Reactive a) 
Reversible (Reactive a) 
Alterable a => Alterable (Reactive a) 
Augmentable a => Augmentable (Reactive a) 
Rewrapped (Reactive a) (Reactive b) 
Typeable (* -> *) Reactive 
type Unwrapped (Reactive a) = ([Time], Behavior a) 

Query

initial :: Reactive a -> a Source

Get the initial value.

final :: Reactive a -> a Source

Get the final value.

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

Get all intermediate values.

discrete :: Reactive a -> Behavior a Source

Realize a Reactive value as a discretely changing behavior.

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

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

atTime :: Reactive a -> Time -> a Source

Construction

Combine

switchR :: Time -> Reactive a -> Reactive a -> Reactive a Source

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

Split

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

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

Sampling

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

Realize a Reactive value as an continous behavior.

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

Realize a Reactive value as an continous behavior.

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

Sample a Behavior into a reactive.