Portability | non-portable (TF,GNTD) |
---|---|
Stability | experimental |
Maintainer | hans@hanshoglund.se |
Safe Haskell | None |
Provides the Score
type.
- data Score a
Documentation
A score is a list of events, i.e. time-duration-value triplets. Semantically
type Score a = [(Time, Duration, a)]
There is no explicit representation for rests. However you can use `Score (Maybe a)` to
represent a score with rests. Such rests are only useful when composing scores. They
may be removed with removeRests
.
Score is a Monoid
under parallel composition. mempty
is a score of no parts.
For sequential composition of scores, use |>
.
Score has an Applicative
instance derived from the Monad
instance. Not sure it is useful.
Score is an instance of VectorSpace
using sequential composition as addition,
and time scaling as scalar multiplication.
Monad Score | This instance is somewhat similar to the list instance.
let s = compose [(0,1,0), (1,2,1)] s >>= \x -> compose [ (0,1,toEnum $ x+65), (1,3,toEnum $ x+97) ] :: Score Char ===> compose [ (1, 1, 'A'), (1, 3, 'a'), (1, 2, 'B'), (3, 6, 'b') ]} |
Functor Score | |
Typeable1 Score | |
MonadPlus Score | |
Applicative Score | |
Foldable Score | |
Traversable Score | |
Alternative Score | |
Pointed Score | |
Delayable Score | |
Stretchable Score | |
Performable Score | |
HasOffset Score | |
HasOnset Score | |
HasDuration Score | |
HasEvents Score | |
Composable Score | |
Transformable Score | |
Transformable1 Score | |
Eq a => Eq (Score a) | |
Ord a => Ord (Score a) | |
Show a => Show (Score a) | |
Arbitrary a => Arbitrary (Score a) | |
Monoid (Score a) | |
VectorSpace (Score a) | |
IsDynamics a => IsDynamics (Score a) | |
IsPitch a => IsPitch (Score a) | |
Semigroup (Score a) | |
AdditiveGroup (Score a) |