{-# LANGUAGE TupleSections #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE MultiParamTypeClasses #-}

module Fadno.MusicXml.MusicXml20 where

import GHC.Generics
import Data.Data
import Data.Decimal
import Data.String
import Fadno.Xml.EmitXml
import qualified Fadno.Xml.XParse as P
import qualified Control.Applicative as P
import Control.Applicative ((<|>))
import Control.Arrow as A

-- | @xs:ID@ /(simple)/
newtype ID = ID { iD :: NCName }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show ID where show (ID a) = show a
instance Read ID where readsPrec i = map (A.first ID) . readsPrec i
instance EmitXml ID where
    emitXml = emitXml . iD
parseID :: String -> P.XParse ID
parseID = return . fromString

-- | @xs:IDREF@ /(simple)/
newtype IDREF = IDREF { iDREF :: NCName }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show IDREF where show (IDREF a) = show a
instance Read IDREF where readsPrec i = map (A.first IDREF) . readsPrec i
instance EmitXml IDREF where
    emitXml = emitXml . iDREF
parseIDREF :: String -> P.XParse IDREF
parseIDREF = return . fromString

-- | @xs:NCName@ /(simple)/
newtype NCName = NCName { nCName :: Name }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show NCName where show (NCName a) = show a
instance Read NCName where readsPrec i = map (A.first NCName) . readsPrec i
instance EmitXml NCName where
    emitXml = emitXml . nCName
parseNCName :: String -> P.XParse NCName
parseNCName = return . fromString

-- | @xs:NMTOKEN@ /(simple)/
newtype NMTOKEN = NMTOKEN { nMTOKEN :: Token }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show NMTOKEN where show (NMTOKEN a) = show a
instance Read NMTOKEN where readsPrec i = map (A.first NMTOKEN) . readsPrec i
instance EmitXml NMTOKEN where
    emitXml = emitXml . nMTOKEN
parseNMTOKEN :: String -> P.XParse NMTOKEN
parseNMTOKEN = return . fromString

-- | @xs:Name@ /(simple)/
newtype Name = Name { name :: Token }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show Name where show (Name a) = show a
instance Read Name where readsPrec i = map (A.first Name) . readsPrec i
instance EmitXml Name where
    emitXml = emitXml . name
parseName :: String -> P.XParse Name
parseName = return . fromString

-- | @above-below@ /(simple)/
--
-- The above-below type is used to indicate whether one element appears above or below another element.
data AboveBelow = 
      AboveBelowAbove -- ^ /above/
    | AboveBelowBelow -- ^ /below/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml AboveBelow where
    emitXml AboveBelowAbove = XLit "above"
    emitXml AboveBelowBelow = XLit "below"
parseAboveBelow :: String -> P.XParse AboveBelow
parseAboveBelow s
        | s == "above" = return $ AboveBelowAbove
        | s == "below" = return $ AboveBelowBelow
        | otherwise = P.xfail $ "AboveBelow: " ++ s

-- | @accidental-value@ /(simple)/
--
-- The accidental-value type represents notated accidentals supported by MusicXML. In the MusicXML 2.0 DTD this was a string with values that could be included. The XSD strengthens the data typing to an enumerated list.
data AccidentalValue = 
      AccidentalValueSharp -- ^ /sharp/
    | AccidentalValueNatural -- ^ /natural/
    | AccidentalValueFlat -- ^ /flat/
    | AccidentalValueDoubleSharp -- ^ /double-sharp/
    | AccidentalValueSharpSharp -- ^ /sharp-sharp/
    | AccidentalValueFlatFlat -- ^ /flat-flat/
    | AccidentalValueNaturalSharp -- ^ /natural-sharp/
    | AccidentalValueNaturalFlat -- ^ /natural-flat/
    | AccidentalValueQuarterFlat -- ^ /quarter-flat/
    | AccidentalValueQuarterSharp -- ^ /quarter-sharp/
    | AccidentalValueThreeQuartersFlat -- ^ /three-quarters-flat/
    | AccidentalValueThreeQuartersSharp -- ^ /three-quarters-sharp/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml AccidentalValue where
    emitXml AccidentalValueSharp = XLit "sharp"
    emitXml AccidentalValueNatural = XLit "natural"
    emitXml AccidentalValueFlat = XLit "flat"
    emitXml AccidentalValueDoubleSharp = XLit "double-sharp"
    emitXml AccidentalValueSharpSharp = XLit "sharp-sharp"
    emitXml AccidentalValueFlatFlat = XLit "flat-flat"
    emitXml AccidentalValueNaturalSharp = XLit "natural-sharp"
    emitXml AccidentalValueNaturalFlat = XLit "natural-flat"
    emitXml AccidentalValueQuarterFlat = XLit "quarter-flat"
    emitXml AccidentalValueQuarterSharp = XLit "quarter-sharp"
    emitXml AccidentalValueThreeQuartersFlat = XLit "three-quarters-flat"
    emitXml AccidentalValueThreeQuartersSharp = XLit "three-quarters-sharp"
parseAccidentalValue :: String -> P.XParse AccidentalValue
parseAccidentalValue s
        | s == "sharp" = return $ AccidentalValueSharp
        | s == "natural" = return $ AccidentalValueNatural
        | s == "flat" = return $ AccidentalValueFlat
        | s == "double-sharp" = return $ AccidentalValueDoubleSharp
        | s == "sharp-sharp" = return $ AccidentalValueSharpSharp
        | s == "flat-flat" = return $ AccidentalValueFlatFlat
        | s == "natural-sharp" = return $ AccidentalValueNaturalSharp
        | s == "natural-flat" = return $ AccidentalValueNaturalFlat
        | s == "quarter-flat" = return $ AccidentalValueQuarterFlat
        | s == "quarter-sharp" = return $ AccidentalValueQuarterSharp
        | s == "three-quarters-flat" = return $ AccidentalValueThreeQuartersFlat
        | s == "three-quarters-sharp" = return $ AccidentalValueThreeQuartersSharp
        | otherwise = P.xfail $ "AccidentalValue: " ++ s

-- | @accordion-middle@ /(simple)/
--
-- The accordion-middle type may have values of 1, 2, or 3, corresponding to having 1 to 3 dots in the middle section of the accordion registration symbol.
newtype AccordionMiddle = AccordionMiddle { accordionMiddle :: PositiveInteger }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show AccordionMiddle where show (AccordionMiddle a) = show a
instance Read AccordionMiddle where readsPrec i = map (A.first AccordionMiddle) . readsPrec i
instance EmitXml AccordionMiddle where
    emitXml = emitXml . accordionMiddle
parseAccordionMiddle :: String -> P.XParse AccordionMiddle
parseAccordionMiddle = P.xread "AccordionMiddle"

-- | @xlink:actuate@ /(simple)/
data Actuate = 
      ActuateOnRequest -- ^ /onRequest/
    | ActuateOnLoad -- ^ /onLoad/
    | ActuateOther -- ^ /other/
    | ActuateNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml Actuate where
    emitXml ActuateOnRequest = XLit "onRequest"
    emitXml ActuateOnLoad = XLit "onLoad"
    emitXml ActuateOther = XLit "other"
    emitXml ActuateNone = XLit "none"
parseActuate :: String -> P.XParse Actuate
parseActuate s
        | s == "onRequest" = return $ ActuateOnRequest
        | s == "onLoad" = return $ ActuateOnLoad
        | s == "other" = return $ ActuateOther
        | s == "none" = return $ ActuateNone
        | otherwise = P.xfail $ "Actuate: " ++ s

-- | @backward-forward@ /(simple)/
--
-- The backward-forward type is used to specify repeat directions. The start of the repeat has a forward direction while the end of the repeat has a backward direction.
data BackwardForward = 
      BackwardForwardBackward -- ^ /backward/
    | BackwardForwardForward -- ^ /forward/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml BackwardForward where
    emitXml BackwardForwardBackward = XLit "backward"
    emitXml BackwardForwardForward = XLit "forward"
parseBackwardForward :: String -> P.XParse BackwardForward
parseBackwardForward s
        | s == "backward" = return $ BackwardForwardBackward
        | s == "forward" = return $ BackwardForwardForward
        | otherwise = P.xfail $ "BackwardForward: " ++ s

-- | @bar-style@ /(simple)/
--
-- The bar-style type represents barline style information. Choices are regular, dotted, dashed, heavy, light-light, light-heavy, heavy-light, heavy-heavy, tick (a short stroke through the top line), short (a partial barline between the 2nd and 4th lines), and none.
data BarStyle = 
      BarStyleRegular -- ^ /regular/
    | BarStyleDotted -- ^ /dotted/
    | BarStyleDashed -- ^ /dashed/
    | BarStyleHeavy -- ^ /heavy/
    | BarStyleLightLight -- ^ /light-light/
    | BarStyleLightHeavy -- ^ /light-heavy/
    | BarStyleHeavyLight -- ^ /heavy-light/
    | BarStyleHeavyHeavy -- ^ /heavy-heavy/
    | BarStyleTick -- ^ /tick/
    | BarStyleShort -- ^ /short/
    | BarStyleNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml BarStyle where
    emitXml BarStyleRegular = XLit "regular"
    emitXml BarStyleDotted = XLit "dotted"
    emitXml BarStyleDashed = XLit "dashed"
    emitXml BarStyleHeavy = XLit "heavy"
    emitXml BarStyleLightLight = XLit "light-light"
    emitXml BarStyleLightHeavy = XLit "light-heavy"
    emitXml BarStyleHeavyLight = XLit "heavy-light"
    emitXml BarStyleHeavyHeavy = XLit "heavy-heavy"
    emitXml BarStyleTick = XLit "tick"
    emitXml BarStyleShort = XLit "short"
    emitXml BarStyleNone = XLit "none"
parseBarStyle :: String -> P.XParse BarStyle
parseBarStyle s
        | s == "regular" = return $ BarStyleRegular
        | s == "dotted" = return $ BarStyleDotted
        | s == "dashed" = return $ BarStyleDashed
        | s == "heavy" = return $ BarStyleHeavy
        | s == "light-light" = return $ BarStyleLightLight
        | s == "light-heavy" = return $ BarStyleLightHeavy
        | s == "heavy-light" = return $ BarStyleHeavyLight
        | s == "heavy-heavy" = return $ BarStyleHeavyHeavy
        | s == "tick" = return $ BarStyleTick
        | s == "short" = return $ BarStyleShort
        | s == "none" = return $ BarStyleNone
        | otherwise = P.xfail $ "BarStyle: " ++ s

-- | @beam-level@ /(simple)/
--
-- The MusicXML format supports six levels of beaming, up to 256th notes. Unlike the number-level type, the beam-level type identifies concurrent beams in a beam group. It does not distinguish overlapping beams such as grace notes within regular notes, or beams used in different voices.
newtype BeamLevel = BeamLevel { beamLevel :: PositiveInteger }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show BeamLevel where show (BeamLevel a) = show a
instance Read BeamLevel where readsPrec i = map (A.first BeamLevel) . readsPrec i
instance EmitXml BeamLevel where
    emitXml = emitXml . beamLevel
parseBeamLevel :: String -> P.XParse BeamLevel
parseBeamLevel = P.xread "BeamLevel"

-- | @beam-value@ /(simple)/
--
-- The beam-value type represents the type of beam associated with each of 6 beam levels (up to 256th notes) available for each note.
data BeamValue = 
      BeamValueBegin -- ^ /begin/
    | BeamValueContinue -- ^ /continue/
    | BeamValueEnd -- ^ /end/
    | BeamValueForwardHook -- ^ /forward hook/
    | BeamValueBackwardHook -- ^ /backward hook/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml BeamValue where
    emitXml BeamValueBegin = XLit "begin"
    emitXml BeamValueContinue = XLit "continue"
    emitXml BeamValueEnd = XLit "end"
    emitXml BeamValueForwardHook = XLit "forward hook"
    emitXml BeamValueBackwardHook = XLit "backward hook"
parseBeamValue :: String -> P.XParse BeamValue
parseBeamValue s
        | s == "begin" = return $ BeamValueBegin
        | s == "continue" = return $ BeamValueContinue
        | s == "end" = return $ BeamValueEnd
        | s == "forward hook" = return $ BeamValueForwardHook
        | s == "backward hook" = return $ BeamValueBackwardHook
        | otherwise = P.xfail $ "BeamValue: " ++ s

-- | @clef-sign@ /(simple)/
--
-- The clef-sign element represents the different clef symbols.
data ClefSign = 
      ClefSignG -- ^ /G/
    | ClefSignF -- ^ /F/
    | ClefSignC -- ^ /C/
    | ClefSignPercussion -- ^ /percussion/
    | ClefSignTAB -- ^ /TAB/
    | ClefSignNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml ClefSign where
    emitXml ClefSignG = XLit "G"
    emitXml ClefSignF = XLit "F"
    emitXml ClefSignC = XLit "C"
    emitXml ClefSignPercussion = XLit "percussion"
    emitXml ClefSignTAB = XLit "TAB"
    emitXml ClefSignNone = XLit "none"
parseClefSign :: String -> P.XParse ClefSign
parseClefSign s
        | s == "G" = return $ ClefSignG
        | s == "F" = return $ ClefSignF
        | s == "C" = return $ ClefSignC
        | s == "percussion" = return $ ClefSignPercussion
        | s == "TAB" = return $ ClefSignTAB
        | s == "none" = return $ ClefSignNone
        | otherwise = P.xfail $ "ClefSign: " ++ s

-- | @color@ /(simple)/
--
-- The color type indicates the color of an element. Color may be represented as hexadecimal RGB triples, as in HTML, or as hexadecimal ARGB tuples, with the A indicating alpha of transparency. An alpha value of 00 is totally transparent; FF is totally opaque. If RGB is used, the A value is assumed to be FF. 
-- 
-- For instance, the RGB value "#800080" represents purple. An ARGB value of "#40800080" would be a transparent purple.
-- 
-- As in SVG 1.1, colors are defined in terms of the sRGB color space (IEC 61966).
newtype Color = Color { color :: Token }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show Color where show (Color a) = show a
instance Read Color where readsPrec i = map (A.first Color) . readsPrec i
instance EmitXml Color where
    emitXml = emitXml . color
parseColor :: String -> P.XParse Color
parseColor = return . fromString

-- | @comma-separated-text@ /(simple)/
--
-- The comma-separated-text type is used to specify a comma-separated list of text elements, as is used by the font-family attribute.
newtype CommaSeparatedText = CommaSeparatedText { commaSeparatedText :: Token }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show CommaSeparatedText where show (CommaSeparatedText a) = show a
instance Read CommaSeparatedText where readsPrec i = map (A.first CommaSeparatedText) . readsPrec i
instance EmitXml CommaSeparatedText where
    emitXml = emitXml . commaSeparatedText
parseCommaSeparatedText :: String -> P.XParse CommaSeparatedText
parseCommaSeparatedText = return . fromString

-- | @css-font-size@ /(simple)/
--
-- The css-font-size type includes the CSS font sizes used as an alternative to a numeric point size.
data CssFontSize = 
      CssFontSizeXxSmall -- ^ /xx-small/
    | CssFontSizeXSmall -- ^ /x-small/
    | CssFontSizeSmall -- ^ /small/
    | CssFontSizeMedium -- ^ /medium/
    | CssFontSizeLarge -- ^ /large/
    | CssFontSizeXLarge -- ^ /x-large/
    | CssFontSizeXxLarge -- ^ /xx-large/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml CssFontSize where
    emitXml CssFontSizeXxSmall = XLit "xx-small"
    emitXml CssFontSizeXSmall = XLit "x-small"
    emitXml CssFontSizeSmall = XLit "small"
    emitXml CssFontSizeMedium = XLit "medium"
    emitXml CssFontSizeLarge = XLit "large"
    emitXml CssFontSizeXLarge = XLit "x-large"
    emitXml CssFontSizeXxLarge = XLit "xx-large"
parseCssFontSize :: String -> P.XParse CssFontSize
parseCssFontSize s
        | s == "xx-small" = return $ CssFontSizeXxSmall
        | s == "x-small" = return $ CssFontSizeXSmall
        | s == "small" = return $ CssFontSizeSmall
        | s == "medium" = return $ CssFontSizeMedium
        | s == "large" = return $ CssFontSizeLarge
        | s == "x-large" = return $ CssFontSizeXLarge
        | s == "xx-large" = return $ CssFontSizeXxLarge
        | otherwise = P.xfail $ "CssFontSize: " ++ s

-- | @degree-type-value@ /(simple)/
--
-- The degree-type-value type indicates whether the current degree element is an addition, alteration, or subtraction to the kind of the current chord in the harmony element.
data DegreeTypeValue = 
      DegreeTypeValueAdd -- ^ /add/
    | DegreeTypeValueAlter -- ^ /alter/
    | DegreeTypeValueSubtract -- ^ /subtract/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml DegreeTypeValue where
    emitXml DegreeTypeValueAdd = XLit "add"
    emitXml DegreeTypeValueAlter = XLit "alter"
    emitXml DegreeTypeValueSubtract = XLit "subtract"
parseDegreeTypeValue :: String -> P.XParse DegreeTypeValue
parseDegreeTypeValue s
        | s == "add" = return $ DegreeTypeValueAdd
        | s == "alter" = return $ DegreeTypeValueAlter
        | s == "subtract" = return $ DegreeTypeValueSubtract
        | otherwise = P.xfail $ "DegreeTypeValue: " ++ s

-- | @divisions@ /(simple)/
--
-- The divisions type is used to express values in terms of the musical divisions defined by the divisions element. It is preferred that these be integer values both for MIDI interoperability and to avoid roundoff errors.
newtype Divisions = Divisions { divisions :: Decimal }
    deriving (Eq,Typeable,Generic,Ord,Num,Real,Fractional,RealFrac)
instance Show Divisions where show (Divisions a) = show a
instance Read Divisions where readsPrec i = map (A.first Divisions) . readsPrec i
instance EmitXml Divisions where
    emitXml = emitXml . divisions
parseDivisions :: String -> P.XParse Divisions
parseDivisions = P.xread "Divisions"

-- | @enclosure@ /(simple)/
--
-- The enclosure type describes the shape and presence / absence of an enclosure around text.
data Enclosure = 
      EnclosureRectangle -- ^ /rectangle/
    | EnclosureOval -- ^ /oval/
    | EnclosureNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml Enclosure where
    emitXml EnclosureRectangle = XLit "rectangle"
    emitXml EnclosureOval = XLit "oval"
    emitXml EnclosureNone = XLit "none"
parseEnclosure :: String -> P.XParse Enclosure
parseEnclosure s
        | s == "rectangle" = return $ EnclosureRectangle
        | s == "oval" = return $ EnclosureOval
        | s == "none" = return $ EnclosureNone
        | otherwise = P.xfail $ "Enclosure: " ++ s

-- | @ending-number@ /(simple)/
--
-- The ending-number type is used to specify either a comma-separated list of positive integers without leading zeros, or a string of zero or more spaces. It is used for the number attribute of the ending element. The zero or more spaces version is used when software knows that an ending is present, but cannot determine the type of the ending.
newtype EndingNumber = EndingNumber { endingNumber :: Token }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show EndingNumber where show (EndingNumber a) = show a
instance Read EndingNumber where readsPrec i = map (A.first EndingNumber) . readsPrec i
instance EmitXml EndingNumber where
    emitXml = emitXml . endingNumber
parseEndingNumber :: String -> P.XParse EndingNumber
parseEndingNumber = return . fromString

-- | @fan@ /(simple)/
--
-- The fan type represents the type of beam fanning present on a note, used to represent accelerandos and ritardandos.
data Fan = 
      FanAccel -- ^ /accel/
    | FanRit -- ^ /rit/
    | FanNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml Fan where
    emitXml FanAccel = XLit "accel"
    emitXml FanRit = XLit "rit"
    emitXml FanNone = XLit "none"
parseFan :: String -> P.XParse Fan
parseFan s
        | s == "accel" = return $ FanAccel
        | s == "rit" = return $ FanRit
        | s == "none" = return $ FanNone
        | otherwise = P.xfail $ "Fan: " ++ s

-- | @fermata-shape@ /(simple)/
--
-- The fermata-shape type represents the shape of the fermata sign. The empty value is equivalent to the normal value.
data FermataShape = 
      FermataShapeNormal -- ^ /normal/
    | FermataShapeAngled -- ^ /angled/
    | FermataShapeSquare -- ^ /square/
    | FermataShape -- ^ //
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml FermataShape where
    emitXml FermataShapeNormal = XLit "normal"
    emitXml FermataShapeAngled = XLit "angled"
    emitXml FermataShapeSquare = XLit "square"
    emitXml FermataShape = XLit ""
parseFermataShape :: String -> P.XParse FermataShape
parseFermataShape s
        | s == "normal" = return $ FermataShapeNormal
        | s == "angled" = return $ FermataShapeAngled
        | s == "square" = return $ FermataShapeSquare
        | s == "" = return $ FermataShape
        | otherwise = P.xfail $ "FermataShape: " ++ s

-- | @fifths@ /(simple)/
--
-- The fifths type represents the number of flats or sharps in a traditional key signature. Negative numbers are used for flats and positive numbers for sharps, reflecting the key's placement within the circle of fifths (hence the type name).
newtype Fifths = Fifths { fifths :: Int }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show Fifths where show (Fifths a) = show a
instance Read Fifths where readsPrec i = map (A.first Fifths) . readsPrec i
instance EmitXml Fifths where
    emitXml = emitXml . fifths
parseFifths :: String -> P.XParse Fifths
parseFifths = P.xread "Fifths"

-- | @font-size@ /(simple)/
--
-- The font-size can be one of the CSS font sizes or a numeric point size.
data FontSize = 
      FontSizeDecimal {
          fontSize1 :: Decimal
       }
    | FontSizeCssFontSize {
          fontSize2 :: CssFontSize
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml FontSize where
    emitXml (FontSizeDecimal a) = emitXml a
    emitXml (FontSizeCssFontSize a) = emitXml a
parseFontSize :: String -> P.XParse FontSize
parseFontSize s = 
      FontSizeDecimal
        <$> (P.xread "Decimal") s
      <|> FontSizeCssFontSize
        <$> parseCssFontSize s


-- | @font-style@ /(simple)/
--
-- The font-style type represents a simplified version of the CSS font-style property.
data FontStyle = 
      FontStyleNormal -- ^ /normal/
    | FontStyleItalic -- ^ /italic/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml FontStyle where
    emitXml FontStyleNormal = XLit "normal"
    emitXml FontStyleItalic = XLit "italic"
parseFontStyle :: String -> P.XParse FontStyle
parseFontStyle s
        | s == "normal" = return $ FontStyleNormal
        | s == "italic" = return $ FontStyleItalic
        | otherwise = P.xfail $ "FontStyle: " ++ s

-- | @font-weight@ /(simple)/
--
-- The font-weight type represents a simplified version of the CSS font-weight property.
data FontWeight = 
      FontWeightNormal -- ^ /normal/
    | FontWeightBold -- ^ /bold/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml FontWeight where
    emitXml FontWeightNormal = XLit "normal"
    emitXml FontWeightBold = XLit "bold"
parseFontWeight :: String -> P.XParse FontWeight
parseFontWeight s
        | s == "normal" = return $ FontWeightNormal
        | s == "bold" = return $ FontWeightBold
        | otherwise = P.xfail $ "FontWeight: " ++ s

-- | @group-barline-value@ /(simple)/
--
-- The group-barline-value type indicates if the group should have common barlines.
data GroupBarlineValue = 
      GroupBarlineValueYes -- ^ /yes/
    | GroupBarlineValueNo -- ^ /no/
    | GroupBarlineValueMensurstrich -- ^ /Mensurstrich/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml GroupBarlineValue where
    emitXml GroupBarlineValueYes = XLit "yes"
    emitXml GroupBarlineValueNo = XLit "no"
    emitXml GroupBarlineValueMensurstrich = XLit "Mensurstrich"
parseGroupBarlineValue :: String -> P.XParse GroupBarlineValue
parseGroupBarlineValue s
        | s == "yes" = return $ GroupBarlineValueYes
        | s == "no" = return $ GroupBarlineValueNo
        | s == "Mensurstrich" = return $ GroupBarlineValueMensurstrich
        | otherwise = P.xfail $ "GroupBarlineValue: " ++ s

-- | @group-symbol-value@ /(simple)/
--
-- The group-symbol-value type indicates how the symbol for a group is indicated in the score. The default value is none.
data GroupSymbolValue = 
      GroupSymbolValueNone -- ^ /none/
    | GroupSymbolValueBrace -- ^ /brace/
    | GroupSymbolValueLine -- ^ /line/
    | GroupSymbolValueBracket -- ^ /bracket/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml GroupSymbolValue where
    emitXml GroupSymbolValueNone = XLit "none"
    emitXml GroupSymbolValueBrace = XLit "brace"
    emitXml GroupSymbolValueLine = XLit "line"
    emitXml GroupSymbolValueBracket = XLit "bracket"
parseGroupSymbolValue :: String -> P.XParse GroupSymbolValue
parseGroupSymbolValue s
        | s == "none" = return $ GroupSymbolValueNone
        | s == "brace" = return $ GroupSymbolValueBrace
        | s == "line" = return $ GroupSymbolValueLine
        | s == "bracket" = return $ GroupSymbolValueBracket
        | otherwise = P.xfail $ "GroupSymbolValue: " ++ s

-- | @harmony-type@ /(simple)/
--
-- The harmony-type type differentiates different types of harmonies when alternate harmonies are possible. Explicit harmonies have all note present in the music; implied have some notes missing but implied; alternate represents alternate analyses.
data HarmonyType = 
      HarmonyTypeExplicit -- ^ /explicit/
    | HarmonyTypeImplied -- ^ /implied/
    | HarmonyTypeAlternate -- ^ /alternate/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml HarmonyType where
    emitXml HarmonyTypeExplicit = XLit "explicit"
    emitXml HarmonyTypeImplied = XLit "implied"
    emitXml HarmonyTypeAlternate = XLit "alternate"
parseHarmonyType :: String -> P.XParse HarmonyType
parseHarmonyType s
        | s == "explicit" = return $ HarmonyTypeExplicit
        | s == "implied" = return $ HarmonyTypeImplied
        | s == "alternate" = return $ HarmonyTypeAlternate
        | otherwise = P.xfail $ "HarmonyType: " ++ s

-- | @kind-value@ /(simple)/
--
-- A kind-value indicates the type of chord. Degree elements can then add, subtract, or alter from these starting points. Values include:
--
-- @
-- 	
-- Triads:
-- 	major (major third, perfect fifth)
-- 	minor (minor third, perfect fifth)
-- 	augmented (major third, augmented fifth)
-- 	diminished (minor third, diminished fifth)
-- Sevenths:
-- 	dominant (major triad, minor seventh)
-- 	major-seventh (major triad, major seventh)
-- 	minor-seventh (minor triad, minor seventh)
-- 	diminished-seventh (diminished triad, diminished seventh)
-- 	augmented-seventh (augmented triad, minor seventh)
-- 	half-diminished (diminished triad, minor seventh)
-- 	major-minor (minor triad, major seventh)
-- Sixths:
-- 	major-sixth (major triad, added sixth)
-- 	minor-sixth (minor triad, added sixth)
-- Ninths:
-- 	dominant-ninth (dominant-seventh, major ninth)
-- 	major-ninth (major-seventh, major ninth)
-- 	minor-ninth (minor-seventh, major ninth)
-- 11ths (usually as the basis for alteration):
-- 	dominant-11th (dominant-ninth, perfect 11th)
-- 	major-11th (major-ninth, perfect 11th)
-- 	minor-11th (minor-ninth, perfect 11th)
-- 13ths (usually as the basis for alteration):
-- 	dominant-13th (dominant-11th, major 13th)
-- 	major-13th (major-11th, major 13th)
-- 	minor-13th (minor-11th, major 13th)
-- Suspended:
-- 	suspended-second (major second, perfect fifth)
-- 	suspended-fourth (perfect fourth, perfect fifth)
-- Functional sixths:
-- 	Neapolitan
-- 	Italian
-- 	French
-- 	German
-- Other:
-- 	pedal (pedal-point bass)
-- 	power (perfect fifth)
-- 	Tristan
-- 	
-- The "other" kind is used when the harmony is entirely composed of add elements. The "none" kind is used to explicitly encode absence of chords or functional harmony.
-- @
data KindValue = 
      KindValueMajor -- ^ /major/
    | KindValueMinor -- ^ /minor/
    | KindValueAugmented -- ^ /augmented/
    | KindValueDiminished -- ^ /diminished/
    | KindValueDominant -- ^ /dominant/
    | KindValueMajorSeventh -- ^ /major-seventh/
    | KindValueMinorSeventh -- ^ /minor-seventh/
    | KindValueDiminishedSeventh -- ^ /diminished-seventh/
    | KindValueAugmentedSeventh -- ^ /augmented-seventh/
    | KindValueHalfDiminished -- ^ /half-diminished/
    | KindValueMajorMinor -- ^ /major-minor/
    | KindValueMajorSixth -- ^ /major-sixth/
    | KindValueMinorSixth -- ^ /minor-sixth/
    | KindValueDominantNinth -- ^ /dominant-ninth/
    | KindValueMajorNinth -- ^ /major-ninth/
    | KindValueMinorNinth -- ^ /minor-ninth/
    | KindValueDominant11th -- ^ /dominant-11th/
    | KindValueMajor11th -- ^ /major-11th/
    | KindValueMinor11th -- ^ /minor-11th/
    | KindValueDominant13th -- ^ /dominant-13th/
    | KindValueMajor13th -- ^ /major-13th/
    | KindValueMinor13th -- ^ /minor-13th/
    | KindValueSuspendedSecond -- ^ /suspended-second/
    | KindValueSuspendedFourth -- ^ /suspended-fourth/
    | KindValueNeapolitan -- ^ /Neapolitan/
    | KindValueItalian -- ^ /Italian/
    | KindValueFrench -- ^ /French/
    | KindValueGerman -- ^ /German/
    | KindValuePedal -- ^ /pedal/
    | KindValuePower -- ^ /power/
    | KindValueTristan -- ^ /Tristan/
    | KindValueOther -- ^ /other/
    | KindValueNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml KindValue where
    emitXml KindValueMajor = XLit "major"
    emitXml KindValueMinor = XLit "minor"
    emitXml KindValueAugmented = XLit "augmented"
    emitXml KindValueDiminished = XLit "diminished"
    emitXml KindValueDominant = XLit "dominant"
    emitXml KindValueMajorSeventh = XLit "major-seventh"
    emitXml KindValueMinorSeventh = XLit "minor-seventh"
    emitXml KindValueDiminishedSeventh = XLit "diminished-seventh"
    emitXml KindValueAugmentedSeventh = XLit "augmented-seventh"
    emitXml KindValueHalfDiminished = XLit "half-diminished"
    emitXml KindValueMajorMinor = XLit "major-minor"
    emitXml KindValueMajorSixth = XLit "major-sixth"
    emitXml KindValueMinorSixth = XLit "minor-sixth"
    emitXml KindValueDominantNinth = XLit "dominant-ninth"
    emitXml KindValueMajorNinth = XLit "major-ninth"
    emitXml KindValueMinorNinth = XLit "minor-ninth"
    emitXml KindValueDominant11th = XLit "dominant-11th"
    emitXml KindValueMajor11th = XLit "major-11th"
    emitXml KindValueMinor11th = XLit "minor-11th"
    emitXml KindValueDominant13th = XLit "dominant-13th"
    emitXml KindValueMajor13th = XLit "major-13th"
    emitXml KindValueMinor13th = XLit "minor-13th"
    emitXml KindValueSuspendedSecond = XLit "suspended-second"
    emitXml KindValueSuspendedFourth = XLit "suspended-fourth"
    emitXml KindValueNeapolitan = XLit "Neapolitan"
    emitXml KindValueItalian = XLit "Italian"
    emitXml KindValueFrench = XLit "French"
    emitXml KindValueGerman = XLit "German"
    emitXml KindValuePedal = XLit "pedal"
    emitXml KindValuePower = XLit "power"
    emitXml KindValueTristan = XLit "Tristan"
    emitXml KindValueOther = XLit "other"
    emitXml KindValueNone = XLit "none"
parseKindValue :: String -> P.XParse KindValue
parseKindValue s
        | s == "major" = return $ KindValueMajor
        | s == "minor" = return $ KindValueMinor
        | s == "augmented" = return $ KindValueAugmented
        | s == "diminished" = return $ KindValueDiminished
        | s == "dominant" = return $ KindValueDominant
        | s == "major-seventh" = return $ KindValueMajorSeventh
        | s == "minor-seventh" = return $ KindValueMinorSeventh
        | s == "diminished-seventh" = return $ KindValueDiminishedSeventh
        | s == "augmented-seventh" = return $ KindValueAugmentedSeventh
        | s == "half-diminished" = return $ KindValueHalfDiminished
        | s == "major-minor" = return $ KindValueMajorMinor
        | s == "major-sixth" = return $ KindValueMajorSixth
        | s == "minor-sixth" = return $ KindValueMinorSixth
        | s == "dominant-ninth" = return $ KindValueDominantNinth
        | s == "major-ninth" = return $ KindValueMajorNinth
        | s == "minor-ninth" = return $ KindValueMinorNinth
        | s == "dominant-11th" = return $ KindValueDominant11th
        | s == "major-11th" = return $ KindValueMajor11th
        | s == "minor-11th" = return $ KindValueMinor11th
        | s == "dominant-13th" = return $ KindValueDominant13th
        | s == "major-13th" = return $ KindValueMajor13th
        | s == "minor-13th" = return $ KindValueMinor13th
        | s == "suspended-second" = return $ KindValueSuspendedSecond
        | s == "suspended-fourth" = return $ KindValueSuspendedFourth
        | s == "Neapolitan" = return $ KindValueNeapolitan
        | s == "Italian" = return $ KindValueItalian
        | s == "French" = return $ KindValueFrench
        | s == "German" = return $ KindValueGerman
        | s == "pedal" = return $ KindValuePedal
        | s == "power" = return $ KindValuePower
        | s == "Tristan" = return $ KindValueTristan
        | s == "other" = return $ KindValueOther
        | s == "none" = return $ KindValueNone
        | otherwise = P.xfail $ "KindValue: " ++ s

-- | @xml:lang@ /(simple)/
data Lang = 
      LangLanguage {
          lang1 :: Language
       }
    | LangLang {
          lang2 :: SumLang
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Lang where
    emitXml (LangLanguage a) = emitXml a
    emitXml (LangLang a) = emitXml a
parseLang :: String -> P.XParse Lang
parseLang s = 
      LangLanguage
        <$> parseLanguage s
      <|> LangLang
        <$> parseSumLang s


-- | @xs:language@ /(simple)/
newtype Language = Language { language :: Token }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show Language where show (Language a) = show a
instance Read Language where readsPrec i = map (A.first Language) . readsPrec i
instance EmitXml Language where
    emitXml = emitXml . language
parseLanguage :: String -> P.XParse Language
parseLanguage = return . fromString

-- | @left-center-right@ /(simple)/
--
-- The left-center-right type is used to define horizontal alignment and text justification.
data LeftCenterRight = 
      LeftCenterRightLeft -- ^ /left/
    | LeftCenterRightCenter -- ^ /center/
    | LeftCenterRightRight -- ^ /right/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml LeftCenterRight where
    emitXml LeftCenterRightLeft = XLit "left"
    emitXml LeftCenterRightCenter = XLit "center"
    emitXml LeftCenterRightRight = XLit "right"
parseLeftCenterRight :: String -> P.XParse LeftCenterRight
parseLeftCenterRight s
        | s == "left" = return $ LeftCenterRightLeft
        | s == "center" = return $ LeftCenterRightCenter
        | s == "right" = return $ LeftCenterRightRight
        | otherwise = P.xfail $ "LeftCenterRight: " ++ s

-- | @left-right@ /(simple)/
--
-- The left-right type is used to indicate whether one element appears to the left or the right of another element.
data LeftRight = 
      LeftRightLeft -- ^ /left/
    | LeftRightRight -- ^ /right/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml LeftRight where
    emitXml LeftRightLeft = XLit "left"
    emitXml LeftRightRight = XLit "right"
parseLeftRight :: String -> P.XParse LeftRight
parseLeftRight s
        | s == "left" = return $ LeftRightLeft
        | s == "right" = return $ LeftRightRight
        | otherwise = P.xfail $ "LeftRight: " ++ s

-- | @line-end@ /(simple)/
--
-- The line-end type specifies if there is a jog up or down (or both), an arrow, or nothing at the start or end of a bracket.
data LineEnd = 
      LineEndUp -- ^ /up/
    | LineEndDown -- ^ /down/
    | LineEndBoth -- ^ /both/
    | LineEndArrow -- ^ /arrow/
    | LineEndNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml LineEnd where
    emitXml LineEndUp = XLit "up"
    emitXml LineEndDown = XLit "down"
    emitXml LineEndBoth = XLit "both"
    emitXml LineEndArrow = XLit "arrow"
    emitXml LineEndNone = XLit "none"
parseLineEnd :: String -> P.XParse LineEnd
parseLineEnd s
        | s == "up" = return $ LineEndUp
        | s == "down" = return $ LineEndDown
        | s == "both" = return $ LineEndBoth
        | s == "arrow" = return $ LineEndArrow
        | s == "none" = return $ LineEndNone
        | otherwise = P.xfail $ "LineEnd: " ++ s

-- | @line-shape@ /(simple)/
--
-- The line-shape type distinguishes between straight and curved lines.
data LineShape = 
      LineShapeStraight -- ^ /straight/
    | LineShapeCurved -- ^ /curved/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml LineShape where
    emitXml LineShapeStraight = XLit "straight"
    emitXml LineShapeCurved = XLit "curved"
parseLineShape :: String -> P.XParse LineShape
parseLineShape s
        | s == "straight" = return $ LineShapeStraight
        | s == "curved" = return $ LineShapeCurved
        | otherwise = P.xfail $ "LineShape: " ++ s

-- | @line-type@ /(simple)/
--
-- The line-type type distinguishes between solid, dashed, dotted, and wavy lines.
data LineType = 
      LineTypeSolid -- ^ /solid/
    | LineTypeDashed -- ^ /dashed/
    | LineTypeDotted -- ^ /dotted/
    | LineTypeWavy -- ^ /wavy/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml LineType where
    emitXml LineTypeSolid = XLit "solid"
    emitXml LineTypeDashed = XLit "dashed"
    emitXml LineTypeDotted = XLit "dotted"
    emitXml LineTypeWavy = XLit "wavy"
parseLineType :: String -> P.XParse LineType
parseLineType s
        | s == "solid" = return $ LineTypeSolid
        | s == "dashed" = return $ LineTypeDashed
        | s == "dotted" = return $ LineTypeDotted
        | s == "wavy" = return $ LineTypeWavy
        | otherwise = P.xfail $ "LineType: " ++ s

-- | @line-width-type@ /(simple)/
--
-- The line-width-type defines what type of line is being defined in a line-width element. Values include beam, bracket, dashes, enclosure, ending, extend, heavy barline, leger, light barline, octave shift, pedal, slur middle, slur tip, staff, stem, tie middle, tie tip, tuplet bracket, and wedge. This is left as a string so that other application-specific types can be defined, but it is made a separate type so that it can be redefined more strictly.
newtype LineWidthType = LineWidthType { lineWidthType :: Token }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show LineWidthType where show (LineWidthType a) = show a
instance Read LineWidthType where readsPrec i = map (A.first LineWidthType) . readsPrec i
instance EmitXml LineWidthType where
    emitXml = emitXml . lineWidthType
parseLineWidthType :: String -> P.XParse LineWidthType
parseLineWidthType = return . fromString

-- | @margin-type@ /(simple)/
--
-- The margin-type type specifies whether margins apply to even page, odd pages, or both.
data MarginType = 
      MarginTypeOdd -- ^ /odd/
    | MarginTypeEven -- ^ /even/
    | MarginTypeBoth -- ^ /both/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml MarginType where
    emitXml MarginTypeOdd = XLit "odd"
    emitXml MarginTypeEven = XLit "even"
    emitXml MarginTypeBoth = XLit "both"
parseMarginType :: String -> P.XParse MarginType
parseMarginType s
        | s == "odd" = return $ MarginTypeOdd
        | s == "even" = return $ MarginTypeEven
        | s == "both" = return $ MarginTypeBoth
        | otherwise = P.xfail $ "MarginType: " ++ s

-- | @measure-numbering-value@ /(simple)/
--
-- The measure-numbering-value type describes how measure numbers are displayed on this part: no numbers, numbers every measure, or numbers every system.
data MeasureNumberingValue = 
      MeasureNumberingValueNone -- ^ /none/
    | MeasureNumberingValueMeasure -- ^ /measure/
    | MeasureNumberingValueSystem -- ^ /system/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml MeasureNumberingValue where
    emitXml MeasureNumberingValueNone = XLit "none"
    emitXml MeasureNumberingValueMeasure = XLit "measure"
    emitXml MeasureNumberingValueSystem = XLit "system"
parseMeasureNumberingValue :: String -> P.XParse MeasureNumberingValue
parseMeasureNumberingValue s
        | s == "none" = return $ MeasureNumberingValueNone
        | s == "measure" = return $ MeasureNumberingValueMeasure
        | s == "system" = return $ MeasureNumberingValueSystem
        | otherwise = P.xfail $ "MeasureNumberingValue: " ++ s

-- | @midi-128@ /(simple)/
--
-- The midi-16 type is used to express MIDI 1.0 values that range from 1 to 128.
newtype Midi128 = Midi128 { midi128 :: PositiveInteger }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show Midi128 where show (Midi128 a) = show a
instance Read Midi128 where readsPrec i = map (A.first Midi128) . readsPrec i
instance EmitXml Midi128 where
    emitXml = emitXml . midi128
parseMidi128 :: String -> P.XParse Midi128
parseMidi128 = P.xread "Midi128"

-- | @midi-16@ /(simple)/
--
-- The midi-16 type is used to express MIDI 1.0 values that range from 1 to 16.
newtype Midi16 = Midi16 { midi16 :: PositiveInteger }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show Midi16 where show (Midi16 a) = show a
instance Read Midi16 where readsPrec i = map (A.first Midi16) . readsPrec i
instance EmitXml Midi16 where
    emitXml = emitXml . midi16
parseMidi16 :: String -> P.XParse Midi16
parseMidi16 = P.xread "Midi16"

-- | @midi-16384@ /(simple)/
--
-- The midi-16 type is used to express MIDI 1.0 values that range from 1 to 16,384.
newtype Midi16384 = Midi16384 { midi16384 :: PositiveInteger }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show Midi16384 where show (Midi16384 a) = show a
instance Read Midi16384 where readsPrec i = map (A.first Midi16384) . readsPrec i
instance EmitXml Midi16384 where
    emitXml = emitXml . midi16384
parseMidi16384 :: String -> P.XParse Midi16384
parseMidi16384 = P.xread "Midi16384"

-- | @millimeters@ /(simple)/
--
-- The millimeters type is a number representing millimeters. This is used in the scaling element to provide a default scaling from tenths to physical units.
newtype Millimeters = Millimeters { millimeters :: Decimal }
    deriving (Eq,Typeable,Generic,Ord,Num,Real,Fractional,RealFrac)
instance Show Millimeters where show (Millimeters a) = show a
instance Read Millimeters where readsPrec i = map (A.first Millimeters) . readsPrec i
instance EmitXml Millimeters where
    emitXml = emitXml . millimeters
parseMillimeters :: String -> P.XParse Millimeters
parseMillimeters = P.xread "Millimeters"

-- | @mode@ /(simple)/
--
-- The mode type is used to specify major/minor and other mode distinctions. Valid mode values include major, minor, dorian, phrygian, lydian, mixolydian, aeolian, ionian, and locrian.
newtype Mode = Mode { mode :: String }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show Mode where show (Mode a) = show a
instance Read Mode where readsPrec i = map (A.first Mode) . readsPrec i
instance EmitXml Mode where
    emitXml = emitXml . mode
parseMode :: String -> P.XParse Mode
parseMode = return . fromString

-- | @non-negative-decimal@ /(simple)/
--
-- The non-negative-decimal type specifies a non-negative decimal value.
newtype NonNegativeDecimal = NonNegativeDecimal { nonNegativeDecimal :: Decimal }
    deriving (Eq,Typeable,Generic,Ord,Num,Real,Fractional,RealFrac)
instance Show NonNegativeDecimal where show (NonNegativeDecimal a) = show a
instance Read NonNegativeDecimal where readsPrec i = map (A.first NonNegativeDecimal) . readsPrec i
instance EmitXml NonNegativeDecimal where
    emitXml = emitXml . nonNegativeDecimal
parseNonNegativeDecimal :: String -> P.XParse NonNegativeDecimal
parseNonNegativeDecimal = P.xread "NonNegativeDecimal"

-- | @xs:nonNegativeInteger@ /(simple)/
newtype NonNegativeInteger = NonNegativeInteger { nonNegativeInteger :: Int }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show NonNegativeInteger where show (NonNegativeInteger a) = show a
instance Read NonNegativeInteger where readsPrec i = map (A.first NonNegativeInteger) . readsPrec i
instance EmitXml NonNegativeInteger where
    emitXml = emitXml . nonNegativeInteger
parseNonNegativeInteger :: String -> P.XParse NonNegativeInteger
parseNonNegativeInteger = P.xread "NonNegativeInteger"

-- | @xs:normalizedString@ /(simple)/
newtype NormalizedString = NormalizedString { normalizedString :: String }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show NormalizedString where show (NormalizedString a) = show a
instance Read NormalizedString where readsPrec i = map (A.first NormalizedString) . readsPrec i
instance EmitXml NormalizedString where
    emitXml = emitXml . normalizedString
parseNormalizedString :: String -> P.XParse NormalizedString
parseNormalizedString = return . fromString

-- | @note-size-type@ /(simple)/
--
-- The note-size-type type indicates the type of note being defined by a note-size element. The grace type is used for notes of cue size that that include a grace element. The cue type is used for all other notes with cue size, whether defined explicitly or implicitly via a cue element. The large type is used for notes of large size.
data NoteSizeType = 
      NoteSizeTypeCue -- ^ /cue/
    | NoteSizeTypeGrace -- ^ /grace/
    | NoteSizeTypeLarge -- ^ /large/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml NoteSizeType where
    emitXml NoteSizeTypeCue = XLit "cue"
    emitXml NoteSizeTypeGrace = XLit "grace"
    emitXml NoteSizeTypeLarge = XLit "large"
parseNoteSizeType :: String -> P.XParse NoteSizeType
parseNoteSizeType s
        | s == "cue" = return $ NoteSizeTypeCue
        | s == "grace" = return $ NoteSizeTypeGrace
        | s == "large" = return $ NoteSizeTypeLarge
        | otherwise = P.xfail $ "NoteSizeType: " ++ s

-- | @note-type-value@ /(simple)/
--
-- The note-type type is used for the MusicXML type element and represents the graphic note type, from 256th (shortest) to long (longest).
data NoteTypeValue = 
      NoteTypeValue256th -- ^ /256th/
    | NoteTypeValue128th -- ^ /128th/
    | NoteTypeValue64th -- ^ /64th/
    | NoteTypeValue32nd -- ^ /32nd/
    | NoteTypeValue16th -- ^ /16th/
    | NoteTypeValueEighth -- ^ /eighth/
    | NoteTypeValueQuarter -- ^ /quarter/
    | NoteTypeValueHalf -- ^ /half/
    | NoteTypeValueWhole -- ^ /whole/
    | NoteTypeValueBreve -- ^ /breve/
    | NoteTypeValueLong -- ^ /long/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml NoteTypeValue where
    emitXml NoteTypeValue256th = XLit "256th"
    emitXml NoteTypeValue128th = XLit "128th"
    emitXml NoteTypeValue64th = XLit "64th"
    emitXml NoteTypeValue32nd = XLit "32nd"
    emitXml NoteTypeValue16th = XLit "16th"
    emitXml NoteTypeValueEighth = XLit "eighth"
    emitXml NoteTypeValueQuarter = XLit "quarter"
    emitXml NoteTypeValueHalf = XLit "half"
    emitXml NoteTypeValueWhole = XLit "whole"
    emitXml NoteTypeValueBreve = XLit "breve"
    emitXml NoteTypeValueLong = XLit "long"
parseNoteTypeValue :: String -> P.XParse NoteTypeValue
parseNoteTypeValue s
        | s == "256th" = return $ NoteTypeValue256th
        | s == "128th" = return $ NoteTypeValue128th
        | s == "64th" = return $ NoteTypeValue64th
        | s == "32nd" = return $ NoteTypeValue32nd
        | s == "16th" = return $ NoteTypeValue16th
        | s == "eighth" = return $ NoteTypeValueEighth
        | s == "quarter" = return $ NoteTypeValueQuarter
        | s == "half" = return $ NoteTypeValueHalf
        | s == "whole" = return $ NoteTypeValueWhole
        | s == "breve" = return $ NoteTypeValueBreve
        | s == "long" = return $ NoteTypeValueLong
        | otherwise = P.xfail $ "NoteTypeValue: " ++ s

-- | @notehead-value@ /(simple)/
--
-- 
-- The notehead type indicates shapes other than the open and closed ovals associated with note durations. The values do, re, mi, fa, so, la, and ti correspond to Aikin's 7-shape system.
-- 
-- The arrow shapes differ from triangle and inverted triangle by being centered on the stem. Slashed and back slashed notes include both the normal notehead and a slash. The triangle shape has the tip of the triangle pointing up; the inverted triangle shape has the tip of the triangle pointing down.
data NoteheadValue = 
      NoteheadValueSlash -- ^ /slash/
    | NoteheadValueTriangle -- ^ /triangle/
    | NoteheadValueDiamond -- ^ /diamond/
    | NoteheadValueSquare -- ^ /square/
    | NoteheadValueCross -- ^ /cross/
    | NoteheadValueX -- ^ /x/
    | NoteheadValueCircleX -- ^ /circle-x/
    | NoteheadValueInvertedTriangle -- ^ /inverted triangle/
    | NoteheadValueArrowDown -- ^ /arrow down/
    | NoteheadValueArrowUp -- ^ /arrow up/
    | NoteheadValueSlashed -- ^ /slashed/
    | NoteheadValueBackSlashed -- ^ /back slashed/
    | NoteheadValueNormal -- ^ /normal/
    | NoteheadValueCluster -- ^ /cluster/
    | NoteheadValueNone -- ^ /none/
    | NoteheadValueDo -- ^ /do/
    | NoteheadValueRe -- ^ /re/
    | NoteheadValueMi -- ^ /mi/
    | NoteheadValueFa -- ^ /fa/
    | NoteheadValueSo -- ^ /so/
    | NoteheadValueLa -- ^ /la/
    | NoteheadValueTi -- ^ /ti/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml NoteheadValue where
    emitXml NoteheadValueSlash = XLit "slash"
    emitXml NoteheadValueTriangle = XLit "triangle"
    emitXml NoteheadValueDiamond = XLit "diamond"
    emitXml NoteheadValueSquare = XLit "square"
    emitXml NoteheadValueCross = XLit "cross"
    emitXml NoteheadValueX = XLit "x"
    emitXml NoteheadValueCircleX = XLit "circle-x"
    emitXml NoteheadValueInvertedTriangle = XLit "inverted triangle"
    emitXml NoteheadValueArrowDown = XLit "arrow down"
    emitXml NoteheadValueArrowUp = XLit "arrow up"
    emitXml NoteheadValueSlashed = XLit "slashed"
    emitXml NoteheadValueBackSlashed = XLit "back slashed"
    emitXml NoteheadValueNormal = XLit "normal"
    emitXml NoteheadValueCluster = XLit "cluster"
    emitXml NoteheadValueNone = XLit "none"
    emitXml NoteheadValueDo = XLit "do"
    emitXml NoteheadValueRe = XLit "re"
    emitXml NoteheadValueMi = XLit "mi"
    emitXml NoteheadValueFa = XLit "fa"
    emitXml NoteheadValueSo = XLit "so"
    emitXml NoteheadValueLa = XLit "la"
    emitXml NoteheadValueTi = XLit "ti"
parseNoteheadValue :: String -> P.XParse NoteheadValue
parseNoteheadValue s
        | s == "slash" = return $ NoteheadValueSlash
        | s == "triangle" = return $ NoteheadValueTriangle
        | s == "diamond" = return $ NoteheadValueDiamond
        | s == "square" = return $ NoteheadValueSquare
        | s == "cross" = return $ NoteheadValueCross
        | s == "x" = return $ NoteheadValueX
        | s == "circle-x" = return $ NoteheadValueCircleX
        | s == "inverted triangle" = return $ NoteheadValueInvertedTriangle
        | s == "arrow down" = return $ NoteheadValueArrowDown
        | s == "arrow up" = return $ NoteheadValueArrowUp
        | s == "slashed" = return $ NoteheadValueSlashed
        | s == "back slashed" = return $ NoteheadValueBackSlashed
        | s == "normal" = return $ NoteheadValueNormal
        | s == "cluster" = return $ NoteheadValueCluster
        | s == "none" = return $ NoteheadValueNone
        | s == "do" = return $ NoteheadValueDo
        | s == "re" = return $ NoteheadValueRe
        | s == "mi" = return $ NoteheadValueMi
        | s == "fa" = return $ NoteheadValueFa
        | s == "so" = return $ NoteheadValueSo
        | s == "la" = return $ NoteheadValueLa
        | s == "ti" = return $ NoteheadValueTi
        | otherwise = P.xfail $ "NoteheadValue: " ++ s

-- | @number-level@ /(simple)/
--
-- Slurs, tuplets, and many other features can be concurrent and overlapping within a single musical part. The number-level type distinguishes up to six concurrent objects of the same type. A reading program should be prepared to handle cases where the number-levels stop in an arbitrary order. Different numbers are needed when the features overlap in MusicXML file order. When a number-level value is implied, the value is 1 by default.
newtype NumberLevel = NumberLevel { numberLevel :: PositiveInteger }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show NumberLevel where show (NumberLevel a) = show a
instance Read NumberLevel where readsPrec i = map (A.first NumberLevel) . readsPrec i
instance EmitXml NumberLevel where
    emitXml = emitXml . numberLevel
parseNumberLevel :: String -> P.XParse NumberLevel
parseNumberLevel = P.xread "NumberLevel"

-- | @number-of-lines@ /(simple)/
--
-- The number-of-lines type is used to specify the number of lines in text decoration attributes.
newtype NumberOfLines = NumberOfLines { numberOfLines :: NonNegativeInteger }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show NumberOfLines where show (NumberOfLines a) = show a
instance Read NumberOfLines where readsPrec i = map (A.first NumberOfLines) . readsPrec i
instance EmitXml NumberOfLines where
    emitXml = emitXml . numberOfLines
parseNumberOfLines :: String -> P.XParse NumberOfLines
parseNumberOfLines = P.xread "NumberOfLines"

-- | @number-or-normal@ /(simple)/
--
-- The number-or-normal values can be either a decimal number or the string "normal". This is used by the line-height and letter-spacing attributes.
data NumberOrNormal = 
      NumberOrNormalDecimal {
          numberOrNormal1 :: Decimal
       }
    | NumberOrNormalNumberOrNormal {
          numberOrNormal2 :: SumNumberOrNormal
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml NumberOrNormal where
    emitXml (NumberOrNormalDecimal a) = emitXml a
    emitXml (NumberOrNormalNumberOrNormal a) = emitXml a
parseNumberOrNormal :: String -> P.XParse NumberOrNormal
parseNumberOrNormal s = 
      NumberOrNormalDecimal
        <$> (P.xread "Decimal") s
      <|> NumberOrNormalNumberOrNormal
        <$> parseSumNumberOrNormal s


-- | @octave@ /(simple)/
--
-- Octaves are represented by the numbers 0 to 9, where 4 indicates the octave started by middle C.
newtype Octave = Octave { octave :: Int }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show Octave where show (Octave a) = show a
instance Read Octave where readsPrec i = map (A.first Octave) . readsPrec i
instance EmitXml Octave where
    emitXml = emitXml . octave
parseOctave :: String -> P.XParse Octave
parseOctave = P.xread "Octave"

-- | @over-under@ /(simple)/
--
-- The over-under type is used to indicate whether the tips of curved lines such as slurs and ties are overhand (tips down) or underhand (tips up).
data OverUnder = 
      OverUnderOver -- ^ /over/
    | OverUnderUnder -- ^ /under/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml OverUnder where
    emitXml OverUnderOver = XLit "over"
    emitXml OverUnderUnder = XLit "under"
parseOverUnder :: String -> P.XParse OverUnder
parseOverUnder s
        | s == "over" = return $ OverUnderOver
        | s == "under" = return $ OverUnderUnder
        | otherwise = P.xfail $ "OverUnder: " ++ s

-- | @percent@ /(simple)/
--
-- The percent type specifies a percentage from 0 to 100.
newtype Percent = Percent { percent :: Decimal }
    deriving (Eq,Typeable,Generic,Ord,Num,Real,Fractional,RealFrac)
instance Show Percent where show (Percent a) = show a
instance Read Percent where readsPrec i = map (A.first Percent) . readsPrec i
instance EmitXml Percent where
    emitXml = emitXml . percent
parsePercent :: String -> P.XParse Percent
parsePercent = P.xread "Percent"

-- | @positive-divisions@ /(simple)/
--
-- The positive-divisions type restricts divisions values to positive numbers.
newtype PositiveDivisions = PositiveDivisions { positiveDivisions :: Divisions }
    deriving (Eq,Typeable,Generic,Ord,Num,Real,Fractional,RealFrac)
instance Show PositiveDivisions where show (PositiveDivisions a) = show a
instance Read PositiveDivisions where readsPrec i = map (A.first PositiveDivisions) . readsPrec i
instance EmitXml PositiveDivisions where
    emitXml = emitXml . positiveDivisions
parsePositiveDivisions :: String -> P.XParse PositiveDivisions
parsePositiveDivisions = P.xread "PositiveDivisions"

-- | @positive-integer-or-empty@ /(simple)/
--
-- The positive-integer-or-empty values can be either a positive integer or an empty string.
data PositiveIntegerOrEmpty = 
      PositiveIntegerOrEmptyPositiveInteger {
          positiveIntegerOrEmpty1 :: PositiveInteger
       }
    | PositiveIntegerOrEmptyPositiveIntegerOrEmpty {
          positiveIntegerOrEmpty2 :: SumPositiveIntegerOrEmpty
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml PositiveIntegerOrEmpty where
    emitXml (PositiveIntegerOrEmptyPositiveInteger a) = emitXml a
    emitXml (PositiveIntegerOrEmptyPositiveIntegerOrEmpty a) = emitXml a
parsePositiveIntegerOrEmpty :: String -> P.XParse PositiveIntegerOrEmpty
parsePositiveIntegerOrEmpty s = 
      PositiveIntegerOrEmptyPositiveInteger
        <$> parsePositiveInteger s
      <|> PositiveIntegerOrEmptyPositiveIntegerOrEmpty
        <$> parseSumPositiveIntegerOrEmpty s


-- | @xs:positiveInteger@ /(simple)/
newtype PositiveInteger = PositiveInteger { positiveInteger :: NonNegativeInteger }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show PositiveInteger where show (PositiveInteger a) = show a
instance Read PositiveInteger where readsPrec i = map (A.first PositiveInteger) . readsPrec i
instance EmitXml PositiveInteger where
    emitXml = emitXml . positiveInteger
parsePositiveInteger :: String -> P.XParse PositiveInteger
parsePositiveInteger = P.xread "PositiveInteger"

-- | @rehearsal-enclosure@ /(simple)/
--
-- The rehearsal-enclosure type describes the shape and presence / absence of an enclosure around rehearsal text.
data RehearsalEnclosure = 
      RehearsalEnclosureSquare -- ^ /square/
    | RehearsalEnclosureCircle -- ^ /circle/
    | RehearsalEnclosureNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml RehearsalEnclosure where
    emitXml RehearsalEnclosureSquare = XLit "square"
    emitXml RehearsalEnclosureCircle = XLit "circle"
    emitXml RehearsalEnclosureNone = XLit "none"
parseRehearsalEnclosure :: String -> P.XParse RehearsalEnclosure
parseRehearsalEnclosure s
        | s == "square" = return $ RehearsalEnclosureSquare
        | s == "circle" = return $ RehearsalEnclosureCircle
        | s == "none" = return $ RehearsalEnclosureNone
        | otherwise = P.xfail $ "RehearsalEnclosure: " ++ s

-- | @right-left-middle@ /(simple)/
--
-- The right-left-middle type is used to specify barline location.
data RightLeftMiddle = 
      RightLeftMiddleRight -- ^ /right/
    | RightLeftMiddleLeft -- ^ /left/
    | RightLeftMiddleMiddle -- ^ /middle/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml RightLeftMiddle where
    emitXml RightLeftMiddleRight = XLit "right"
    emitXml RightLeftMiddleLeft = XLit "left"
    emitXml RightLeftMiddleMiddle = XLit "middle"
parseRightLeftMiddle :: String -> P.XParse RightLeftMiddle
parseRightLeftMiddle s
        | s == "right" = return $ RightLeftMiddleRight
        | s == "left" = return $ RightLeftMiddleLeft
        | s == "middle" = return $ RightLeftMiddleMiddle
        | otherwise = P.xfail $ "RightLeftMiddle: " ++ s

-- | @rotation-degrees@ /(simple)/
--
-- The rotation-degrees type specifies rotation, pan, and elevation values in degrees. Values range from -180 to 180.
newtype RotationDegrees = RotationDegrees { rotationDegrees :: Decimal }
    deriving (Eq,Typeable,Generic,Ord,Num,Real,Fractional,RealFrac)
instance Show RotationDegrees where show (RotationDegrees a) = show a
instance Read RotationDegrees where readsPrec i = map (A.first RotationDegrees) . readsPrec i
instance EmitXml RotationDegrees where
    emitXml = emitXml . rotationDegrees
parseRotationDegrees :: String -> P.XParse RotationDegrees
parseRotationDegrees = P.xread "RotationDegrees"

-- | @semitones@ /(simple)/
--
-- The semintones type is a number representing semitones, used for chromatic alteration. A value of -1 corresponds to a flat and a value of 1 to a sharp. Decimal values like 0.5 (quarter tone sharp) may be used for microtones.
newtype Semitones = Semitones { semitones :: Decimal }
    deriving (Eq,Typeable,Generic,Ord,Num,Real,Fractional,RealFrac)
instance Show Semitones where show (Semitones a) = show a
instance Read Semitones where readsPrec i = map (A.first Semitones) . readsPrec i
instance EmitXml Semitones where
    emitXml = emitXml . semitones
parseSemitones :: String -> P.XParse Semitones
parseSemitones = P.xread "Semitones"

-- | @xlink:show@ /(simple)/
data SmpShow = 
      ShowNew -- ^ /new/
    | ShowReplace -- ^ /replace/
    | ShowEmbed -- ^ /embed/
    | ShowOther -- ^ /other/
    | ShowNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml SmpShow where
    emitXml ShowNew = XLit "new"
    emitXml ShowReplace = XLit "replace"
    emitXml ShowEmbed = XLit "embed"
    emitXml ShowOther = XLit "other"
    emitXml ShowNone = XLit "none"
parseSmpShow :: String -> P.XParse SmpShow
parseSmpShow s
        | s == "new" = return $ ShowNew
        | s == "replace" = return $ ShowReplace
        | s == "embed" = return $ ShowEmbed
        | s == "other" = return $ ShowOther
        | s == "none" = return $ ShowNone
        | otherwise = P.xfail $ "SmpShow: " ++ s

-- | @show-frets@ /(simple)/
--
-- The show-frets type indicates whether to show tablature frets as numbers (0, 1, 2) or letters (a, b, c). The default choice is numbers.
data ShowFrets = 
      ShowFretsNumbers -- ^ /numbers/
    | ShowFretsLetters -- ^ /letters/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml ShowFrets where
    emitXml ShowFretsNumbers = XLit "numbers"
    emitXml ShowFretsLetters = XLit "letters"
parseShowFrets :: String -> P.XParse ShowFrets
parseShowFrets s
        | s == "numbers" = return $ ShowFretsNumbers
        | s == "letters" = return $ ShowFretsLetters
        | otherwise = P.xfail $ "ShowFrets: " ++ s

-- | @show-tuplet@ /(simple)/
--
-- The show-tuplet type indicates whether to show a part of a tuplet relating to the tuplet-actual element, both the tuplet-actual and tuplet-normal elements, or neither.
data ShowTuplet = 
      ShowTupletActual -- ^ /actual/
    | ShowTupletBoth -- ^ /both/
    | ShowTupletNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml ShowTuplet where
    emitXml ShowTupletActual = XLit "actual"
    emitXml ShowTupletBoth = XLit "both"
    emitXml ShowTupletNone = XLit "none"
parseShowTuplet :: String -> P.XParse ShowTuplet
parseShowTuplet s
        | s == "actual" = return $ ShowTupletActual
        | s == "both" = return $ ShowTupletBoth
        | s == "none" = return $ ShowTupletNone
        | otherwise = P.xfail $ "ShowTuplet: " ++ s

-- | @staff-line@ /(simple)/
--
-- The staff-line type indicates the line on a given staff. Staff lines are numbered from bottom to top, with 1 being the bottom line on a staff. Staff line values can be used to specify positions outside the staff, such as a C clef positioned in the middle of a grand staff.
newtype StaffLine = StaffLine { staffLine :: Int }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show StaffLine where show (StaffLine a) = show a
instance Read StaffLine where readsPrec i = map (A.first StaffLine) . readsPrec i
instance EmitXml StaffLine where
    emitXml = emitXml . staffLine
parseStaffLine :: String -> P.XParse StaffLine
parseStaffLine = P.xread "StaffLine"

-- | @staff-number@ /(simple)/
--
-- The staff-number type indicates staff numbers within a multi-staff part. Staves are numbered from top to bottom, with 1 being the top staff on a part.
newtype StaffNumber = StaffNumber { staffNumber :: PositiveInteger }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show StaffNumber where show (StaffNumber a) = show a
instance Read StaffNumber where readsPrec i = map (A.first StaffNumber) . readsPrec i
instance EmitXml StaffNumber where
    emitXml = emitXml . staffNumber
parseStaffNumber :: String -> P.XParse StaffNumber
parseStaffNumber = P.xread "StaffNumber"

-- | @staff-type@ /(simple)/
--
-- The staff-type value can be ossia, cue, editorial, regular, or alternate. An alternate staff indicates one that shares the same musical data as the prior staff, but displayed differently (e.g., treble and bass clef, standard notation and tab).
data StaffType = 
      StaffTypeOssia -- ^ /ossia/
    | StaffTypeCue -- ^ /cue/
    | StaffTypeEditorial -- ^ /editorial/
    | StaffTypeRegular -- ^ /regular/
    | StaffTypeAlternate -- ^ /alternate/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml StaffType where
    emitXml StaffTypeOssia = XLit "ossia"
    emitXml StaffTypeCue = XLit "cue"
    emitXml StaffTypeEditorial = XLit "editorial"
    emitXml StaffTypeRegular = XLit "regular"
    emitXml StaffTypeAlternate = XLit "alternate"
parseStaffType :: String -> P.XParse StaffType
parseStaffType s
        | s == "ossia" = return $ StaffTypeOssia
        | s == "cue" = return $ StaffTypeCue
        | s == "editorial" = return $ StaffTypeEditorial
        | s == "regular" = return $ StaffTypeRegular
        | s == "alternate" = return $ StaffTypeAlternate
        | otherwise = P.xfail $ "StaffType: " ++ s

-- | @start-note@ /(simple)/
--
-- The start-note type describes the starting note of trills and mordents for playback, relative to the current note.
data StartNote = 
      StartNoteUpper -- ^ /upper/
    | StartNoteMain -- ^ /main/
    | StartNoteBelow -- ^ /below/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml StartNote where
    emitXml StartNoteUpper = XLit "upper"
    emitXml StartNoteMain = XLit "main"
    emitXml StartNoteBelow = XLit "below"
parseStartNote :: String -> P.XParse StartNote
parseStartNote s
        | s == "upper" = return $ StartNoteUpper
        | s == "main" = return $ StartNoteMain
        | s == "below" = return $ StartNoteBelow
        | otherwise = P.xfail $ "StartNote: " ++ s

-- | @start-stop@ /(simple)/
--
-- The start-stop type is used for an attribute of musical elements that can either start or stop, such as tuplets, wedges, and lines.
data StartStop = 
      StartStopStart -- ^ /start/
    | StartStopStop -- ^ /stop/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml StartStop where
    emitXml StartStopStart = XLit "start"
    emitXml StartStopStop = XLit "stop"
parseStartStop :: String -> P.XParse StartStop
parseStartStop s
        | s == "start" = return $ StartStopStart
        | s == "stop" = return $ StartStopStop
        | otherwise = P.xfail $ "StartStop: " ++ s

-- | @start-stop-change@ /(simple)/
--
-- The start-stop-change type is used to distinguish types of pedal directions.
data StartStopChange = 
      StartStopChangeStart -- ^ /start/
    | StartStopChangeStop -- ^ /stop/
    | StartStopChangeChange -- ^ /change/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml StartStopChange where
    emitXml StartStopChangeStart = XLit "start"
    emitXml StartStopChangeStop = XLit "stop"
    emitXml StartStopChangeChange = XLit "change"
parseStartStopChange :: String -> P.XParse StartStopChange
parseStartStopChange s
        | s == "start" = return $ StartStopChangeStart
        | s == "stop" = return $ StartStopChangeStop
        | s == "change" = return $ StartStopChangeChange
        | otherwise = P.xfail $ "StartStopChange: " ++ s

-- | @start-stop-continue@ /(simple)/
--
-- The start-stop-continue type is used for an attribute of musical elements that can either start or stop, but also need to refer to an intermediate point in the symbol, as for complex slurs.
data StartStopContinue = 
      StartStopContinueStart -- ^ /start/
    | StartStopContinueStop -- ^ /stop/
    | StartStopContinueContinue -- ^ /continue/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml StartStopContinue where
    emitXml StartStopContinueStart = XLit "start"
    emitXml StartStopContinueStop = XLit "stop"
    emitXml StartStopContinueContinue = XLit "continue"
parseStartStopContinue :: String -> P.XParse StartStopContinue
parseStartStopContinue s
        | s == "start" = return $ StartStopContinueStart
        | s == "stop" = return $ StartStopContinueStop
        | s == "continue" = return $ StartStopContinueContinue
        | otherwise = P.xfail $ "StartStopContinue: " ++ s

-- | @start-stop-discontinue@ /(simple)/
--
-- The start-stop-discontinue type is used to specify ending types. Typically, the start type is associated with the left barline of the first measure in an ending. The stop and discontinue types are associated with the right barline of the last measure in an ending. Stop is used when the ending mark concludes with a downward jog, as is typical for first endings. Discontinue is used when there is no downward jog, as is typical for second endings that do not conclude a piece.
data StartStopDiscontinue = 
      StartStopDiscontinueStart -- ^ /start/
    | StartStopDiscontinueStop -- ^ /stop/
    | StartStopDiscontinueDiscontinue -- ^ /discontinue/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml StartStopDiscontinue where
    emitXml StartStopDiscontinueStart = XLit "start"
    emitXml StartStopDiscontinueStop = XLit "stop"
    emitXml StartStopDiscontinueDiscontinue = XLit "discontinue"
parseStartStopDiscontinue :: String -> P.XParse StartStopDiscontinue
parseStartStopDiscontinue s
        | s == "start" = return $ StartStopDiscontinueStart
        | s == "stop" = return $ StartStopDiscontinueStop
        | s == "discontinue" = return $ StartStopDiscontinueDiscontinue
        | otherwise = P.xfail $ "StartStopDiscontinue: " ++ s

-- | @start-stop-single@ /(simple)/
--
-- The start-stop-single type is used for an attribute of musical elements that can be used for either multi-note or single-note musical elements, as for tremolos.
data StartStopSingle = 
      StartStopSingleStart -- ^ /start/
    | StartStopSingleStop -- ^ /stop/
    | StartStopSingleSingle -- ^ /single/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml StartStopSingle where
    emitXml StartStopSingleStart = XLit "start"
    emitXml StartStopSingleStop = XLit "stop"
    emitXml StartStopSingleSingle = XLit "single"
parseStartStopSingle :: String -> P.XParse StartStopSingle
parseStartStopSingle s
        | s == "start" = return $ StartStopSingleStart
        | s == "stop" = return $ StartStopSingleStop
        | s == "single" = return $ StartStopSingleSingle
        | otherwise = P.xfail $ "StartStopSingle: " ++ s

-- | @stem-value@ /(simple)/
--
-- The stem type represents the notated stem direction.
data StemValue = 
      StemValueDown -- ^ /down/
    | StemValueUp -- ^ /up/
    | StemValueDouble -- ^ /double/
    | StemValueNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml StemValue where
    emitXml StemValueDown = XLit "down"
    emitXml StemValueUp = XLit "up"
    emitXml StemValueDouble = XLit "double"
    emitXml StemValueNone = XLit "none"
parseStemValue :: String -> P.XParse StemValue
parseStemValue s
        | s == "down" = return $ StemValueDown
        | s == "up" = return $ StemValueUp
        | s == "double" = return $ StemValueDouble
        | s == "none" = return $ StemValueNone
        | otherwise = P.xfail $ "StemValue: " ++ s

-- | @step@ /(simple)/
--
-- The step type represents a step of the diatonic scale, represented using the English letters A through G.
data Step = 
      StepA -- ^ /A/
    | StepB -- ^ /B/
    | StepC -- ^ /C/
    | StepD -- ^ /D/
    | StepE -- ^ /E/
    | StepF -- ^ /F/
    | StepG -- ^ /G/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml Step where
    emitXml StepA = XLit "A"
    emitXml StepB = XLit "B"
    emitXml StepC = XLit "C"
    emitXml StepD = XLit "D"
    emitXml StepE = XLit "E"
    emitXml StepF = XLit "F"
    emitXml StepG = XLit "G"
parseStep :: String -> P.XParse Step
parseStep s
        | s == "A" = return $ StepA
        | s == "B" = return $ StepB
        | s == "C" = return $ StepC
        | s == "D" = return $ StepD
        | s == "E" = return $ StepE
        | s == "F" = return $ StepF
        | s == "G" = return $ StepG
        | otherwise = P.xfail $ "Step: " ++ s

-- | @string-number@ /(simple)/
--
-- The string-number type indicates a string number. Strings are numbered from high to low, with 1 being the highest pitched string.
newtype StringNumber = StringNumber { stringNumber :: PositiveInteger }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show StringNumber where show (StringNumber a) = show a
instance Read StringNumber where readsPrec i = map (A.first StringNumber) . readsPrec i
instance EmitXml StringNumber where
    emitXml = emitXml . stringNumber
parseStringNumber :: String -> P.XParse StringNumber
parseStringNumber = P.xread "StringNumber"

-- | @syllabic@ /(simple)/
--
-- Lyric hyphenation is indicated by the syllabic type. The single, begin, end, and middle values represent single-syllable words, word-beginning syllables, word-ending syllables, and mid-word syllables, respectively.
data Syllabic = 
      SyllabicSingle -- ^ /single/
    | SyllabicBegin -- ^ /begin/
    | SyllabicEnd -- ^ /end/
    | SyllabicMiddle -- ^ /middle/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml Syllabic where
    emitXml SyllabicSingle = XLit "single"
    emitXml SyllabicBegin = XLit "begin"
    emitXml SyllabicEnd = XLit "end"
    emitXml SyllabicMiddle = XLit "middle"
parseSyllabic :: String -> P.XParse Syllabic
parseSyllabic s
        | s == "single" = return $ SyllabicSingle
        | s == "begin" = return $ SyllabicBegin
        | s == "end" = return $ SyllabicEnd
        | s == "middle" = return $ SyllabicMiddle
        | otherwise = P.xfail $ "Syllabic: " ++ s

-- | @symbol-size@ /(simple)/
--
-- The symbol-size type is used to indicate full vs. cue-sized vs. oversized symbols. The large value for oversized symbols was added in version 1.1.
data SymbolSize = 
      SymbolSizeFull -- ^ /full/
    | SymbolSizeCue -- ^ /cue/
    | SymbolSizeLarge -- ^ /large/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml SymbolSize where
    emitXml SymbolSizeFull = XLit "full"
    emitXml SymbolSizeCue = XLit "cue"
    emitXml SymbolSizeLarge = XLit "large"
parseSymbolSize :: String -> P.XParse SymbolSize
parseSymbolSize s
        | s == "full" = return $ SymbolSizeFull
        | s == "cue" = return $ SymbolSizeCue
        | s == "large" = return $ SymbolSizeLarge
        | otherwise = P.xfail $ "SymbolSize: " ++ s

-- | @tenths@ /(simple)/
--
-- The tenths type is a number representing tenths of interline staff space (positive or negative). Both integer and decimal values are allowed, such as 5 for a half space and 2.5 for a quarter space. Interline space is measured from the middle of a staff line.
-- 
-- Distances in a MusicXML file are measured in tenths of staff space. Tenths are then scaled to millimeters within the scaling element, used in the defaults element at the start of a score. Individual staves can apply a scaling factor to adjust staff size. When a MusicXML element or attribute refers to tenths, it means the global tenths defined by the scaling element, not the local tenths as adjusted by the staff-size element.
newtype Tenths = Tenths { tenths :: Decimal }
    deriving (Eq,Typeable,Generic,Ord,Num,Real,Fractional,RealFrac)
instance Show Tenths where show (Tenths a) = show a
instance Read Tenths where readsPrec i = map (A.first Tenths) . readsPrec i
instance EmitXml Tenths where
    emitXml = emitXml . tenths
parseTenths :: String -> P.XParse Tenths
parseTenths = P.xread "Tenths"

-- | @text-direction@ /(simple)/
--
-- The text-direction type is used to adjust and override the Unicode bidirectional text algorithm, similar to the W3C Internationalization Tag Set recommendation. Values are ltr (left-to-right embed), rtl (right-to-left embed), lro (left-to-right bidi-override), and rlo (right-to-left bidi-override). The default value is ltr. This type is typically used by applications that store text in left-to-right visual order rather than logical order. Such applications can use the lro value to better communicate with other applications that more fully support bidirectional text.
data TextDirection = 
      TextDirectionLtr -- ^ /ltr/
    | TextDirectionRtl -- ^ /rtl/
    | TextDirectionLro -- ^ /lro/
    | TextDirectionRlo -- ^ /rlo/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml TextDirection where
    emitXml TextDirectionLtr = XLit "ltr"
    emitXml TextDirectionRtl = XLit "rtl"
    emitXml TextDirectionLro = XLit "lro"
    emitXml TextDirectionRlo = XLit "rlo"
parseTextDirection :: String -> P.XParse TextDirection
parseTextDirection s
        | s == "ltr" = return $ TextDirectionLtr
        | s == "rtl" = return $ TextDirectionRtl
        | s == "lro" = return $ TextDirectionLro
        | s == "rlo" = return $ TextDirectionRlo
        | otherwise = P.xfail $ "TextDirection: " ++ s

-- | @time-symbol@ /(simple)/
--
-- The time-symbol type indicates how to display a time signature. The normal value is the usual fractional display, and is the implied symbol type if none is specified. Other options are the common and cut time symbols, as well as a single number with an implied denominator.
data TimeSymbol = 
      TimeSymbolCommon -- ^ /common/
    | TimeSymbolCut -- ^ /cut/
    | TimeSymbolSingleNumber -- ^ /single-number/
    | TimeSymbolNormal -- ^ /normal/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml TimeSymbol where
    emitXml TimeSymbolCommon = XLit "common"
    emitXml TimeSymbolCut = XLit "cut"
    emitXml TimeSymbolSingleNumber = XLit "single-number"
    emitXml TimeSymbolNormal = XLit "normal"
parseTimeSymbol :: String -> P.XParse TimeSymbol
parseTimeSymbol s
        | s == "common" = return $ TimeSymbolCommon
        | s == "cut" = return $ TimeSymbolCut
        | s == "single-number" = return $ TimeSymbolSingleNumber
        | s == "normal" = return $ TimeSymbolNormal
        | otherwise = P.xfail $ "TimeSymbol: " ++ s

-- | @xs:token@ /(simple)/
newtype Token = Token { token :: NormalizedString }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show Token where show (Token a) = show a
instance Read Token where readsPrec i = map (A.first Token) . readsPrec i
instance EmitXml Token where
    emitXml = emitXml . token
parseToken :: String -> P.XParse Token
parseToken = return . fromString

-- | @top-bottom@ /(simple)/
--
-- The top-bottom type is used to indicate the top or bottom part of a vertical shape like non-arpeggiate.
data TopBottom = 
      TopBottomTop -- ^ /top/
    | TopBottomBottom -- ^ /bottom/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml TopBottom where
    emitXml TopBottomTop = XLit "top"
    emitXml TopBottomBottom = XLit "bottom"
parseTopBottom :: String -> P.XParse TopBottom
parseTopBottom s
        | s == "top" = return $ TopBottomTop
        | s == "bottom" = return $ TopBottomBottom
        | otherwise = P.xfail $ "TopBottom: " ++ s

-- | @tremolo-marks@ /(simple)/
--
-- The number of tremolo marks is represented by a number from 0 to 6: the same as beam-level with 0 added.
newtype TremoloMarks = TremoloMarks { tremoloMarks :: Int }
    deriving (Eq,Typeable,Generic,Ord,Bounded,Enum,Num,Real,Integral)
instance Show TremoloMarks where show (TremoloMarks a) = show a
instance Read TremoloMarks where readsPrec i = map (A.first TremoloMarks) . readsPrec i
instance EmitXml TremoloMarks where
    emitXml = emitXml . tremoloMarks
parseTremoloMarks :: String -> P.XParse TremoloMarks
parseTremoloMarks = P.xread "TremoloMarks"

-- | @trill-beats@ /(simple)/
--
-- The trill-beats type specifies the beats used in a trill-sound or bend-sound attribute group. It is a decimal value with a minimum value of 2.
newtype TrillBeats = TrillBeats { trillBeats :: Decimal }
    deriving (Eq,Typeable,Generic,Ord,Num,Real,Fractional,RealFrac)
instance Show TrillBeats where show (TrillBeats a) = show a
instance Read TrillBeats where readsPrec i = map (A.first TrillBeats) . readsPrec i
instance EmitXml TrillBeats where
    emitXml = emitXml . trillBeats
parseTrillBeats :: String -> P.XParse TrillBeats
parseTrillBeats = P.xread "TrillBeats"

-- | @trill-step@ /(simple)/
--
-- The trill-step type describes the alternating note of trills and mordents for playback, relative to the current note.
data TrillStep = 
      TrillStepWhole -- ^ /whole/
    | TrillStepHalf -- ^ /half/
    | TrillStepUnison -- ^ /unison/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml TrillStep where
    emitXml TrillStepWhole = XLit "whole"
    emitXml TrillStepHalf = XLit "half"
    emitXml TrillStepUnison = XLit "unison"
parseTrillStep :: String -> P.XParse TrillStep
parseTrillStep s
        | s == "whole" = return $ TrillStepWhole
        | s == "half" = return $ TrillStepHalf
        | s == "unison" = return $ TrillStepUnison
        | otherwise = P.xfail $ "TrillStep: " ++ s

-- | @two-note-turn@ /(simple)/
--
-- The two-note-turn type describes the ending notes of trills and mordents for playback, relative to the current note.
data TwoNoteTurn = 
      TwoNoteTurnWhole -- ^ /whole/
    | TwoNoteTurnHalf -- ^ /half/
    | TwoNoteTurnNone -- ^ /none/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml TwoNoteTurn where
    emitXml TwoNoteTurnWhole = XLit "whole"
    emitXml TwoNoteTurnHalf = XLit "half"
    emitXml TwoNoteTurnNone = XLit "none"
parseTwoNoteTurn :: String -> P.XParse TwoNoteTurn
parseTwoNoteTurn s
        | s == "whole" = return $ TwoNoteTurnWhole
        | s == "half" = return $ TwoNoteTurnHalf
        | s == "none" = return $ TwoNoteTurnNone
        | otherwise = P.xfail $ "TwoNoteTurn: " ++ s

-- | @xlink:type@ /(simple)/
data Type = 
      TypeSimple -- ^ /simple/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml Type where
    emitXml TypeSimple = XLit "simple"
parseType :: String -> P.XParse Type
parseType s
        | s == "simple" = return $ TypeSimple
        | otherwise = P.xfail $ "Type: " ++ s

-- | @up-down@ /(simple)/
--
-- The up-down type is used for arrow direction, indicating which way the tip is pointing.
data UpDown = 
      UpDownUp -- ^ /up/
    | UpDownDown -- ^ /down/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml UpDown where
    emitXml UpDownUp = XLit "up"
    emitXml UpDownDown = XLit "down"
parseUpDown :: String -> P.XParse UpDown
parseUpDown s
        | s == "up" = return $ UpDownUp
        | s == "down" = return $ UpDownDown
        | otherwise = P.xfail $ "UpDown: " ++ s

-- | @up-down-stop@ /(simple)/
--
-- The up-down-stop type is used for octave-shift elements, indicating the direction of the shift from their true pitched values because of printing difficulty.
data UpDownStop = 
      UpDownStopUp -- ^ /up/
    | UpDownStopDown -- ^ /down/
    | UpDownStopStop -- ^ /stop/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml UpDownStop where
    emitXml UpDownStopUp = XLit "up"
    emitXml UpDownStopDown = XLit "down"
    emitXml UpDownStopStop = XLit "stop"
parseUpDownStop :: String -> P.XParse UpDownStop
parseUpDownStop s
        | s == "up" = return $ UpDownStopUp
        | s == "down" = return $ UpDownStopDown
        | s == "stop" = return $ UpDownStopStop
        | otherwise = P.xfail $ "UpDownStop: " ++ s

-- | @upright-inverted@ /(simple)/
--
-- The upright-inverted type describes the appearance of a fermata element. The value is upright if not specified.
data UprightInverted = 
      UprightInvertedUpright -- ^ /upright/
    | UprightInvertedInverted -- ^ /inverted/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml UprightInverted where
    emitXml UprightInvertedUpright = XLit "upright"
    emitXml UprightInvertedInverted = XLit "inverted"
parseUprightInverted :: String -> P.XParse UprightInverted
parseUprightInverted s
        | s == "upright" = return $ UprightInvertedUpright
        | s == "inverted" = return $ UprightInvertedInverted
        | otherwise = P.xfail $ "UprightInverted: " ++ s

-- | @valign@ /(simple)/
--
-- The valign type is used to indicate vertical alignment to the top, middle, bottom, or baseline of the text. Defaults are implementation-dependent.
data Valign = 
      ValignTop -- ^ /top/
    | ValignMiddle -- ^ /middle/
    | ValignBottom -- ^ /bottom/
    | ValignBaseline -- ^ /baseline/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml Valign where
    emitXml ValignTop = XLit "top"
    emitXml ValignMiddle = XLit "middle"
    emitXml ValignBottom = XLit "bottom"
    emitXml ValignBaseline = XLit "baseline"
parseValign :: String -> P.XParse Valign
parseValign s
        | s == "top" = return $ ValignTop
        | s == "middle" = return $ ValignMiddle
        | s == "bottom" = return $ ValignBottom
        | s == "baseline" = return $ ValignBaseline
        | otherwise = P.xfail $ "Valign: " ++ s

-- | @valign-image@ /(simple)/
--
-- The valign-image type is used to indicate vertical alignment for images and graphics, so it does not include a baseline value. Defaults are implementation-dependent.
data ValignImage = 
      ValignImageTop -- ^ /top/
    | ValignImageMiddle -- ^ /middle/
    | ValignImageBottom -- ^ /bottom/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml ValignImage where
    emitXml ValignImageTop = XLit "top"
    emitXml ValignImageMiddle = XLit "middle"
    emitXml ValignImageBottom = XLit "bottom"
parseValignImage :: String -> P.XParse ValignImage
parseValignImage s
        | s == "top" = return $ ValignImageTop
        | s == "middle" = return $ ValignImageMiddle
        | s == "bottom" = return $ ValignImageBottom
        | otherwise = P.xfail $ "ValignImage: " ++ s

-- | @wedge-type@ /(simple)/
--
-- The wedge type is crescendo for the start of a wedge that is closed at the left side, diminuendo for the start of a wedge that is closed on the right side, and stop for the end of a wedge.
data WedgeType = 
      WedgeTypeCrescendo -- ^ /crescendo/
    | WedgeTypeDiminuendo -- ^ /diminuendo/
    | WedgeTypeStop -- ^ /stop/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml WedgeType where
    emitXml WedgeTypeCrescendo = XLit "crescendo"
    emitXml WedgeTypeDiminuendo = XLit "diminuendo"
    emitXml WedgeTypeStop = XLit "stop"
parseWedgeType :: String -> P.XParse WedgeType
parseWedgeType s
        | s == "crescendo" = return $ WedgeTypeCrescendo
        | s == "diminuendo" = return $ WedgeTypeDiminuendo
        | s == "stop" = return $ WedgeTypeStop
        | otherwise = P.xfail $ "WedgeType: " ++ s

-- | @yes-no@ /(simple)/
--
-- The yes-no type is used for boolean-like attributes. We cannot use W3C XML Schema booleans due to their restrictions on expression of boolean values.
data YesNo = 
      YesNoYes -- ^ /yes/
    | YesNoNo -- ^ /no/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml YesNo where
    emitXml YesNoYes = XLit "yes"
    emitXml YesNoNo = XLit "no"
parseYesNo :: String -> P.XParse YesNo
parseYesNo s
        | s == "yes" = return $ YesNoYes
        | s == "no" = return $ YesNoNo
        | otherwise = P.xfail $ "YesNo: " ++ s

-- | @yes-no-number@ /(simple)/
--
-- The yes-no-number type is used for attributes that can be either boolean or numeric values.
data YesNoNumber = 
      YesNoNumberYesNo {
          yesNoNumber1 :: YesNo
       }
    | YesNoNumberDecimal {
          yesNoNumber2 :: Decimal
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml YesNoNumber where
    emitXml (YesNoNumberYesNo a) = emitXml a
    emitXml (YesNoNumberDecimal a) = emitXml a
parseYesNoNumber :: String -> P.XParse YesNoNumber
parseYesNoNumber s = 
      YesNoNumberYesNo
        <$> parseYesNo s
      <|> YesNoNumberDecimal
        <$> (P.xread "Decimal") s


-- | @yyyy-mm-dd@ /(simple)/
--
-- Calendar dates are represented yyyy-mm-dd format, following ISO 8601. This is a W3C XML Schema date type, but without the optional timezone data.
newtype YyyyMmDd = YyyyMmDd { yyyyMmDd :: String }
    deriving (Eq,Typeable,Generic,Ord,IsString)
instance Show YyyyMmDd where show (YyyyMmDd a) = show a
instance Read YyyyMmDd where readsPrec i = map (A.first YyyyMmDd) . readsPrec i
instance EmitXml YyyyMmDd where
    emitXml = emitXml . yyyyMmDd
parseYyyyMmDd :: String -> P.XParse YyyyMmDd
parseYyyyMmDd = return . fromString

-- | @xml:lang@ /(union)/
data SumLang = 
      SumLang -- ^ //
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml SumLang where
    emitXml SumLang = XLit ""
parseSumLang :: String -> P.XParse SumLang
parseSumLang s
        | s == "" = return $ SumLang
        | otherwise = P.xfail $ "SumLang: " ++ s

-- | @number-or-normal@ /(union)/
data SumNumberOrNormal = 
      NumberOrNormalNormal -- ^ /normal/
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml SumNumberOrNormal where
    emitXml NumberOrNormalNormal = XLit "normal"
parseSumNumberOrNormal :: String -> P.XParse SumNumberOrNormal
parseSumNumberOrNormal s
        | s == "normal" = return $ NumberOrNormalNormal
        | otherwise = P.xfail $ "SumNumberOrNormal: " ++ s

-- | @positive-integer-or-empty@ /(union)/
data SumPositiveIntegerOrEmpty = 
      SumPositiveIntegerOrEmpty -- ^ //
    deriving (Eq,Typeable,Generic,Show,Ord,Enum,Bounded)
instance EmitXml SumPositiveIntegerOrEmpty where
    emitXml SumPositiveIntegerOrEmpty = XLit ""
parseSumPositiveIntegerOrEmpty :: String -> P.XParse SumPositiveIntegerOrEmpty
parseSumPositiveIntegerOrEmpty s
        | s == "" = return $ SumPositiveIntegerOrEmpty
        | otherwise = P.xfail $ "SumPositiveIntegerOrEmpty: " ++ s

-- | @accidental@ /(complex)/
--
-- The accidental type represents actual notated accidentals. Editorial and cautionary indications are indicated by attributes. Values for these attributes are "no" if not present. Specific graphic display such as parentheses, brackets, and size are controlled by the level-display attribute group.
data Accidental = 
      Accidental {
          accidentalAccidentalValue :: AccidentalValue -- ^ text content
        , accidentalCautionary :: (Maybe YesNo) -- ^ /cautionary/ attribute
        , accidentalEditorial :: (Maybe YesNo) -- ^ /editorial/ attribute
        , accidentalParentheses :: (Maybe YesNo) -- ^ /parentheses/ attribute
        , accidentalBracket :: (Maybe YesNo) -- ^ /bracket/ attribute
        , accidentalSize :: (Maybe SymbolSize) -- ^ /size/ attribute
        , accidentalDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , accidentalDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , accidentalRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , accidentalRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , accidentalFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , accidentalFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , accidentalFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , accidentalFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , accidentalColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Accidental where
    emitXml (Accidental a b c d e f g h i j k l m n o) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "cautionary" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "editorial" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "parentheses" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "bracket" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "size" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) k] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) l] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) m] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) n] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) o])
        []
