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

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

Music.Score.Track

Description

Provides the Track type.

Synopsis

Documentation

newtype Track a Source

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.

Constructors

Track 

Fields

getTrack :: [(TimeT, a)]