musicxml2-1.9.0: A representation of the MusicXML format.

Copyright(c) Hans Hoglund 2012
LicenseBSD-style
Maintainerhans@hanshoglund.se
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.Music.MusicXml.Simple

Contents

Description

Provides smart constructors for the MusicXML representation.

Synopsis

Documentation

Score and parts

Basic constructors

fromPart :: String -> String -> String -> [Music] -> Score Source

Create a single-part score.

fromPart title composer partName measures

Example:

 fromPart "Suite" "Bach" "Cello solo" []

fromParts :: String -> String -> PartList -> [[Music]] -> Score Source

Create a multi-part score.

fromParts title composer partList parts

Example:

 fromParts "4'33" "Cage" (partList ["Violin", "Viola", "Cello"]) [[]]

Part lists

partList :: [String] -> PartList Source

  Create a part list from instrument names.

partListDisplay :: [(String, String)] -> PartList Source

  Create a part list from instrument names and displayed names (some applications need the name to be something specific, so use displayed name to override).

partListAbbr :: [(String, String)] -> PartList Source

  Create a part list from instrument names and abbreviations.

bracket :: PartList -> PartList Source

Enclose the given parts in a bracket.

brace :: PartList -> PartList Source

Enclose the given parts in a brace.

Measures

measure :: [Music] -> Music Source

Convenient synonym for mconcat, allowing us to write things like

measure [
   beam [ 
       note c  (1/8), 
       note d  (1/8),
       note e  (1/8),
       note f  (1/8) 
   ],
   tuplet 3 2 [ 
       note g  (1/4),
       note a  (1/4),
       note b  (1/4) 
   ]
]

bar :: [Music] -> Music Source

Convenient synonym for mconcat.

Top-level attributes

Pitch

clef :: ClefSign -> Line -> Music Source

Create a clef.

key :: Fifths -> Mode -> Music Source

Create a key signature.

Time

defaultDivisions :: Music Source

Set the tick division to the default value.

divisions :: Divs -> Music Source

Define the number of ticks per quarter note.

time :: Beat -> BeatType -> Music Source

Create a time signature.

Tempo

metronome :: NoteVal -> Tempo -> Music Source

Create a metronome mark.

metronome' :: NoteVal -> Bool -> Tempo -> Music Source

Create a metronome mark.

Backup and forward

Notes

Basic constructors

rest :: NoteVal -> Music Source

Create a rest.

rest (1/4)
rest (3/8)
rest quarter
rest (dotted eight)

note :: Pitch -> NoteVal -> Music Source

Create a single note.

note c   (1/4)
note fs_ (3/8)
note c   quarter
note (c + pure fifth) (dotted eight)

chord :: [Pitch] -> NoteVal -> Music Source

Create a chord.

chord [c,eb,fs_] (3/8)
chord [c,d,e] quarter
chord [c,d,e] (dotted eight)

Voice

Duration

Beams

Ties

Note heads

Notations

Pitch transformations

Glissando

Slides

Time transformations

Accelerando and ritardando

Fermatas and breaks

Articulation

Technical

Slurs

Staccato and tenuto

Accents

Miscellaneous

Ornaments

Dynamics

Crescendo and diminuendo

Dynamic levels

Both

Text

Folds and maps

foldMusic :: Monoid m => (Attributes -> r) -> (Note -> r) -> (Direction -> r) -> (r -> m) -> Music -> m Source