parseAccidental :: P.XParse Accidental
parseAccidental = 
      Accidental
        <$> (P.xtext >>= parseAccidentalValue)
        <*> P.optional (P.xattr (P.name "cautionary") >>= parseYesNo)
        <*> P.optional (P.xattr (P.name "editorial") >>= parseYesNo)
        <*> P.optional (P.xattr (P.name "parentheses") >>= parseYesNo)
        <*> P.optional (P.xattr (P.name "bracket") >>= parseYesNo)
        <*> P.optional (P.xattr (P.name "size") >>= parseSymbolSize)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'Accidental'
mkAccidental :: AccidentalValue -> Accidental
mkAccidental a = Accidental a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @accidental-mark@ /(complex)/
--
-- An accidental-mark can be used as a separate notation or as part of an ornament. When used in an ornament, position and placement are relative to the ornament, not relative to the note.
data AccidentalMark = 
      AccidentalMark {
          accidentalMarkAccidentalValue :: AccidentalValue -- ^ text content
        , accidentalMarkDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , accidentalMarkDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , accidentalMarkRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , accidentalMarkRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , accidentalMarkFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , accidentalMarkFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , accidentalMarkFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , accidentalMarkFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , accidentalMarkColor :: (Maybe Color) -- ^ /color/ attribute
        , accidentalMarkPlacement :: (Maybe AboveBelow) -- ^ /placement/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml AccidentalMark where
    emitXml (AccidentalMark a b c d e f g h i j k) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "placement" Nothing).emitXml) k])
        []
