Portability | non-portable (TF,GNTD) |
---|---|
Stability | experimental |
Maintainer | hans@hanshoglund.se |
Safe Haskell | None |
Provides the Track
type.
Documentation
A track is a list of events with explicit onset. Events can not overlap.
Track is a Monoid
under parallel composition. mempty
is the empty track and mappend
interleaves values.
Track has an Applicative
instance derived from the Monad
instance.
Track is a Monad
. return
creates a track containing a single value at time
zero, and >>=
transforms the values of a track, allowing the addition and
removal of values relative to the time of the value. Perhaps more intuitively,
join
delays each inner track to start at the offset of an outer track, then
removes the intermediate structure.
let t = Track [(0, 65),(1, 66)] t >>= \x -> Track [(0, 'a'), (10, toEnum x)] ==> Track {getTrack = [ (0.0, 'a'), (1.0, 'a'), (10.0, 'A'), (11.0, 'B') ]}
Track is an instance of VectorSpace
using parallel composition as addition,
and time scaling as scalar multiplication.
Monad Track | |
Functor Track | |
MonadPlus Track | |
Applicative Track | |
Foldable Track | |
Alternative Track | |
Delayable Track | |
Stretchable Track | |
HasOnset Track | |
Transformable1 Track | |
Eq a => Eq (Track a) | |
Ord a => Ord (Track a) | |
Show a => Show (Track a) | |
Arbitrary a => Arbitrary (Track a) | |
Monoid (Track a) | |
Semigroup (Track a) |