musicxml2-1.6.2: A representation of the MusicXML format.

Portabilityportable
Stabilityexperimental
Maintainerhans@hanshoglund.se
Safe HaskellNone

Music.MusicXml.Simple

Contents

Description

Provides smart constructors for the MusicXML representation.

Synopsis

Documentation

Score and parts

Basic constructors

fromPart :: String -> String -> String -> [Music] -> ScoreSource

Create a single-part score.

 fromPart title composer partName measures

Example:

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

fromParts :: String -> String -> PartList -> [[Music]] -> ScoreSource

Create a multi-part score.

 fromParts title composer partList parts

Example:

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

Part lists

partList :: [String] -> PartListSource

  Create a part list from instrument names.

partListAbbr :: [(String, String)] -> PartListSource

  Create a part list from instrument names and abbreviations.

bracket :: PartList -> PartListSource

Enclose the given parts in a bracket.

brace :: PartList -> PartListSource

Enclose the given parts in a brace.

Measures

measure :: [Music] -> MusicSource

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] -> MusicSource

Convenient synonym for mconcat.

Top-level attributes

Pitch

clef :: ClefSign -> Line -> MusicSource

Create a clef.

key :: Fifths -> Mode -> MusicSource

Create a key signature.

Time

defaultDivisions :: MusicSource

Set the tick division to the default value.

divisions :: Divs -> MusicSource

Define the number of ticks per quarter note.

time :: Beat -> BeatType -> MusicSource

Create a time signature.

Tempo

metronome :: NoteVal -> Tempo -> MusicSource

Create a metronome mark.

metronome' :: NoteVal -> Bool -> Tempo -> MusicSource

Create a metronome mark.

Backup and forward

Notes

Basic constructors

rest :: NoteVal -> MusicSource

Create a rest.

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

note :: Pitch -> NoteVal -> MusicSource

Create a single note.

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

chord :: [Pitch] -> NoteVal -> MusicSource

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 -> mSource