parseAccidentalMark :: P.XParse AccidentalMark
parseAccidentalMark = 
      AccidentalMark
        <$> (P.xtext >>= parseAccidentalValue)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)
        <*> P.optional (P.xattr (P.name "placement") >>= parseAboveBelow)

-- | Smart constructor for 'AccidentalMark'
mkAccidentalMark :: AccidentalValue -> AccidentalMark
mkAccidentalMark a = AccidentalMark a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @accidental-text@ /(complex)/
--
-- The accidental-text type represents an element with an accidental value and text-formatting attributes.
data AccidentalText = 
      AccidentalText {
          accidentalTextAccidentalValue :: AccidentalValue -- ^ text content
        , accidentalTextLang :: (Maybe Lang) -- ^ /xml:lang/ attribute
        , accidentalTextEnclosure :: (Maybe Enclosure) -- ^ /enclosure/ attribute
        , accidentalTextJustify :: (Maybe LeftCenterRight) -- ^ /justify/ attribute
        , accidentalTextHalign :: (Maybe LeftCenterRight) -- ^ /halign/ attribute
        , accidentalTextValign :: (Maybe Valign) -- ^ /valign/ attribute
        , accidentalTextDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , accidentalTextDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , accidentalTextRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , accidentalTextRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , accidentalTextFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , accidentalTextFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , accidentalTextFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , accidentalTextFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , accidentalTextColor :: (Maybe Color) -- ^ /color/ attribute
        , accidentalTextUnderline :: (Maybe NumberOfLines) -- ^ /underline/ attribute
        , accidentalTextOverline :: (Maybe NumberOfLines) -- ^ /overline/ attribute
        , accidentalTextLineThrough :: (Maybe NumberOfLines) -- ^ /line-through/ attribute
        , accidentalTextRotation :: (Maybe RotationDegrees) -- ^ /rotation/ attribute
        , accidentalTextLetterSpacing :: (Maybe NumberOrNormal) -- ^ /letter-spacing/ attribute
        , accidentalTextLineHeight :: (Maybe NumberOrNormal) -- ^ /line-height/ attribute
        , accidentalTextDir :: (Maybe TextDirection) -- ^ /dir/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml AccidentalText where
    emitXml (AccidentalText a b c d e f g h i j k l m n o p q r s t u v) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "lang" (Just "xml")).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "enclosure" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "justify" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "halign" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "valign" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) k] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) l] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) m] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) n] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) o] ++
        [maybe XEmpty (XAttr (QN "underline" Nothing).emitXml) p] ++
        [maybe XEmpty (XAttr (QN "overline" Nothing).emitXml) q] ++
        [maybe XEmpty (XAttr (QN "line-through" Nothing).emitXml) r] ++
        [maybe XEmpty (XAttr (QN "rotation" Nothing).emitXml) s] ++
        [maybe XEmpty (XAttr (QN "letter-spacing" Nothing).emitXml) t] ++
        [maybe XEmpty (XAttr (QN "line-height" Nothing).emitXml) u] ++
        [maybe XEmpty (XAttr (QN "dir" Nothing).emitXml) v])
        []
