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

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

Music.Score.Track

Contents

Description

Provides the Track type.

Synopsis

Track type

data Track a Source

A track is a list of events with explicit onset.

Track is a Monoid under parallel composition. mempty is the empty track and mappend interleaves values.

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.

track' :: Iso' [(Time, a)] (Track a)Source

Create a voice from a list of occurences.

track :: Iso [(Time, a)] [(Time, b)] (Track a) (Track b)Source

Create a voice from a list of occurences.