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

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

Music.Time.Reactive

Contents

Description

Reactive values, or piecewise functions of time.

Similar to Conal's definition in http://conal.net/blog/posts/reactive-normal-form, but defined in negative time as well. Its semantics function is either occs &&& ? or initial &&& updates, where intial is the value from negative infinity to the first update.

TODO integrate better in the library

Synopsis

Documentation

Create, isos etc (TODO)

initial :: Reactive a -> aSource

Get the initial value.

final :: Reactive a -> aSource

Get the final value.

type Future a = (Time, a)Source

type Past a = (Time, a)Source

updates :: Reactive a -> [Future a]Source

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

occs :: Reactive a -> [Time]Source

Get the time of all updatese.

Predicates

Combinators

step :: (AdditiveGroup a, Fractional a) => Reactive aSource

The unit step function, which goes from 0 to 1 at start.

switch :: Time -> Reactive a -> Reactive a -> Reactive aSource

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

trim :: Monoid a => Span -> Reactive a -> Reactive aSource

Replace everthing outside the given span by mempty.

trimBefore :: Monoid a => Time -> Reactive a -> Reactive aSource

Replace everthing before the given time by mempty.

trimAfter :: Monoid a => Time -> Reactive a -> Reactive aSource

Replace everthing after the given time by mempty.

Semantics