parseAccidentalText :: P.XParse AccidentalText
parseAccidentalText = 
      AccidentalText
        <$> (P.xtext >>= parseAccidentalValue)
        <*> P.optional (P.xattr (P.name "xml:lang") >>= parseLang)
        <*> P.optional (P.xattr (P.name "enclosure") >>= parseEnclosure)
        <*> P.optional (P.xattr (P.name "justify") >>= parseLeftCenterRight)
        <*> P.optional (P.xattr (P.name "halign") >>= parseLeftCenterRight)
        <*> P.optional (P.xattr (P.name "valign") >>= parseValign)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)
        <*> P.optional (P.xattr (P.name "underline") >>= parseNumberOfLines)
        <*> P.optional (P.xattr (P.name "overline") >>= parseNumberOfLines)
        <*> P.optional (P.xattr (P.name "line-through") >>= parseNumberOfLines)
        <*> P.optional (P.xattr (P.name "rotation") >>= parseRotationDegrees)
        <*> P.optional (P.xattr (P.name "letter-spacing") >>= parseNumberOrNormal)
        <*> P.optional (P.xattr (P.name "line-height") >>= parseNumberOrNormal)
        <*> P.optional (P.xattr (P.name "dir") >>= parseTextDirection)

-- | Smart constructor for 'AccidentalText'
mkAccidentalText :: AccidentalValue -> AccidentalText
mkAccidentalText a = AccidentalText a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @accord@ /(complex)/
--
-- The accord type represents the tuning of a single string in the scordatura element. It uses the same group of elements as the staff-tuning element. Strings are numbered from high to low.
data Accord = 
      Accord {
          accordString :: (Maybe StringNumber) -- ^ /string/ attribute
        , accordTuning :: Tuning
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Accord where
    emitXml (Accord a b) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "string" Nothing).emitXml) a])
        ([emitXml b])
