Copyright | (c) Hans Hoglund 2012 |
---|---|
License | BSD-style |
Maintainer | hans@hanshoglund.se |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Provides smart constructors for the MusicXML representation.
- module Data.Music.MusicXml
- fromPart :: String -> String -> String -> [Music] -> Score
- fromParts :: String -> String -> PartList -> [[Music]] -> Score
- partList :: [String] -> PartList
- partListDisplay :: [(String, String)] -> PartList
- partListAbbr :: [(String, String)] -> PartList
- bracket :: PartList -> PartList
- brace :: PartList -> PartList
- measure :: [Music] -> Music
- bar :: [Music] -> Music
- trebleClef :: Music
- altoClef :: Music
- bassClef :: Music
- defaultClef :: Music
- clef :: ClefSign -> Line -> Music
- defaultKey :: Music
- key :: Fifths -> Mode -> Music
- defaultDivisions :: Music
- divisions :: Divs -> Music
- commonTime :: Music
- cutTime :: Music
- time :: Beat -> BeatType -> Music
- staves :: Int -> Music
- metronome :: NoteVal -> Tempo -> Music
- metronome' :: NoteVal -> Bool -> Tempo -> Music
- backup :: Duration -> Music
- forward :: Duration -> Music
- rest :: NoteVal -> Music
- note :: Pitch -> NoteVal -> Music
- chord :: [Pitch] -> NoteVal -> Music
- setVoice :: Int -> Music -> Music
- dot :: Music -> Music
- tuplet :: Int -> Int -> Music -> Music
- setNoteVal :: NoteVal -> Music -> Music
- separateDots :: NoteVal -> (NoteVal, Int)
- beam :: Music -> Music
- beginBeam :: Music -> Music
- continueBeam :: Music -> Music
- endBeam :: Music -> Music
- beginTie :: Music -> Music
- endTie :: Music -> Music
- setNoteHead :: NoteHead -> Music -> Music
- addNotation :: Notation -> Music -> Music
- beginGliss :: Music -> Music
- endGliss :: Music -> Music
- beginSlide :: Music -> Music
- endSlide :: Music -> Music
- fermata :: FermataSign -> Music -> Music
- breathMark :: Music -> Music
- caesura :: Music -> Music
- addTechnical :: Technical -> Music -> Music
- addArticulation :: Articulation -> Music -> Music
- upbow :: Music -> Music
- downbow :: Music -> Music
- harmonic :: Music -> Music
- openString :: Music -> Music
- slur :: Music -> Music
- beginSlur :: Music -> Music
- endSlur :: Music -> Music
- staccato :: Music -> Music
- tenuto :: Music -> Music
- spiccato :: Music -> Music
- staccatissimo :: Music -> Music
- accent :: Music -> Music
- strongAccent :: Music -> Music
- scoop :: Music -> Music
- plop :: Music -> Music
- doit :: Music -> Music
- falloff :: Music -> Music
- stress :: Music -> Music
- unstress :: Music -> Music
- trill :: Music -> Music
- turn :: Bool -> Bool -> Music -> Music
- shake :: Music -> Music
- mordent :: Bool -> Music -> Music
- tremolo :: Int -> Music -> Music
- cresc :: Music -> Music
- dim :: Music -> Music
- beginCresc :: Music
- endCresc :: Music
- beginDim :: Music
- endDim :: Music
- dynamic :: Dynamics -> Music
- crescFrom :: Dynamics -> Music -> Music
- crescTo :: Dynamics -> Music -> Music
- crescFromTo :: Dynamics -> Dynamics -> Music -> Music
- dimFrom :: Dynamics -> Music -> Music
- dimTo :: Dynamics -> Music -> Music
- dimFromTo :: Dynamics -> Dynamics -> Music -> Music
- text :: String -> Music
- rehearsal :: String -> Music
- segno :: Music
- coda :: Music
- mapMusic :: (Attributes -> Attributes) -> (Note -> Note) -> (Direction -> Direction) -> Music -> Music
- foldMusic :: Monoid m => (Attributes -> r) -> (Note -> r) -> (Direction -> r) -> (r -> m) -> Music -> m
Documentation
module Data.Music.MusicXml
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" []
Part lists
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.
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) ] ]
Top-level attributes
Pitch
Time
defaultDivisions :: Music Source
Set the tick division to the default value.
Tempo
Backup and forward
Notes
Basic constructors
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
setNoteVal :: NoteVal -> Music -> Music Source
separateDots :: NoteVal -> (NoteVal, Int) Source
Beams
continueBeam :: Music -> Music Source
Ties
Note heads
setNoteHead :: NoteHead -> Music -> Music Source
Notations
addNotation :: Notation -> Music -> Music Source
Pitch transformations
Glissando
beginGliss :: Music -> Music Source
Slides
beginSlide :: Music -> Music Source
Time transformations
Accelerando and ritardando
Fermatas and breaks
fermata :: FermataSign -> Music -> Music Source
breathMark :: Music -> Music Source
Articulation
addTechnical :: Technical -> Music -> Music Source
addArticulation :: Articulation -> Music -> Music Source
Technical
openString :: Music -> Music Source
Slurs
Staccato and tenuto
staccatissimo :: Music -> Music Source
Accents
strongAccent :: Music -> Music Source
Miscellaneous
Ornaments
Dynamics
Crescendo and diminuendo
Dynamic levels
Both
Text
Folds and maps
mapMusic :: (Attributes -> Attributes) -> (Note -> Note) -> (Direction -> Direction) -> Music -> Music Source