mezzo-0.3.1.0: Typesafe music composition

Copyright(c) Dima Szamozvancev
LicenseMIT
Maintainerds709@cam.ac.uk
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Mezzo.Compose.Types

Contents

Description

Types used by the composition library.

Synopsis

Duration type synonyms

type Whole = 32 Source #

Whole note duration.

type Half = 16 Source #

Half note duration.

type Quarter = 8 Source #

Quarter note duration.

type Eighth = 4 Source #

Eighth note duration.

type Sixteenth = 2 Source #

Sixteenth note duration.

type ThirtySecond = 1 Source #

Thirty-second note duration.

Melody

data Melody :: forall l t k r. Signature t k r -> Partiture 1 l -> Nat -> Type where Source #

Single-voice melody: gives an easy way to input notes and rests of different lengths.

Constructors

Melody :: Melody s (End :-- None) Quarter

Start a new melody. If the first note duration is not specified ('(:|)' is used), the default duration is a quarter.

(:|) :: (ValidMel s ms (FromRoot r d), IntRep r, Primitive d, ValidNote s r d) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r d) d infixl 5

Add a note with the same duration as the previous one.

(:<<<) :: (ValidMel s ms (FromRoot r ThirtySecond), IntRep r, Primitive d, ValidNote s r ThirtySecond) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r ThirtySecond) ThirtySecond infixl 5

Add a thirty-second note.

(:<<) :: (ValidMel s ms (FromRoot r Sixteenth), IntRep r, Primitive d, ValidNote s r Sixteenth) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r Sixteenth) Sixteenth infixl 5

Add a sixteenth note.

(:<) :: (ValidMel s ms (FromRoot r Eighth), IntRep r, Primitive d, ValidNote s r Eighth) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r Eighth) Eighth infixl 5

Add an eighth note.

(:^) :: (ValidMel s ms (FromRoot r Quarter), IntRep r, Primitive d, ValidNote s r Quarter) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r Quarter) Quarter infixl 5

Add a quarter note.

(:>) :: (ValidMel s ms (FromRoot r Half), IntRep r, Primitive d, ValidNote s r Half) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r Half) Half infixl 5

Add a half note.

(:>>) :: (ValidMel s ms (FromRoot r Whole), IntRep r, Primitive d, ValidNote s r Whole) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r Whole) Whole infixl 5

Add a whole note.

(:<<.) :: (ValidMel s ms (FromRoot r (Dot Sixteenth)), IntRep r, Primitive d, ValidNote s r (Dot Sixteenth)) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r (Dot Sixteenth)) (Dot Sixteenth) infixl 5

Add a dotted sixteenth note.

(:<.) :: (ValidMel s ms (FromRoot r (Dot Eighth)), IntRep r, Primitive d, ValidNote s r (Dot Eighth)) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r (Dot Eighth)) (Dot Eighth) infixl 5

Add a dotted eighth note.

(:^.) :: (ValidMel s ms (FromRoot r (Dot Quarter)), IntRep r, Primitive d, ValidNote s r (Dot Quarter)) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r (Dot Quarter)) (Dot Quarter) infixl 5

Add a dotted quarter note.

(:>.) :: (ValidMel s ms (FromRoot r (Dot Half)), IntRep r, Primitive d, ValidNote s r (Dot Half)) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r (Dot Half)) (Dot Half) infixl 5

Add a dotted half note.

(:>>.) :: (ValidMel s ms (FromRoot r (Dot Whole)), IntRep r, Primitive d, ValidNote s r (Dot Whole)) => Melody s ms d -> RootS r -> Melody s (ms +|+ FromRoot r (Dot Whole)) (Dot Whole) infixl 5

Add a dotted whole note.

(:~|) :: (ValidMel s ms (FromSilence d), Primitive d, ValidRest s d) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence d) d infixl 5

Add a rest with the same duration as the previous one.

(:~<<<) :: (ValidMel s ms (FromSilence ThirtySecond), Primitive d, ValidRest s ThirtySecond) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence ThirtySecond) ThirtySecond infixl 5

Add a thirty-second rest.

(:~<<) :: (ValidMel s ms (FromSilence Sixteenth), Primitive d, ValidRest s Sixteenth) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence Sixteenth) Sixteenth infixl 5

Add a sixteenth rest.

(:~<) :: (ValidMel s ms (FromSilence Eighth), Primitive d, ValidRest s Eighth) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence Eighth) Eighth infixl 5

Add an eighth rest.

(:~^) :: (ValidMel s ms (FromSilence Quarter), Primitive d, ValidRest s Quarter) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence Quarter) Quarter infixl 5

Add a quarter rest.

(:~>) :: (ValidMel s ms (FromSilence Half), Primitive d, ValidRest s Half) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence Half) Half infixl 5

Add a half rest.

(:~>>) :: (ValidMel s ms (FromSilence Whole), Primitive d, ValidRest s Whole) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence Whole) Whole infixl 5

Add a whole rest.

(:~<<.) :: (ValidMel s ms (FromSilence (Dot Sixteenth)), Primitive d, ValidRest s (Dot Sixteenth)) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence (Dot Sixteenth)) (Dot Sixteenth) infixl 5

Add a dotted sixteenth rest.

(:~<.) :: (ValidMel s ms (FromSilence (Dot Eighth)), Primitive d, ValidRest s (Dot Eighth)) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence (Dot Eighth)) (Dot Eighth) infixl 5

Add a dotted eighth rest.

(:~^.) :: (ValidMel s ms (FromSilence (Dot Quarter)), Primitive d, ValidRest s (Dot Quarter)) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence (Dot Quarter)) (Dot Quarter) infixl 5

Add a dotted quarter rest.

(:~>.) :: (ValidMel s ms (FromSilence (Dot Half)), Primitive d, ValidRest s (Dot Half)) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence (Dot Half)) (Dot Half) infixl 5

Add a dotted half rest.

(:~>>.) :: (ValidMel s ms (FromSilence (Dot Whole)), Primitive d, ValidRest s (Dot Whole)) => Melody s ms d -> RestS -> Melody s (ms +|+ FromSilence (Dot Whole)) (Dot Whole) infixl 5

Add a dotted whole rest.