parseAccord :: P.XParse Accord
parseAccord = 
      Accord
        <$> P.optional (P.xattr (P.name "string") >>= parseStringNumber)
        <*> parseTuning

-- | Smart constructor for 'Accord'
mkAccord :: Tuning -> Accord
mkAccord b = Accord Nothing b

-- | @accordion-registration@ /(complex)/
--
-- The accordion-registration type is use for accordion registration symbols. These are circular symbols divided horizontally into high, middle, and low sections that correspond to 4', 8', and 16' pipes. Each accordion-high, accordion-middle, and accordion-low element represents the presence of one or more dots in the registration diagram. An accordion-registration element needs to have at least one of the child elements present.
data AccordionRegistration = 
      AccordionRegistration {
          accordionRegistrationDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , accordionRegistrationDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , accordionRegistrationRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , accordionRegistrationRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , accordionRegistrationFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , accordionRegistrationFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , accordionRegistrationFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , accordionRegistrationFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , accordionRegistrationColor :: (Maybe Color) -- ^ /color/ attribute
        , accordionRegistrationAccordionHigh :: (Maybe Empty) -- ^ /accordion-high/ child element
        , accordionRegistrationAccordionMiddle :: (Maybe AccordionMiddle) -- ^ /accordion-middle/ child element
        , accordionRegistrationAccordionLow :: (Maybe Empty) -- ^ /accordion-low/ child element
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml AccordionRegistration where
    emitXml (AccordionRegistration a b c d e f g h i j k l) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) a] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) i])
        ([maybe XEmpty (XElement (QN "accordion-high" Nothing).emitXml) j] ++
        [maybe XEmpty (XElement (QN "accordion-middle" Nothing).emitXml) k] ++
        [maybe XEmpty (XElement (QN "accordion-low" Nothing).emitXml) l])
parseAccordionRegistration :: P.XParse AccordionRegistration
parseAccordionRegistration = 
      AccordionRegistration
        <$> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)
        <*> P.optional (P.xchild (P.name "accordion-high") (parseEmpty))
        <*> P.optional (P.xchild (P.name "accordion-middle") (P.xtext >>= parseAccordionMiddle))
        <*> P.optional (P.xchild (P.name "accordion-low") (parseEmpty))

-- | Smart constructor for 'AccordionRegistration'
mkAccordionRegistration :: AccordionRegistration
mkAccordionRegistration = AccordionRegistration Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @appearance@ /(complex)/
--
-- The appearance type controls general graphical settings for the music's final form appearance on a printed page of display. Currently this includes support for line widths and definitions for note sizes, plus an extension element for other aspects of appearance.
data Appearance = 
      Appearance {
          appearanceLineWidth :: [LineWidth] -- ^ /line-width/ child element
        , appearanceNoteSize :: [NoteSize] -- ^ /note-size/ child element
        , appearanceOtherAppearance :: [OtherAppearance] -- ^ /other-appearance/ child element
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Appearance where
    emitXml (Appearance a b c) =
      XContent XEmpty
        []
        (map (XElement (QN "line-width" Nothing).emitXml) a ++
        map (XElement (QN "note-size" Nothing).emitXml) b ++
        map (XElement (QN "other-appearance" Nothing).emitXml) c)
parseAppearance :: P.XParse Appearance
parseAppearance = 
      Appearance
        <$> P.many (P.xchild (P.name "line-width") (parseLineWidth))
        <*> P.many (P.xchild (P.name "note-size") (parseNoteSize))
        <*> P.many (P.xchild (P.name "other-appearance") (parseOtherAppearance))

-- | Smart constructor for 'Appearance'
mkAppearance :: Appearance
mkAppearance = Appearance [] [] []

-- | @arpeggiate@ /(complex)/
--
-- The arpeggiate type indicates that this note is part of an arpeggiated chord. The number attribute can be used to distinguish between two simultaneous chords arpeggiated separately (different numbers) or together (same number). The up-down attribute is used if there is an arrow on the arpeggio sign. By default, arpeggios go from the lowest to highest note.
data Arpeggiate = 
      Arpeggiate {
          arpeggiateNumber :: (Maybe NumberLevel) -- ^ /number/ attribute
        , arpeggiateDirection :: (Maybe UpDown) -- ^ /direction/ attribute
        , arpeggiateDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , arpeggiateDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , arpeggiateRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , arpeggiateRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , arpeggiatePlacement :: (Maybe AboveBelow) -- ^ /placement/ attribute
        , arpeggiateColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Arpeggiate where
    emitXml (Arpeggiate a b c d e f g h) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "number" Nothing).emitXml) a] ++
        [maybe XEmpty (XAttr (QN "direction" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "placement" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) h])
        []
parseArpeggiate :: P.XParse Arpeggiate
parseArpeggiate = 
      Arpeggiate
        <$> P.optional (P.xattr (P.name "number") >>= parseNumberLevel)
        <*> P.optional (P.xattr (P.name "direction") >>= parseUpDown)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "placement") >>= parseAboveBelow)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'Arpeggiate'
mkArpeggiate :: Arpeggiate
mkArpeggiate = Arpeggiate Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @articulations@ /(complex)/
--
-- Articulations and accents are grouped together here.
data Articulations = 
      Articulations {
          articulationsArticulations :: [ChxArticulations]
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Articulations where
    emitXml (Articulations a) =
      XReps [emitXml a]
parseArticulations :: P.XParse Articulations
parseArticulations = 
      Articulations
        <$> P.many (parseChxArticulations)

-- | Smart constructor for 'Articulations'
mkArticulations :: Articulations
mkArticulations = Articulations []

-- | @attributes@ /(complex)/
--
-- The attributes element contains musical information that typically changes on measure boundaries. This includes key and time signatures, clefs, transpositions, and staving.
data Attributes = 
      Attributes {
          attributesEditorial :: Editorial
        , attributesDivisions :: (Maybe PositiveDivisions) -- ^ /divisions/ child element
        , attributesKey :: [Key] -- ^ /key/ child element
        , attributesTime :: [Time] -- ^ /time/ child element
        , attributesStaves :: (Maybe NonNegativeInteger) -- ^ /staves/ child element
        , attributesPartSymbol :: (Maybe PartSymbol) -- ^ /part-symbol/ child element
        , attributesInstruments :: (Maybe NonNegativeInteger) -- ^ /instruments/ child element
        , attributesClef :: [Clef] -- ^ /clef/ child element
        , attributesStaffDetails :: [StaffDetails] -- ^ /staff-details/ child element
        , attributesTranspose :: (Maybe Transpose) -- ^ /transpose/ child element
        , attributesDirective :: [Directive] -- ^ /directive/ child element
        , attributesMeasureStyle :: [MeasureStyle] -- ^ /measure-style/ child element
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Attributes where
    emitXml (Attributes a b c d e f g h i j k l) =
      XContent XEmpty
        []
        ([emitXml a] ++
        [maybe XEmpty (XElement (QN "divisions" Nothing).emitXml) b] ++
        map (XElement (QN "key" Nothing).emitXml) c ++
        map (XElement (QN "time" Nothing).emitXml) d ++
        [maybe XEmpty (XElement (QN "staves" Nothing).emitXml) e] ++
        [maybe XEmpty (XElement (QN "part-symbol" Nothing).emitXml) f] ++
        [maybe XEmpty (XElement (QN "instruments" Nothing).emitXml) g] ++
        map (XElement (QN "clef" Nothing).emitXml) h ++
        map (XElement (QN "staff-details" Nothing).emitXml) i ++
        [maybe XEmpty (XElement (QN "transpose" Nothing).emitXml) j] ++
        map (XElement (QN "directive" Nothing).emitXml) k ++
        map (XElement (QN "measure-style" Nothing).emitXml) l)
parseAttributes :: P.XParse Attributes
parseAttributes = 
      Attributes
        <$> parseEditorial
        <*> P.optional (P.xchild (P.name "divisions") (P.xtext >>= parsePositiveDivisions))
        <*> P.many (P.xchild (P.name "key") (parseKey))
        <*> P.many (P.xchild (P.name "time") (parseTime))
        <*> P.optional (P.xchild (P.name "staves") (P.xtext >>= parseNonNegativeInteger))
        <*> P.optional (P.xchild (P.name "part-symbol") (parsePartSymbol))
        <*> P.optional (P.xchild (P.name "instruments") (P.xtext >>= parseNonNegativeInteger))
        <*> P.many (P.xchild (P.name "clef") (parseClef))
        <*> P.many (P.xchild (P.name "staff-details") (parseStaffDetails))
        <*> P.optional (P.xchild (P.name "transpose") (parseTranspose))
        <*> P.many (P.xchild (P.name "directive") (parseDirective))
        <*> P.many (P.xchild (P.name "measure-style") (parseMeasureStyle))

-- | Smart constructor for 'Attributes'
mkAttributes :: Editorial -> Attributes
mkAttributes a = Attributes a Nothing [] [] Nothing Nothing Nothing [] [] Nothing [] []

-- | @backup@ /(complex)/
--
-- The backup and forward elements are required to coordinate multiple voices in one part, including music on multiple staves. The backup type is generally used to move between voices and staves. Thus the backup element does not include voice or staff elements. Duration values should always be positive, and should not cross measure boundaries.
data Backup = 
      Backup {
          backupDuration :: Duration
        , backupEditorial :: Editorial
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Backup where
    emitXml (Backup a b) =
      XReps [emitXml a,emitXml b]
parseBackup :: P.XParse Backup
parseBackup = 
      Backup
        <$> parseDuration
        <*> parseEditorial

-- | Smart constructor for 'Backup'
mkBackup :: Duration -> Editorial -> Backup
mkBackup a b = Backup a b

-- | @bar-style-color@ /(complex)/
--
-- The bar-style-color type contains barline style and color information.
data BarStyleColor = 
      BarStyleColor {
          barStyleColorBarStyle :: BarStyle -- ^ text content
        , barStyleColorColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml BarStyleColor where
    emitXml (BarStyleColor a b) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "color" Nothing).emitXml) b])
        []
parseBarStyleColor :: P.XParse BarStyleColor
parseBarStyleColor = 
      BarStyleColor
        <$> (P.xtext >>= parseBarStyle)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'BarStyleColor'
mkBarStyleColor :: BarStyle -> BarStyleColor
mkBarStyleColor a = BarStyleColor a Nothing

-- | @barline@ /(complex)/
--
-- If a barline is other than a normal single barline, it should be represented by a barline type that describes it. This includes information about repeats and multiple endings, as well as line style. Barline data is on the same level as the other musical data in a score - a child of a measure in a partwise score, or a part in a timewise score. This allows for barlines within measures, as in dotted barlines that subdivide measures in complex meters. The two fermata elements allow for fermatas on both sides of the barline (the lower one inverted).
-- 	
-- Barlines have a location attribute to make it easier to process barlines independently of the other musical data in a score. It is often easier to set up measures separately from entering notes. The location attribute must match where the barline element occurs within the rest of the musical data in the score. If location is left, it should be the first element in the measure, aside from the print, bookmark, and link elements. If location is right, it should be the last element, again with the possible exception of the print, bookmark, and link elements. If no location is specified, the right barline is the default. The segno, coda, and divisions attributes work the same way as in the sound element. They are used for playback when barline elements contain segno or coda child elements.
data Barline = 
      Barline {
          barlineLocation :: (Maybe RightLeftMiddle) -- ^ /location/ attribute
        , barlineSegno :: (Maybe Token) -- ^ /segno/ attribute
        , barlineCoda :: (Maybe Token) -- ^ /coda/ attribute
        , barlineDivisions :: (Maybe Divisions) -- ^ /divisions/ attribute
        , barlineBarStyle :: (Maybe BarStyleColor) -- ^ /bar-style/ child element
        , barlineEditorial :: Editorial
        , barlineWavyLine :: (Maybe WavyLine) -- ^ /wavy-line/ child element
        , barlineSegno1 :: (Maybe EmptyPrintStyle) -- ^ /segno/ child element
        , barlineCoda1 :: (Maybe EmptyPrintStyle) -- ^ /coda/ child element
        , barlineFermata :: [Fermata] -- ^ /fermata/ child element
        , barlineEnding :: (Maybe Ending) -- ^ /ending/ child element
        , barlineRepeat :: (Maybe Repeat) -- ^ /repeat/ child element
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Barline where
    emitXml (Barline a b c d e f g h i j k l) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "location" Nothing).emitXml) a] ++
        [maybe XEmpty (XAttr (QN "segno" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "coda" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "divisions" Nothing).emitXml) d])
        ([maybe XEmpty (XElement (QN "bar-style" Nothing).emitXml) e] ++
        [emitXml f] ++
        [maybe XEmpty (XElement (QN "wavy-line" Nothing).emitXml) g] ++
        [maybe XEmpty (XElement (QN "segno" Nothing).emitXml) h] ++
        [maybe XEmpty (XElement (QN "coda" Nothing).emitXml) i] ++
        map (XElement (QN "fermata" Nothing).emitXml) j ++
        [maybe XEmpty (XElement (QN "ending" Nothing).emitXml) k] ++
        [maybe XEmpty (XElement (QN "repeat" Nothing).emitXml) l])
parseBarline :: P.XParse Barline
parseBarline = 
      Barline
        <$> P.optional (P.xattr (P.name "location") >>= parseRightLeftMiddle)
        <*> P.optional (P.xattr (P.name "segno") >>= parseToken)
        <*> P.optional (P.xattr (P.name "coda") >>= parseToken)
        <*> P.optional (P.xattr (P.name "divisions") >>= parseDivisions)
        <*> P.optional (P.xchild (P.name "bar-style") (parseBarStyleColor))
        <*> parseEditorial
        <*> P.optional (P.xchild (P.name "wavy-line") (parseWavyLine))
        <*> P.optional (P.xchild (P.name "segno") (parseEmptyPrintStyle))
        <*> P.optional (P.xchild (P.name "coda") (parseEmptyPrintStyle))
        <*> P.many (P.xchild (P.name "fermata") (parseFermata))
        <*> P.optional (P.xchild (P.name "ending") (parseEnding))
        <*> P.optional (P.xchild (P.name "repeat") (parseRepeat))

-- | Smart constructor for 'Barline'
mkBarline :: Editorial -> Barline
mkBarline f = Barline Nothing Nothing Nothing Nothing Nothing f Nothing Nothing Nothing [] Nothing Nothing

-- | @barre@ /(complex)/
--
-- The barre element indicates placing a finger over multiple strings on a single fret. The type is "start" for the lowest pitched string (e.g., the string with the highest MusicXML number) and is "stop" for the highest pitched string.
data Barre = 
      Barre {
          barreType :: StartStop -- ^ /type/ attribute
        , barreColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Barre where
    emitXml (Barre a b) =
      XContent XEmpty
        ([XAttr (QN "type" Nothing) (emitXml a)] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) b])
        []
parseBarre :: P.XParse Barre
parseBarre = 
      Barre
        <$> (P.xattr (P.name "type") >>= parseStartStop)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'Barre'
mkBarre :: StartStop -> Barre
mkBarre a = Barre a Nothing

-- | @bass@ /(complex)/
--
-- The bass type is used to indicate a bass note in popular music chord symbols, e.g. G/C. It is generally not used in functional harmony, as inversion is generally not used in pop chord symbols. As with root, it is divided into step and alter elements, similar to pitches.
data Bass = 
      Bass {
          bassBassStep :: BassStep -- ^ /bass-step/ child element
        , bassBassAlter :: (Maybe BassAlter) -- ^ /bass-alter/ child element
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Bass where
    emitXml (Bass a b) =
      XContent XEmpty
        []
        ([XElement (QN "bass-step" Nothing) (emitXml a)] ++
        [maybe XEmpty (XElement (QN "bass-alter" Nothing).emitXml) b])
parseBass :: P.XParse Bass
parseBass = 
      Bass
        <$> (P.xchild (P.name "bass-step") (parseBassStep))
        <*> P.optional (P.xchild (P.name "bass-alter") (parseBassAlter))

-- | Smart constructor for 'Bass'
mkBass :: BassStep -> Bass
mkBass a = Bass a Nothing

-- | @bass-alter@ /(complex)/
--
-- The bass-alter type represents the chromatic alteration of the bass of the current chord within the harmony element. In some chord styles, the text for the bass-step element may include bass-alter information. In that case, the print-object attribute of the bass-alter element can be set to no. The location attribute indicates whether the alteration should appear to the left or the right of the bass-step; it is right by default.
data BassAlter = 
      BassAlter {
          bassAlterSemitones :: Semitones -- ^ text content
        , bassAlterLocation :: (Maybe LeftRight) -- ^ /location/ attribute
        , bassAlterPrintObject :: (Maybe YesNo) -- ^ /print-object/ attribute
        , bassAlterDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , bassAlterDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , bassAlterRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , bassAlterRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , bassAlterFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , bassAlterFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , bassAlterFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , bassAlterFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , bassAlterColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml BassAlter where
    emitXml (BassAlter a b c d e f g h i j k l) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "location" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "print-object" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) k] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) l])
        []
parseBassAlter :: P.XParse BassAlter
parseBassAlter = 
      BassAlter
        <$> (P.xtext >>= parseSemitones)
        <*> P.optional (P.xattr (P.name "location") >>= parseLeftRight)
        <*> P.optional (P.xattr (P.name "print-object") >>= parseYesNo)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'BassAlter'
mkBassAlter :: Semitones -> BassAlter
mkBassAlter a = BassAlter a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @bass-step@ /(complex)/
--
-- The bass-step type represents the pitch step of the bass of the current chord within the harmony element. The text attribute indicates how the bass should appear on the page if not using the element contents.
data BassStep = 
      BassStep {
          bassStepStep :: Step -- ^ text content
        , bassStepText :: (Maybe Token) -- ^ /text/ attribute
        , bassStepDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , bassStepDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , bassStepRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , bassStepRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , bassStepFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , bassStepFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , bassStepFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , bassStepFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , bassStepColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml BassStep where
    emitXml (BassStep a b c d e f g h i j k) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "text" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) k])
        []
parseBassStep :: P.XParse BassStep
parseBassStep = 
      BassStep
        <$> (P.xtext >>= parseStep)
        <*> P.optional (P.xattr (P.name "text") >>= parseToken)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'BassStep'
mkBassStep :: Step -> BassStep
mkBassStep a = BassStep a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @beam@ /(complex)/
--
-- Beam values include begin, continue, end, forward hook, and backward hook. Up to six concurrent beam levels are available to cover up to 256th notes. The repeater attribute, used for tremolos, needs to be specified with a "yes" value for each beam using it. Beams that have a begin value can also have a fan attribute to indicate accelerandos and ritardandos using fanned beams. The fan attribute may also be used with a continue value if the fanning direction changes on that note. The value is "none" if not specified.
-- 	
-- Note that the beam number does not distinguish sets of beams that overlap, as it does for slur and other elements. Beaming groups are distinguished by being in different voices and/or the presence or absence of grace and cue elements.
data Beam = 
      Beam {
          beamBeamValue :: BeamValue -- ^ text content
        , beamNumber :: (Maybe BeamLevel) -- ^ /number/ attribute
        , beamRepeater :: (Maybe YesNo) -- ^ /repeater/ attribute
        , beamFan :: (Maybe Fan) -- ^ /fan/ attribute
        , beamColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Beam where
    emitXml (Beam a b c d e) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "number" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "repeater" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "fan" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) e])
        []
parseBeam :: P.XParse Beam
parseBeam = 
      Beam
        <$> (P.xtext >>= parseBeamValue)
        <*> P.optional (P.xattr (P.name "number") >>= parseBeamLevel)
        <*> P.optional (P.xattr (P.name "repeater") >>= parseYesNo)
        <*> P.optional (P.xattr (P.name "fan") >>= parseFan)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'Beam'
mkBeam :: BeamValue -> Beam
mkBeam a = Beam a Nothing Nothing Nothing Nothing

-- | @beat-repeat@ /(complex)/
--
-- The beat-repeat type is used to indicate that a single beat (but possibly many notes) is repeated. Both the start and stop of the beat being repeated should be specified. The slashes attribute specifies the number of slashes to use in the symbol. The use-dots attribute indicates whether or not to use dots as well (for instance, with mixed rhythm patterns). By default, the value for slashes is 1 and the value for use-dots is no.
-- 	
-- The beat-repeat element specifies a notation style for repetitions. The actual music being repeated needs to be repeated within the MusicXML file. This element specifies the notation that indicates the repeat.
data BeatRepeat = 
      BeatRepeat {
          beatRepeatType :: StartStop -- ^ /type/ attribute
        , beatRepeatSlashes :: (Maybe PositiveInteger) -- ^ /slashes/ attribute
        , beatRepeatUseDots :: (Maybe YesNo) -- ^ /use-dots/ attribute
        , beatRepeatSlash :: (Maybe Slash)
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml BeatRepeat where
    emitXml (BeatRepeat a b c d) =
      XContent XEmpty
        ([XAttr (QN "type" Nothing) (emitXml a)] ++
        [maybe XEmpty (XAttr (QN "slashes" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "use-dots" Nothing).emitXml) c])
        ([emitXml d])
parseBeatRepeat :: P.XParse BeatRepeat
parseBeatRepeat = 
      BeatRepeat
        <$> (P.xattr (P.name "type") >>= parseStartStop)
        <*> P.optional (P.xattr (P.name "slashes") >>= parsePositiveInteger)
        <*> P.optional (P.xattr (P.name "use-dots") >>= parseYesNo)
        <*> P.optional (parseSlash)

-- | Smart constructor for 'BeatRepeat'
mkBeatRepeat :: StartStop -> BeatRepeat
mkBeatRepeat a = BeatRepeat a Nothing Nothing Nothing

-- | @bend@ /(complex)/
--
-- The bend type is used in guitar and tablature. The bend-alter element indicates the number of steps in the bend, similar to the alter element. As with the alter element, numbers like 0.5 can be used to indicate microtones. Negative numbers indicate pre-bends or releases; the pre-bend and release elements are used to distinguish what is intended. A with-bar element indicates that the bend is to be done at the bridge with a whammy or vibrato bar. The content of the element indicates how this should be notated.
data Bend = 
      Bend {
          bendDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , bendDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , bendRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , bendRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , bendFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , bendFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , bendFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , bendFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , bendColor :: (Maybe Color) -- ^ /color/ attribute
        , bendAccelerate :: (Maybe YesNo) -- ^ /accelerate/ attribute
        , bendBeats :: (Maybe TrillBeats) -- ^ /beats/ attribute
        , bendFirstBeat :: (Maybe Percent) -- ^ /first-beat/ attribute
        , bendLastBeat :: (Maybe Percent) -- ^ /last-beat/ attribute
        , bendBendAlter :: Semitones -- ^ /bend-alter/ child element
        , bendBend :: (Maybe ChxBend)
        , bendWithBar :: (Maybe PlacementText) -- ^ /with-bar/ child element
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Bend where
    emitXml (Bend a b c d e f g h i j k l m n o p) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) a] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "accelerate" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "beats" Nothing).emitXml) k] ++
        [maybe XEmpty (XAttr (QN "first-beat" Nothing).emitXml) l] ++
        [maybe XEmpty (XAttr (QN "last-beat" Nothing).emitXml) m])
        ([XElement (QN "bend-alter" Nothing) (emitXml n)] ++
        [emitXml o] ++
        [maybe XEmpty (XElement (QN "with-bar" Nothing).emitXml) p])
parseBend :: P.XParse Bend
parseBend = 
      Bend
        <$> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)
        <*> P.optional (P.xattr (P.name "accelerate") >>= parseYesNo)
        <*> P.optional (P.xattr (P.name "beats") >>= parseTrillBeats)
        <*> P.optional (P.xattr (P.name "first-beat") >>= parsePercent)
        <*> P.optional (P.xattr (P.name "last-beat") >>= parsePercent)
        <*> (P.xchild (P.name "bend-alter") (P.xtext >>= parseSemitones))
        <*> P.optional (parseChxBend)
        <*> P.optional (P.xchild (P.name "with-bar") (parsePlacementText))

-- | Smart constructor for 'Bend'
mkBend :: Semitones -> Bend
mkBend n = Bend Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing n Nothing Nothing

-- | @bookmark@ /(complex)/
--
-- The bookmark type serves as a well-defined target for an incoming simple XLink.
data Bookmark = 
      Bookmark {
          bookmarkId :: ID -- ^ /id/ attribute
        , bookmarkName :: (Maybe Token) -- ^ /name/ attribute
        , bookmarkElement :: (Maybe NMTOKEN) -- ^ /element/ attribute
        , bookmarkPosition :: (Maybe PositiveInteger) -- ^ /position/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Bookmark where
    emitXml (Bookmark a b c d) =
      XContent XEmpty
        ([XAttr (QN "id" Nothing) (emitXml a)] ++
        [maybe XEmpty (XAttr (QN "name" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "element" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "position" Nothing).emitXml) d])
        []
parseBookmark :: P.XParse Bookmark
parseBookmark = 
      Bookmark
        <$> (P.xattr (P.name "id") >>= parseID)
        <*> P.optional (P.xattr (P.name "name") >>= parseToken)
        <*> P.optional (P.xattr (P.name "element") >>= parseNMTOKEN)
        <*> P.optional (P.xattr (P.name "position") >>= parsePositiveInteger)

-- | Smart constructor for 'Bookmark'
mkBookmark :: ID -> Bookmark
mkBookmark a = Bookmark a Nothing Nothing Nothing

-- | @bracket@ /(complex)/
--
-- Brackets are combined with words in a variety of modern directions. The line-end attribute specifies if there is a jog up or down (or both), an arrow, or nothing at the start or end of the bracket. If the line-end is up or down, the length of the jog can be specified using the end-length attribute. The line-type is solid by default.
data Bracket = 
      Bracket {
          bracketType :: StartStop -- ^ /type/ attribute
        , bracketNumber :: (Maybe NumberLevel) -- ^ /number/ attribute
        , bracketLineEnd :: LineEnd -- ^ /line-end/ attribute
        , bracketEndLength :: (Maybe Tenths) -- ^ /end-length/ attribute
        , bracketLineType :: (Maybe LineType) -- ^ /line-type/ attribute
        , bracketDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , bracketDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , bracketRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , bracketRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , bracketColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Bracket where
    emitXml (Bracket a b c d e f g h i j) =
      XContent XEmpty
        ([XAttr (QN "type" Nothing) (emitXml a)] ++
        [maybe XEmpty (XAttr (QN "number" Nothing).emitXml) b] ++
        [XAttr (QN "line-end" Nothing) (emitXml c)] ++
        [maybe XEmpty (XAttr (QN "end-length" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "line-type" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) j])
        []
parseBracket :: P.XParse Bracket
parseBracket = 
      Bracket
        <$> (P.xattr (P.name "type") >>= parseStartStop)
        <*> P.optional (P.xattr (P.name "number") >>= parseNumberLevel)
        <*> (P.xattr (P.name "line-end") >>= parseLineEnd)
        <*> P.optional (P.xattr (P.name "end-length") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "line-type") >>= parseLineType)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'Bracket'
mkBracket :: StartStop -> LineEnd -> Bracket
mkBracket a c = Bracket a Nothing c Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @cancel@ /(complex)/
--
-- A cancel element indicates that the old key signature should be cancelled before the new one appears. This will always happen when changing to C major or A minor and need not be specified then. The cancel value matches the fifths value of the cancelled key signature (e.g., a cancel of -2 will provide an explicit cancellation for changing from B flat major to F major). The optional location attribute indicates whether the cancellation appears to the left or the right of the new key signature. It is left by default.
data Cancel = 
      Cancel {
          cancelFifths :: Fifths -- ^ text content
        , cancelLocation :: (Maybe LeftRight) -- ^ /location/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Cancel where
    emitXml (Cancel a b) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "location" Nothing).emitXml) b])
        []
parseCancel :: P.XParse Cancel
parseCancel = 
      Cancel
        <$> (P.xtext >>= parseFifths)
        <*> P.optional (P.xattr (P.name "location") >>= parseLeftRight)

-- | Smart constructor for 'Cancel'
mkCancel :: Fifths -> Cancel
mkCancel a = Cancel a Nothing

-- | @clef@ /(complex)/
--
-- Clefs are represented by a combination of sign, line, and clef-octave-change elements. The optional number attribute refers to staff numbers within the part. A value of 1 is assumed if not present.
-- 
-- Sometimes clefs are added to the staff in non-standard line positions, either to indicate cue passages, or when there are multiple clefs present simultaneously on one staff. In this situation, the additional attribute is set to "yes" and the line value is ignored. The size attribute is used for clefs where the additional attribute is "yes". It is typically used to indicate cue clefs.
data Clef = 
      Clef {
          clefNumber :: (Maybe StaffNumber) -- ^ /number/ attribute
        , clefAdditional :: (Maybe YesNo) -- ^ /additional/ attribute
        , clefSize :: (Maybe SymbolSize) -- ^ /size/ attribute
        , clefDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , clefDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , clefRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , clefRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , clefFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , clefFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , clefFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , clefFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , clefColor :: (Maybe Color) -- ^ /color/ attribute
        , clefPrintObject :: (Maybe YesNo) -- ^ /print-object/ attribute
        , clefSign :: ClefSign -- ^ /sign/ child element
        , clefLine :: (Maybe StaffLine) -- ^ /line/ child element
        , clefClefOctaveChange :: (Maybe Int) -- ^ /clef-octave-change/ child element
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Clef where
    emitXml (Clef a b c d e f g h i j k l m n o p) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "number" Nothing).emitXml) a] ++
        [maybe XEmpty (XAttr (QN "additional" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "size" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) k] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) l] ++
        [maybe XEmpty (XAttr (QN "print-object" Nothing).emitXml) m])
        ([XElement (QN "sign" Nothing) (emitXml n)] ++
        [maybe XEmpty (XElement (QN "line" Nothing).emitXml) o] ++
        [maybe XEmpty (XElement (QN "clef-octave-change" Nothing).emitXml) p])
parseClef :: P.XParse Clef
parseClef = 
      Clef
        <$> P.optional (P.xattr (P.name "number") >>= parseStaffNumber)
        <*> P.optional (P.xattr (P.name "additional") >>= parseYesNo)
        <*> P.optional (P.xattr (P.name "size") >>= parseSymbolSize)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)
        <*> P.optional (P.xattr (P.name "print-object") >>= parseYesNo)
        <*> (P.xchild (P.name "sign") (P.xtext >>= parseClefSign))
        <*> P.optional (P.xchild (P.name "line") (P.xtext >>= parseStaffLine))
        <*> P.optional (P.xchild (P.name "clef-octave-change") (P.xtext >>= (P.xread "Integer")))

-- | Smart constructor for 'Clef'
mkClef :: ClefSign -> Clef
mkClef n = Clef Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing n Nothing Nothing

-- | @credit@ /(complex)/
--
-- The credit type represents the appearance of the title, composer, arranger, lyricist, copyright, dedication, and other text and graphics that commonly appears on the first page of a score. The credit-words and credit-image elements are similar to the words and image elements for directions. However, since the credit is not part of a measure, the default-x and default-y attributes adjust the origin relative to the bottom left-hand corner of the first page. The enclosure for credit-words is none by default.
-- 	
-- By default, a series of credit-words elements within a single credit element follow one another in sequence visually. Non-positional formatting attributes are carried over from the previous element by default.
-- 	
-- The page attribute for the credit element, new in Version 2.0, specifies the page number where the credit should appear. This is an integer value that starts with 1 for the first page. Its value is 1 by default. Since credits occur before the music, these page numbers do not refer to the page numbering specified by the print element's page-number attribute.
data Credit = 
      Credit {
          creditPage :: (Maybe PositiveInteger) -- ^ /page/ attribute
        , creditLink :: [Link] -- ^ /link/ child element
        , creditBookmark :: [Bookmark] -- ^ /bookmark/ child element
        , creditCredit :: ChxCredit
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Credit where
    emitXml (Credit a b c d) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "page" Nothing).emitXml) a])
        (map (XElement (QN "link" Nothing).emitXml) b ++
        map (XElement (QN "bookmark" Nothing).emitXml) c ++
        [emitXml d])
parseCredit :: P.XParse Credit
parseCredit = 
      Credit
        <$> P.optional (P.xattr (P.name "page") >>= parsePositiveInteger)
        <*> P.many (P.xchild (P.name "link") (parseLink))
        <*> P.many (P.xchild (P.name "bookmark") (parseBookmark))
        <*> parseChxCredit

-- | Smart constructor for 'Credit'
mkCredit :: ChxCredit -> Credit
mkCredit d = Credit Nothing [] [] d

-- | @dashes@ /(complex)/
--
-- The dashes type represents dashes, used for instance with cresc. and dim. marks.
data Dashes = 
      Dashes {
          dashesType :: StartStop -- ^ /type/ attribute
        , dashesNumber :: (Maybe NumberLevel) -- ^ /number/ attribute
        , dashesDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , dashesDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , dashesRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , dashesRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , dashesColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Dashes where
    emitXml (Dashes a b c d e f g) =
      XContent XEmpty
        ([XAttr (QN "type" Nothing) (emitXml a)] ++
        [maybe XEmpty (XAttr (QN "number" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) g])
        []
parseDashes :: P.XParse Dashes
parseDashes = 
      Dashes
        <$> (P.xattr (P.name "type") >>= parseStartStop)
        <*> P.optional (P.xattr (P.name "number") >>= parseNumberLevel)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'Dashes'
mkDashes :: StartStop -> Dashes
mkDashes a = Dashes a Nothing Nothing Nothing Nothing Nothing Nothing

-- | @defaults@ /(complex)/
--
-- The defaults type specifies score-wide defaults for scaling, layout, and appearance.
data Defaults = 
      Defaults {
          defaultsScaling :: (Maybe Scaling) -- ^ /scaling/ child element
        , defaultsLayout :: Layout
        , defaultsAppearance :: (Maybe Appearance) -- ^ /appearance/ child element
        , defaultsMusicFont :: (Maybe EmptyFont) -- ^ /music-font/ child element
        , defaultsWordFont :: (Maybe EmptyFont) -- ^ /word-font/ child element
        , defaultsLyricFont :: [LyricFont] -- ^ /lyric-font/ child element
        , defaultsLyricLanguage :: [LyricLanguage] -- ^ /lyric-language/ child element
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Defaults where
    emitXml (Defaults a b c d e f g) =
      XContent XEmpty
        []
        ([maybe XEmpty (XElement (QN "scaling" Nothing).emitXml) a] ++
        [emitXml b] ++
        [maybe XEmpty (XElement (QN "appearance" Nothing).emitXml) c] ++
        [maybe XEmpty (XElement (QN "music-font" Nothing).emitXml) d] ++
        [maybe XEmpty (XElement (QN "word-font" Nothing).emitXml) e] ++
        map (XElement (QN "lyric-font" Nothing).emitXml) f ++
        map (XElement (QN "lyric-language" Nothing).emitXml) g)
parseDefaults :: P.XParse Defaults
parseDefaults = 
      Defaults
        <$> P.optional (P.xchild (P.name "scaling") (parseScaling))
        <*> parseLayout
        <*> P.optional (P.xchild (P.name "appearance") (parseAppearance))
        <*> P.optional (P.xchild (P.name "music-font") (parseEmptyFont))
        <*> P.optional (P.xchild (P.name "word-font") (parseEmptyFont))
        <*> P.many (P.xchild (P.name "lyric-font") (parseLyricFont))
        <*> P.many (P.xchild (P.name "lyric-language") (parseLyricLanguage))

-- | Smart constructor for 'Defaults'
mkDefaults :: Layout -> Defaults
mkDefaults b = Defaults Nothing b Nothing Nothing Nothing [] []

-- | @degree@ /(complex)/
--
-- The degree type is used to add, alter, or subtract individual notes in the chord. The print-object attribute can be used to keep the degree from printing separately when it has already taken into account in the text attribute of the kind element. The degree-value and degree-type text attributes specify how the value and type of the degree should be displayed.
-- 	
-- A harmony of kind "other" can be spelled explicitly by using a series of degree elements together with a root.
data Degree = 
      Degree {
          degreePrintObject :: (Maybe YesNo) -- ^ /print-object/ attribute
        , degreeDegreeValue :: DegreeValue -- ^ /degree-value/ child element
        , degreeDegreeAlter :: DegreeAlter -- ^ /degree-alter/ child element
        , degreeDegreeType :: DegreeType -- ^ /degree-type/ child element
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Degree where
    emitXml (Degree a b c d) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "print-object" Nothing).emitXml) a])
        ([XElement (QN "degree-value" Nothing) (emitXml b)] ++
        [XElement (QN "degree-alter" Nothing) (emitXml c)] ++
        [XElement (QN "degree-type" Nothing) (emitXml d)])
parseDegree :: P.XParse Degree
parseDegree = 
      Degree
        <$> P.optional (P.xattr (P.name "print-object") >>= parseYesNo)
        <*> (P.xchild (P.name "degree-value") (parseDegreeValue))
        <*> (P.xchild (P.name "degree-alter") (parseDegreeAlter))
        <*> (P.xchild (P.name "degree-type") (parseDegreeType))

-- | Smart constructor for 'Degree'
mkDegree :: DegreeValue -> DegreeAlter -> DegreeType -> Degree
mkDegree b c d = Degree Nothing b c d

-- | @degree-alter@ /(complex)/
--
-- The degree-alter type represents the chromatic alteration for the current degree. If the degree-type value is alter or subtract, the degree-alter value is relative to the degree already in the chord based on its kind element. If the degree-type value is add, the degree-alter is relative to a dominant chord (major and perfect intervals except for a minor seventh). The plus-minus attribute is used to indicate if plus and minus symbols should be used instead of sharp and flat symbols to display the degree alteration; it is no by default.
data DegreeAlter = 
      DegreeAlter {
          degreeAlterSemitones :: Semitones -- ^ text content
        , degreeAlterPlusMinus :: (Maybe YesNo) -- ^ /plus-minus/ attribute
        , degreeAlterDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , degreeAlterDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , degreeAlterRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , degreeAlterRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , degreeAlterFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , degreeAlterFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , degreeAlterFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , degreeAlterFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , degreeAlterColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml DegreeAlter where
    emitXml (DegreeAlter a b c d e f g h i j k) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "plus-minus" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) k])
        []
parseDegreeAlter :: P.XParse DegreeAlter
parseDegreeAlter = 
      DegreeAlter
        <$> (P.xtext >>= parseSemitones)
        <*> P.optional (P.xattr (P.name "plus-minus") >>= parseYesNo)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'DegreeAlter'
mkDegreeAlter :: Semitones -> DegreeAlter
mkDegreeAlter a = DegreeAlter a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @degree-type@ /(complex)/
--
-- The degree-type type indicates if this degree is an addition, alteration, or subtraction relative to the kind of the current chord. The value of the degree-type element affects the interpretation of the value of the degree-alter element. The text attribute specifies how the type of the degree should be displayed.
data DegreeType = 
      DegreeType {
          degreeTypeDegreeTypeValue :: DegreeTypeValue -- ^ text content
        , degreeTypeText :: (Maybe Token) -- ^ /text/ attribute
        , degreeTypeDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , degreeTypeDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , degreeTypeRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , degreeTypeRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , degreeTypeFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , degreeTypeFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , degreeTypeFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , degreeTypeFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , degreeTypeColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml DegreeType where
    emitXml (DegreeType a b c d e f g h i j k) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "text" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) k])
        []
parseDegreeType :: P.XParse DegreeType
parseDegreeType = 
      DegreeType
        <$> (P.xtext >>= parseDegreeTypeValue)
        <*> P.optional (P.xattr (P.name "text") >>= parseToken)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'DegreeType'
mkDegreeType :: DegreeTypeValue -> DegreeType
mkDegreeType a = DegreeType a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @degree-value@ /(complex)/
--
-- The content of the degree-value type is a number indicating the degree of the chord (1 for the root, 3 for third, etc). The text attribute specifies how the type of the degree should be displayed.
data DegreeValue = 
      DegreeValue {
          degreeValuePositiveInteger :: PositiveInteger -- ^ text content
        , degreeValueText :: (Maybe Token) -- ^ /text/ attribute
        , degreeValueDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , degreeValueDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , degreeValueRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , degreeValueRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , degreeValueFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , degreeValueFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , degreeValueFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , degreeValueFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , degreeValueColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml DegreeValue where
    emitXml (DegreeValue a b c d e f g h i j k) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "text" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) k])
        []
parseDegreeValue :: P.XParse DegreeValue
parseDegreeValue = 
      DegreeValue
        <$> (P.xtext >>= parsePositiveInteger)
        <*> P.optional (P.xattr (P.name "text") >>= parseToken)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'DegreeValue'
mkDegreeValue :: PositiveInteger -> DegreeValue
mkDegreeValue a = DegreeValue a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @direction@ /(complex)/
--
-- A direction is a musical indication that is not attached to a specific note. Two or more may be combined to indicate starts and stops of wedges, dashes, etc.
-- 	
-- By default, a series of direction-type elements and a series of child elements of a direction-type within a single direction element follow one another in sequence visually. For a series of direction-type children, non-positional formatting attributes are carried over from the previous element by default.
data Direction = 
      Direction {
          directionPlacement :: (Maybe AboveBelow) -- ^ /placement/ attribute
        , directionDirective :: (Maybe YesNo) -- ^ /directive/ attribute
        , directionDirectionType :: [DirectionType] -- ^ /direction-type/ child element
        , directionOffset :: (Maybe Offset) -- ^ /offset/ child element
        , directionEditorialVoiceDirection :: EditorialVoiceDirection
        , directionStaff :: (Maybe Staff)
        , directionSound :: (Maybe Sound) -- ^ /sound/ child element
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Direction where
    emitXml (Direction a b c d e f g) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "placement" Nothing).emitXml) a] ++
        [maybe XEmpty (XAttr (QN "directive" Nothing).emitXml) b])
        (map (XElement (QN "direction-type" Nothing).emitXml) c ++
        [maybe XEmpty (XElement (QN "offset" Nothing).emitXml) d] ++
        [emitXml e] ++
        [emitXml f] ++
        [maybe XEmpty (XElement (QN "sound" Nothing).emitXml) g])
parseDirection :: P.XParse Direction
parseDirection = 
      Direction
        <$> P.optional (P.xattr (P.name "placement") >>= parseAboveBelow)
        <*> P.optional (P.xattr (P.name "directive") >>= parseYesNo)
        <*> P.many (P.xchild (P.name "direction-type") (parseDirectionType))
        <*> P.optional (P.xchild (P.name "offset") (parseOffset))
        <*> parseEditorialVoiceDirection
        <*> P.optional (parseStaff)
        <*> P.optional (P.xchild (P.name "sound") (parseSound))

-- | Smart constructor for 'Direction'
mkDirection :: EditorialVoiceDirection -> Direction
mkDirection e = Direction Nothing Nothing [] Nothing e Nothing Nothing

-- | @direction-type@ /(complex)/
--
-- Textual direction types may have more than 1 component due to multiple fonts. The dynamics element may also be used in the notations element. Attribute groups related to print suggestions apply to the individual direction-type, not to the overall direction.
data DirectionType = 
      DirectionType {
          directionTypeDirectionType :: ChxDirectionType
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml DirectionType where
    emitXml (DirectionType a) =
      XReps [emitXml a]
parseDirectionType :: P.XParse DirectionType
parseDirectionType = 
      DirectionType
        <$> parseChxDirectionType

-- | Smart constructor for 'DirectionType'
mkDirectionType :: ChxDirectionType -> DirectionType
mkDirectionType a = DirectionType a

-- | @directive@ /(complex)/
data Directive = 
      Directive {
          directiveString :: String -- ^ text content
        , directiveLang :: (Maybe Lang) -- ^ /xml:lang/ attribute
        , directiveDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , directiveDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , directiveRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , directiveRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , directiveFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , directiveFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , directiveFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , directiveFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , directiveColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Directive where
    emitXml (Directive a b c d e f g h i j k) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "lang" (Just "xml")).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) k])
        []
parseDirective :: P.XParse Directive
parseDirective = 
      Directive
        <$> (P.xtext >>= return)
        <*> P.optional (P.xattr (P.name "xml:lang") >>= parseLang)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'Directive'
mkDirective :: String -> Directive
mkDirective a = Directive a Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @display-step-octave@ /(complex)/
--
-- The display-step-octave type contains the sequence of elements used by both the rest and unpitched elements. This group is used to place rests and unpitched elements on the staff without implying that these elements have pitch. Positioning follows the current clef. If percussion clef is used, the display-step and display-octave elements are interpreted as if in treble clef, with a G in octave 4 on line 2. If not present, the note is placed on the middle line of the staff, generally used for one-line staffs.
data DisplayStepOctave = 
      DisplayStepOctave {
          displayStepOctaveDisplayStepOctave :: (Maybe SeqDisplayStepOctave)
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml DisplayStepOctave where
    emitXml (DisplayStepOctave a) =
      XReps [emitXml a]
parseDisplayStepOctave :: P.XParse DisplayStepOctave
parseDisplayStepOctave = 
      DisplayStepOctave
        <$> P.optional (parseSeqDisplayStepOctave)

-- | Smart constructor for 'DisplayStepOctave'
mkDisplayStepOctave :: DisplayStepOctave
mkDisplayStepOctave = DisplayStepOctave Nothing

-- | @dynamics@ /(complex)/
--
-- Dynamics can be associated either with a note or a general musical direction. To avoid inconsistencies between and amongst the letter abbreviations for dynamics (what is sf vs. sfz, standing alone or with a trailing dynamic that is not always piano), we use the actual letters as the names of these dynamic elements. The other-dynamics element allows other dynamic marks that are not covered here, but many of those should perhaps be included in a more general musical direction element. Dynamics elements may also be combined to create marks not covered by a single element, such as sfmp.
-- 	
-- These letter dynamic symbols are separated from crescendo, decrescendo, and wedge indications. Dynamic representation is inconsistent in scores. Many things are assumed by the composer and left out, such as returns to original dynamics. Systematic representations are quite complex: for example, Humdrum has at least 3 representation formats related to dynamics. The MusicXML format captures what is in the score, but does not try to be optimal for analysis or synthesis of dynamics.
data Dynamics = 
      Dynamics {
          dynamicsDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , dynamicsDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , dynamicsRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , dynamicsRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , dynamicsFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , dynamicsFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , dynamicsFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , dynamicsFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , dynamicsColor :: (Maybe Color) -- ^ /color/ attribute
        , dynamicsPlacement :: (Maybe AboveBelow) -- ^ /placement/ attribute
        , dynamicsDynamics :: [ChxDynamics]
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Dynamics where
    emitXml (Dynamics a b c d e f g h i j k) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) a] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "placement" Nothing).emitXml) j])
        ([emitXml k])
parseDynamics :: P.XParse Dynamics
parseDynamics = 
      Dynamics
        <$> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)
        <*> P.optional (P.xattr (P.name "placement") >>= parseAboveBelow)
        <*> P.many (parseChxDynamics)

-- | Smart constructor for 'Dynamics'
mkDynamics :: Dynamics
mkDynamics = Dynamics Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing []

-- | @elision@ /(complex)/
--
-- In Version 2.0, the content of the elision type is used to specify the symbol used to display the elision. Common values are a no-break space (Unicode 00A0), an underscore (Unicode 005F), or an undertie (Unicode 203F).
data Elision = 
      Elision {
          elisionString :: String -- ^ text content
        , elisionFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , elisionFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , elisionFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , elisionFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , elisionColor :: (Maybe Color) -- ^ /color/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Elision where
    emitXml (Elision a b c d e f) =
      XContent (emitXml a)
        ([maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) f])
        []
parseElision :: P.XParse Elision
parseElision = 
      Elision
        <$> (P.xtext >>= return)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)

-- | Smart constructor for 'Elision'
mkElision :: String -> Elision
mkElision a = Elision a Nothing Nothing Nothing Nothing Nothing

-- | @empty@ /(complex)/
--
-- The empty type represents an empty element with no attributes.
data Empty = 
      Empty
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml Empty where
    emitXml (Empty) =
      XReps []
parseEmpty :: P.XParse Empty
parseEmpty = 
      return Empty

-- | Smart constructor for 'Empty'
mkEmpty :: Empty
mkEmpty = Empty 

-- | @empty-font@ /(complex)/
--
-- The empty-font type represents an empty element with font attributes.
data EmptyFont = 
      EmptyFont {
          emptyFontFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , emptyFontFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , emptyFontFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , emptyFontFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml EmptyFont where
    emitXml (EmptyFont a b c d) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) a] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) d])
        []
parseEmptyFont :: P.XParse EmptyFont
parseEmptyFont = 
      EmptyFont
        <$> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)

-- | Smart constructor for 'EmptyFont'
mkEmptyFont :: EmptyFont
mkEmptyFont = EmptyFont Nothing Nothing Nothing Nothing

-- | @empty-line@ /(complex)/
--
-- The empty-line type represents an empty element with line-shape, line-type, print-style and placement attributes.
data EmptyLine = 
      EmptyLine {
          emptyLineLineShape :: (Maybe LineShape) -- ^ /line-shape/ attribute
        , emptyLineLineType :: (Maybe LineType) -- ^ /line-type/ attribute
        , emptyLineDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , emptyLineDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , emptyLineRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , emptyLineRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , emptyLineFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , emptyLineFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , emptyLineFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , emptyLineFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , emptyLineColor :: (Maybe Color) -- ^ /color/ attribute
        , emptyLinePlacement :: (Maybe AboveBelow) -- ^ /placement/ attribute
       }
    deriving (Eq,Typeable,Generic,Show)
instance EmitXml EmptyLine where
    emitXml (EmptyLine a b c d e f g h i j k l) =
      XContent XEmpty
        ([maybe XEmpty (XAttr (QN "line-shape" Nothing).emitXml) a] ++
        [maybe XEmpty (XAttr (QN "line-type" Nothing).emitXml) b] ++
        [maybe XEmpty (XAttr (QN "default-x" Nothing).emitXml) c] ++
        [maybe XEmpty (XAttr (QN "default-y" Nothing).emitXml) d] ++
        [maybe XEmpty (XAttr (QN "relative-x" Nothing).emitXml) e] ++
        [maybe XEmpty (XAttr (QN "relative-y" Nothing).emitXml) f] ++
        [maybe XEmpty (XAttr (QN "font-family" Nothing).emitXml) g] ++
        [maybe XEmpty (XAttr (QN "font-style" Nothing).emitXml) h] ++
        [maybe XEmpty (XAttr (QN "font-size" Nothing).emitXml) i] ++
        [maybe XEmpty (XAttr (QN "font-weight" Nothing).emitXml) j] ++
        [maybe XEmpty (XAttr (QN "color" Nothing).emitXml) k] ++
        [maybe XEmpty (XAttr (QN "placement" Nothing).emitXml) l])
        []
parseEmptyLine :: P.XParse EmptyLine
parseEmptyLine = 
      EmptyLine
        <$> P.optional (P.xattr (P.name "line-shape") >>= parseLineShape)
        <*> P.optional (P.xattr (P.name "line-type") >>= parseLineType)
        <*> P.optional (P.xattr (P.name "default-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "default-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-x") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "relative-y") >>= parseTenths)
        <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText)
        <*> P.optional (P.xattr (P.name "font-style") >>= parseFontStyle)
        <*> P.optional (P.xattr (P.name "font-size") >>= parseFontSize)
        <*> P.optional (P.xattr (P.name "font-weight") >>= parseFontWeight)
        <*> P.optional (P.xattr (P.name "color") >>= parseColor)
        <*> P.optional (P.xattr (P.name "placement") >>= parseAboveBelow)

-- | Smart constructor for 'EmptyLine'
mkEmptyLine :: EmptyLine
mkEmptyLine = EmptyLine Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing

-- | @empty-placement@ /(complex)/
--
-- The empty-placement type represents an empty element with print-style and placement attributes.
data EmptyPlacement = 
      EmptyPlacement {
          emptyPlacementDefaultX :: (Maybe Tenths) -- ^ /default-x/ attribute
        , emptyPlacementDefaultY :: (Maybe Tenths) -- ^ /default-y/ attribute
        , emptyPlacementRelativeX :: (Maybe Tenths) -- ^ /relative-x/ attribute
        , emptyPlacementRelativeY :: (Maybe Tenths) -- ^ /relative-y/ attribute
        , emptyPlacementFontFamily :: (Maybe CommaSeparatedText) -- ^ /font-family/ attribute
        , emptyPlacementFontStyle :: (Maybe FontStyle) -- ^ /font-style/ attribute
        , emptyPlacementFontSize :: (Maybe FontSize) -- ^ /font-size/ attribute
        , emptyPlacementFontWeight :: (Maybe FontWeight) -- ^ /font-weight/ attribute
        , emptyPlacementColor :: (Maybe Color) -- ^ /color/ attribute
        , emptyPlacementPlacement ::