.. _usersGuide_90_musicxmlTest:

.. WARNING: DO NOT EDIT THIS FILE:
   AUTOMATICALLY GENERATED.
   PLEASE EDIT THE .py FILE DIRECTLY.


.. code:: python

    %load_ext music21.ipython21
    from music21 import *

User's Guide, Chapter 90: Lilypond Unofficial MusicXML Test Suite
=================================================================

.. code:: python

    print(musicxml.lilypondTestSuite.__doc__)


.. parsed-literal::
   :class: ipython-result

    
    The Lilypond MusicXML Test Suite comes from 
    http://lilypond.org/doc/v2.18/input/regression/musicxml/collated-files
    
    The test suite is licensed under the MIT license 
    (https://opensource.org/licenses/mit-license.php)
    and copyrighted by the Lilypond project.
    
    Currently this tests only if everything parses without error.  
    It does not check to make sure that it actually works.
    
    One change has been made, to 33g-Slur-ChordedNotes.xml
    which is contains a common incorrect notation but also a very difficult one 
    that music21 can parse if the slur number is changed 
    to "2" for the second incorrect slur
    since music21 parses all notes of a chord before moving to the next.
    


.. code:: python

    import os
    import re
    
    allF = musicxml.lilypondTestSuite.allFiles()
    untested = [f.split(os.sep)[-1] for f in allF]
    scores = {}
    musicxmlOut = {}
    
    def s(i):
        if isinstance(i, int):
            longFp = allF[i]
        else:
            for longFp in allF:
                shortFp = longFp.split(os.sep)[-1] 
                if i in shortFp:
                    break
            else:
                raise Exception("Cannot find: " + str(i))
        shortFp = longFp.split(os.sep)[-1] 
        if shortFp in untested:
            untested.remove(shortFp)
        sc = converter.parse(longFp, forceSource=True)    
        scores[i] = sc
        fp = sc.filePath.split(os.sep)[-1]    
        print(fp + '\n')
        desc = sc.metadata.description
        desc = re.sub(r'\s+', ' ', desc)
        print(desc)
        fpOut = sc.write('musicxml')
        with open(fpOut, 'r') as musicxmlOutFile:
            allOut = musicxmlOutFile.read()
        musicxmlOut[i] = allOut
        return sc.show()


01 ... Pitches
--------------

.. code:: python

    s('01a')


.. parsed-literal::
   :class: ipython-result

    01a-Pitches-Pitches.xml
    
    All pitches from G to c'''' in ascending steps; First without accidentals, then with a sharp and then with a flat accidental, then with explicit natural accidentals. Double alterations and cautionary accidentals are tested at the end.




.. image:: usersGuide_90_musicxmlTest_5_1.png



.. code:: python

    s('01b')


.. parsed-literal::
   :class: ipython-result

    01b-Pitches-Intervals.xml
    
    All pitch intervals in ascending jump size.




.. image:: usersGuide_90_musicxmlTest_6_1.png



.. code:: python

    s('01c')


.. parsed-literal::
   :class: ipython-result

    01c-Pitches-NoVoiceElement.xml
    
    The <voice> element of notes is optional in MusicXML (although Dolet always writes it out). Here, there is one note with lyrics, but without a voice assigned. It should still be correctly converted.




.. image:: usersGuide_90_musicxmlTest_7_1.png



.. code:: python

    s('01d')


.. parsed-literal::
   :class: ipython-result

    01d-Pitches-Microtones.xml
    
    Some microtones: c flat-and-a-half, d half-flat, e half-sharp, f sharp-and-a half. Once in the lower and once in the upper region of the staff.




.. image:: usersGuide_90_musicxmlTest_8_1.png



.. code:: python

    s('01e') # failing


.. parsed-literal::
   :class: ipython-result

    01e-Pitches-ParenthesizedAccidentals.xml
    
    Accidentals can be cautionary or editorial. Each measure has a normal accidental, an editorial, a cautionary and an editioal and cautionary accidental.




.. image:: usersGuide_90_musicxmlTest_9_1.png



.. code:: python

    s('01f') # failing


.. parsed-literal::
   :class: ipython-result

    01f-Pitches-ParenthesizedMicrotoneAccidentals.xml
    
    Microtone accidentals can be cautionary or editorial. Each measure has a normal accidental, an editorial, a cautionary and an editioal and cautionary accidental.




.. image:: usersGuide_90_musicxmlTest_10_1.png



02 ... Rests
------------

.. code:: python

    s('02a')


.. parsed-literal::
   :class: ipython-result

    02a-Rests-Durations.xml
    
    All different rest lengths: A two-bar multi-measure rest, a whole rest, a half, etc. until a 128th-rest; Then the same with dotted durations.




.. image:: usersGuide_90_musicxmlTest_12_1.png



.. code:: python

    s('02b')


.. parsed-literal::
   :class: ipython-result

    02b-Rests-PitchedRests.xml
    
    Rests can have explicit pitches, where they are displayed. The first rest uses no explicit position and should use the default position, all others are explicitly positioned somewhere else.




.. image:: usersGuide_90_musicxmlTest_13_1.png



.. code:: python

    s('02c')


.. parsed-literal::
   :class: ipython-result

    02c-Rests-MultiMeasureRests.xml
    
    Four multi-measure rests: 3 measures, 15 measures, 1 measure, and 12 measures.




.. image:: usersGuide_90_musicxmlTest_14_1.png



.. code:: python

    s('02d')


.. parsed-literal::
   :class: ipython-result

    02d-Rests-Multimeasure-TimeSignatures.xml
    
    Multi-Measure rests should always be converted into durations that are a multiple of the time signature.




.. image:: usersGuide_90_musicxmlTest_15_1.png



.. code:: python

    s('02e')


.. parsed-literal::
   :class: ipython-result

    02e-Rests-NoType.xml
    
    In some cases, a rest might not have its type attribute set (this happens, for example, with voices in Finale, where you don't manually insert a rest).




.. image:: usersGuide_90_musicxmlTest_16_1.png



03 ... Rhythm
-------------

.. code:: python

    s('03aa')


.. parsed-literal::
   :class: ipython-result

    03aa-Rhythm-Durations.xml
    
    All common note durations, from brevis, whole until 64th; First with their plain values, then dotted and finally doubly-dotted (to 32nd).




.. image:: usersGuide_90_musicxmlTest_18_1.png



.. code:: python

    s('03ab')


.. parsed-literal::
   :class: ipython-result

    03ab-Rhythm-Durations.xml
    
    Extreme note durations (pre 3.0): long and 128th; First with their plain values, then dotted and finally doubly-dotted.




.. image:: usersGuide_90_musicxmlTest_19_1.png



.. code:: python

    s('03b') # music21 creates a Rest w/ hideObjectOnPrint in this case.


.. parsed-literal::
   :class: ipython-result

    03b-Rhythm-Backup.xml
    
    Two voices with a backup, that does not jump to the beginning for the measure for voice 2, but somewhere in the middle. Voice 2 thus won't have any notes or rests for the first beat of the measures.




.. image:: usersGuide_90_musicxmlTest_20_1.png



.. code:: python

    s('03c')


.. parsed-literal::
   :class: ipython-result

    03c-Rhythm-DivisionChange.xml
    
    Although uncommon, the divisions of a quarter note can change somewhere in the middle of a MusicXML file. Here, the first half measure uses a division of 1, which then changes to 8 in the middle of the first measure and to 38 in the middle of the second measure.




.. image:: usersGuide_90_musicxmlTest_21_1.png



.. code:: python

    s('03d') # failing on 5/16, 9/8


.. parsed-literal::
   :class: ipython-result

    03d-Rhythm-DottedDurations-Factors.xml
    
    Several durations can be written with dots. For multimeasure rests, we can also have durations that cannot be expressed with dotted notes (like 5/8).




.. image:: usersGuide_90_musicxmlTest_22_1.png



11 ... Time signatures
----------------------

.. code:: python

    s('11a')


.. parsed-literal::
   :class: ipython-result

    11a-TimeSignatures.xml
    
    Various time signatures: 2/2 (alla breve), 4/4 (C), 2/2, 3/2, 2/4, 3/4, 4/4, 5/4, 3/8, 6/8, 12/8




.. image:: usersGuide_90_musicxmlTest_24_1.png



.. code:: python

    s('11b') # failing on additional clef...


.. parsed-literal::
   :class: ipython-result

    11b-TimeSignatures-NoTime.xml
    
    A score without a time signature (but with a key and clefs)




.. image:: usersGuide_90_musicxmlTest_25_1.png



.. code:: python

    s('11c') # failing on beaming of first measure


.. parsed-literal::
   :class: ipython-result

    11c-TimeSignatures-CompoundSimple.xml
    
    Compound time signatures with same denominator: (3+2)/8 and (5+3+1)/4.




.. image:: usersGuide_90_musicxmlTest_26_1.png



.. code:: python

    s('11d') # failing utterly


.. parsed-literal::
   :class: ipython-result

    11d-TimeSignatures-CompoundMultiple.xml
    
    Compound time signatures with separate fractions displayed: 3/8+2/8+3/4 and 5/2+1/8.




.. image:: usersGuide_90_musicxmlTest_27_1.png



.. code:: python

    s('11e') # failing


.. parsed-literal::
   :class: ipython-result

    11e-TimeSignatures-CompoundMixed.xml
    
    Compound time signatures of mixed type: (3+2)/8+3/4.




.. image:: usersGuide_90_musicxmlTest_28_1.png



.. code:: python

    s('11f') # acceptable though different meaning from Lilypond


.. parsed-literal::
   :class: ipython-result

    11f-TimeSignatures-SymbolMeaning.xml
    
    A time signature of 3/8 with the symbol="cut" attribute and two symbol="single-number" attributes with compound time signatures. Shall the symbol be ignored in this case?




.. image:: usersGuide_90_musicxmlTest_29_1.png



.. code:: python

    s('11g') # block: MuseScore


.. parsed-literal::
   :class: ipython-result

    11g-TimeSignatures-SingleNumber.xml
    
    Time signature displayed as a single number.




.. image:: usersGuide_90_musicxmlTest_30_1.png



.. code:: python

    ts = scores['11g'].recurse().getElementsByClass('TimeSignature')[0]
    ts.symbol




.. parsed-literal::
   :class: ipython-result

    'single-number'



.. code:: python

    s('11h')


.. parsed-literal::
   :class: ipython-result

    11h-TimeSignatures-SenzaMisura.xml
    
    Senza-misura time signature




.. image:: usersGuide_90_musicxmlTest_32_1.png



.. code:: python

    sc = scores['11h']
    sc.recurse().getElementsByClass('SenzaMisuraTimeSignature')[0]




.. parsed-literal::
   :class: ipython-result

    <music21.meter.SenzaMisuraTimeSignature>



12 ... Clefs
------------

.. code:: python

    s('12a') # block: MuseScore -- TAB staff.


.. parsed-literal::
   :class: ipython-result

    12a-Clefs.xml
    
    Various clefs: G, C, F, percussion, TAB and none; some are also possible with transposition and on other staff lines than their default (e.g. soprano/alto/tenor/baritone C clefs); Each measure shows a different clef (measure 17 has the "none" clef), only measure 18 has the same treble clef as measure 1.




.. image:: usersGuide_90_musicxmlTest_35_1.png



.. code:: python

    s('12b')


.. parsed-literal::
   :class: ipython-result

    12b-Clefs-NoKeyOrClef.xml
    
    A score without any key or clef defined. The default (4/4 in treble clef) should be used.




.. image:: usersGuide_90_musicxmlTest_36_1.png



13 ... Key signatures
---------------------

.. code:: python

    s('13a') # block: MuseScore


.. parsed-literal::
   :class: ipython-result

    13a-KeySignatures.xml
    
    Various key signature: from 11 flats to 11 sharps (each one first one measure in major, then one measure in minor)




.. image:: usersGuide_90_musicxmlTest_38_1.png



.. code:: python

    print([ks.sharps for ks in scores['13a'].recurse().getElementsByClass('KeySignature')])


.. parsed-literal::
   :class: ipython-result

    [-11, -11, -10, -10, -9, -9, -8, -8, -7, -7, -6, -6, -5, -5, -4, -4, -3, -3, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11]


.. code:: python

    s('13b') # block -- mid-measure key change.


.. parsed-literal::
   :class: ipython-result

    13b-KeySignatures-ChurchModes.xml
    
    All different modes: major, minor, ionian, dorian, phrygian, lydian, mixolydian, aeolian, and locrian; All modes are given with 2 sharps.




.. image:: usersGuide_90_musicxmlTest_40_1.png



.. code:: python

    print([k.mode for k in scores['13b'].recurse().getElementsByClass('Key')]) # block on ionian, aeolian


.. parsed-literal::
   :class: ipython-result

    ['major', 'minor', 'dorian', 'phrygian', 'lydian', 'mixolydian', 'locrian']


.. code:: python

    s('13c')


.. parsed-literal::
   :class: ipython-result

    13c-KeySignatures-NonTraditional.xml
    
    Non-traditional key signatures, where each alteration is separately given. Here we have (f sharp, a flat, b flat) and (c flatflat, g sharp sharp, d flat, b sharp, f natural), where in the second case an explicit octave is given for each alteration.


::


    ---------------------------------------------------------------------------

    TypeError                                 Traceback (most recent call last)

    <ipython-input-38-14110f6263a3> in <module>()
    ----> 1 s('13c')
    

    <ipython-input-3-f1b4b74e08ad> in s(i)
         27     desc = re.sub(r'\s+', ' ', desc)
         28     print(desc)
    ---> 29     fpOut = sc.write('musicxml')
         30     with open(fpOut, 'r') as musicxmlOutFile:
         31         allOut = musicxmlOutFile.read()


    /Users/cuthbert/git/music21base/music21/stream/__init__.py in write(self, *args, **kwargs)
        247         if self.isSorted is False and self.autoSort:
        248             self.sort()
    --> 249         return super(Stream, self).write(*args, **kwargs)
        250 
        251 


    /Users/cuthbert/git/music21base/music21/base.py in write(self, fmt, fp, **keywords)
       2511         scClass = common.findSubConverterForFormat(regularizedConverterFormat)
       2512         formatWriter = scClass()
    -> 2513         return formatWriter.write(self, regularizedConverterFormat, fp, subformats, **keywords)
       2514 
       2515 


    /Users/cuthbert/git/music21base/music21/converter/subConverters.py in write(self, obj, fmt, fp, subformats, **keywords)
        799 
        800         generalExporter = m21ToXml.GeneralObjectExporter(obj)
    --> 801         dataBytes = generalExporter.parse()
        802         fp = self.writeDataStream(fp, dataBytes)
        803 


    /Users/cuthbert/git/music21base/music21/musicxml/m21ToXml.py in parse(self, obj)
        348         if obj is None:
        349             obj = self.generalObj
    --> 350         outObj = self.fromGeneralObject(obj)
        351         return self.parseWellformedObject(outObj)
        352 


    /Users/cuthbert/git/music21base/music21/musicxml/m21ToXml.py in fromGeneralObject(self, obj)
        383             if cM in classes:
        384                 meth = getattr(self, methName)
    --> 385                 outObj = meth(obj)
        386                 break
        387         if outObj is None:


    /Users/cuthbert/git/music21base/music21/musicxml/m21ToXml.py in fromScore(self, sc)
        395         the best one of all -- a perfectly made Score (or something like that)
        396         '''
    --> 397         scOut = sc.makeNotation(inPlace=False)
        398         # scOut.makeImmutable()
        399         return scOut


    /Users/cuthbert/git/music21base/music21/stream/__init__.py in makeNotation(self, meterStream, refStreamOrTimeRange, inPlace, bestClef, **subroutineKeywords)
      12721                                inPlace=True,
      12722                                bestClef=bestClef,
    > 12723                                **subroutineKeywords)
      12724             # note: while the local-streams have updated their caches, the
      12725             # containing score has an out-of-date cache of flat.


    /Users/cuthbert/git/music21base/music21/stream/__init__.py in makeNotation(self, meterStream, refStreamOrTimeRange, inPlace, bestClef, **subroutineKeywords)
       5910                         useKeySignature=ksLast,
       5911                         searchKeySignatureByContext=False,
    -> 5912                         **srkCopy)
       5913         #environLocal.printDebug(['makeNotation(): meterStream:', meterStream, meterStream[0]])
       5914         try:


    /Users/cuthbert/git/music21base/music21/stream/__init__.py in makeAccidentals(self, pitchPast, pitchPastMeasure, useKeySignature, alteredPitches, searchKeySignatureByContext, cautionaryPitchClass, cautionaryAll, inPlace, overrideStatus, cautionaryNotImmediateRepeat, lastNoteWasTied)
       5744         addAlteredPitches = []
       5745         if isinstance(useKeySignature, key.KeySignature):
    -> 5746             addAlteredPitches = useKeySignature.alteredPitches
       5747         elif useKeySignature is True: # get from defined contexts
       5748             # will search local, then activeSite


    /Users/cuthbert/git/music21base/music21/key.py in _getAlteredPitches(self)
        440 
        441         post = []
    --> 442         if self.sharps > 0:
        443             pKeep = pitch.Pitch('B')
        444             if self.sharps > 8:


    TypeError: unorderable types: NoneType() > int()


.. code:: python

    s('13d')


.. parsed-literal::
   :class: ipython-result

    13d-KeySignatures-Microtones.xml
    
    Non-traditional key signatures with microtone alterations: (g flat-and-a-half, a flat, b half-flat, c natural, d half-sharp, e sharp, f sharp-and-a-half).


::


    ---------------------------------------------------------------------------

    TypeError                                 Traceback (most recent call last)

    <ipython-input-39-0bb1551d68e3> in <module>()
    ----> 1 s('13d')
    

    <ipython-input-3-f1b4b74e08ad> in s(i)
         27     desc = re.sub(r'\s+', ' ', desc)
         28     print(desc)
    ---> 29     fpOut = sc.write('musicxml')
         30     with open(fpOut, 'r') as musicxmlOutFile:
         31         allOut = musicxmlOutFile.read()


    /Users/cuthbert/git/music21base/music21/stream/__init__.py in write(self, *args, **kwargs)
        247         if self.isSorted is False and self.autoSort:
        248             self.sort()
    --> 249         return super(Stream, self).write(*args, **kwargs)
        250 
        251 


    /Users/cuthbert/git/music21base/music21/base.py in write(self, fmt, fp, **keywords)
       2511         scClass = common.findSubConverterForFormat(regularizedConverterFormat)
       2512         formatWriter = scClass()
    -> 2513         return formatWriter.write(self, regularizedConverterFormat, fp, subformats, **keywords)
       2514 
       2515 


    /Users/cuthbert/git/music21base/music21/converter/subConverters.py in write(self, obj, fmt, fp, subformats, **keywords)
        799 
        800         generalExporter = m21ToXml.GeneralObjectExporter(obj)
    --> 801         dataBytes = generalExporter.parse()
        802         fp = self.writeDataStream(fp, dataBytes)
        803 


    /Users/cuthbert/git/music21base/music21/musicxml/m21ToXml.py in parse(self, obj)
        348         if obj is None:
        349             obj = self.generalObj
    --> 350         outObj = self.fromGeneralObject(obj)
        351         return self.parseWellformedObject(outObj)
        352 


    /Users/cuthbert/git/music21base/music21/musicxml/m21ToXml.py in fromGeneralObject(self, obj)
        383             if cM in classes:
        384                 meth = getattr(self, methName)
    --> 385                 outObj = meth(obj)
        386                 break
        387         if outObj is None:


    /Users/cuthbert/git/music21base/music21/musicxml/m21ToXml.py in fromScore(self, sc)
        395         the best one of all -- a perfectly made Score (or something like that)
        396         '''
    --> 397         scOut = sc.makeNotation(inPlace=False)
        398         # scOut.makeImmutable()
        399         return scOut


    /Users/cuthbert/git/music21base/music21/stream/__init__.py in makeNotation(self, meterStream, refStreamOrTimeRange, inPlace, bestClef, **subroutineKeywords)
      12721                                inPlace=True,
      12722                                bestClef=bestClef,
    > 12723                                **subroutineKeywords)
      12724             # note: while the local-streams have updated their caches, the
      12725             # containing score has an out-of-date cache of flat.


    /Users/cuthbert/git/music21base/music21/stream/__init__.py in makeNotation(self, meterStream, refStreamOrTimeRange, inPlace, bestClef, **subroutineKeywords)
       5910                         useKeySignature=ksLast,
       5911                         searchKeySignatureByContext=False,
    -> 5912                         **srkCopy)
       5913         #environLocal.printDebug(['makeNotation(): meterStream:', meterStream, meterStream[0]])
       5914         try:


    /Users/cuthbert/git/music21base/music21/stream/__init__.py in makeAccidentals(self, pitchPast, pitchPastMeasure, useKeySignature, alteredPitches, searchKeySignatureByContext, cautionaryPitchClass, cautionaryAll, inPlace, overrideStatus, cautionaryNotImmediateRepeat, lastNoteWasTied)
       5744         addAlteredPitches = []
       5745         if isinstance(useKeySignature, key.KeySignature):
    -> 5746             addAlteredPitches = useKeySignature.alteredPitches
       5747         elif useKeySignature is True: # get from defined contexts
       5748             # will search local, then activeSite


    /Users/cuthbert/git/music21base/music21/key.py in _getAlteredPitches(self)
        440 
        441         post = []
    --> 442         if self.sharps > 0:
        443             pKeep = pitch.Pitch('B')
        444             if self.sharps > 8:


    TypeError: unorderable types: NoneType() > int()


14 ... Staff attributes
-----------------------

.. code:: python

    s('14a')


.. parsed-literal::
   :class: ipython-result

    14a-StaffDetails-LineChanges.xml
    
    The number of staff lines can be modified by using the staff-lines child of the staff-details attribute. This can happen globally (the first staff has one line globally) or during the part at the beginning of a measure and even inside a measure (the second part has 5 lines initially, 4 at the beginning of the second measure, and 3 starting in the middle of the third measure).




.. image:: usersGuide_90_musicxmlTest_45_1.png



21 ... Chorded notes
--------------------

.. code:: python

    s('21a')


.. parsed-literal::
   :class: ipython-result

    21a-Chord-Basic.xml
    
    One simple chord consisting of two notes.




.. image:: usersGuide_90_musicxmlTest_47_1.png



.. code:: python

    s('21b')


.. parsed-literal::
   :class: ipython-result

    21b-Chords-TwoNotes.xml
    
    Some subsequent (identical) two-note chords.




.. image:: usersGuide_90_musicxmlTest_48_1.png



.. code:: python

    s('21c')


.. parsed-literal::
   :class: ipython-result

    21c-Chords-ThreeNotesDuration.xml
    
    Some three-note chords, with various durations.




.. image:: usersGuide_90_musicxmlTest_49_1.png



.. code:: python

    s('21d')


.. parsed-literal::
   :class: ipython-result

    21d-Chords-SchubertStabatMater.xml
    
    Chords in the second measure, after several ornaments in the first measure and a p at the beginning of the second measure.




.. image:: usersGuide_90_musicxmlTest_50_1.png



.. code:: python

    s('21e')


.. parsed-literal::
   :class: ipython-result

    21e-Chords-PickupMeasures.xml
    
    Check for proper chord detection after a pickup measure (i.e. the first beat of the measure is not aligned with multiples of the time signature)!




.. image:: usersGuide_90_musicxmlTest_51_1.png



.. code:: python

    s('21f') # 


.. parsed-literal::
   :class: ipython-result

    21f-Chord-ElementInBetween.xml
    
    Between the individual notes of a chord there can be direction or harmony elements, which should be properly assigned to the chord (or the position of the chord).




.. image:: usersGuide_90_musicxmlTest_52_1.png



22 ... Note settings, heads, etc.
---------------------------------

.. code:: python

    s('22a')


.. parsed-literal::
   :class: ipython-result

    22a-Noteheads.xml
    
    Different note styles, using the <notehead> element. First, each note head style is printed with four quarter notes, two with filled heads, two with unfilled heads, where first the stem is up and then the stem is down. After that, each note head style is printed with a half note (should have an unfilled head by default). Finally, the Aiken note head styles are tested, once with stem up and once with stem down.




.. image:: usersGuide_90_musicxmlTest_54_1.png



.. code:: python

    s('22b')


.. parsed-literal::
   :class: ipython-result

    22b-Staff-Notestyles.xml
    
    Staff-connected note styles: slash notation, hidden notes (with and without hidden staff lines)




.. image:: usersGuide_90_musicxmlTest_55_1.png



.. code:: python

    s('22c')


.. parsed-literal::
   :class: ipython-result

    22c-Noteheads-Chords.xml
    
    Different note styles for individual notes inside a chord, using the <notehead> element.




.. image:: usersGuide_90_musicxmlTest_56_1.png



.. code:: python

    s('22d') # failing parenthesized rest


.. parsed-literal::
   :class: ipython-result

    22d-Parenthesized-Noteheads.xml
    
    Parenthesized note heads. First, a single parenthesized note is tested, once with a normal and then with a non-standard notehead, then two chords with some/all parenthesized noteheads and finally a parenthesized rest.




.. image:: usersGuide_90_musicxmlTest_57_1.png



23 ... Triplets, Tuplets
------------------------

.. code:: python

    s('23a') # failing, brackets.


.. parsed-literal::
   :class: ipython-result

    23a-Tuplets.xml
    
    Some tuplets (3:2, 3:2, 3:2, 4:2, 4:1, 7:3, 6:2) with the default tuplet bracket displaying the number of actual notes played. The second tuplet does not have a number attribute set.




.. image:: usersGuide_90_musicxmlTest_59_1.png



.. code:: python

    s('23b') # failing


.. parsed-literal::
   :class: ipython-result

    23b-Tuplets-Styles.xml
    
    Different tuplet styles: default, none, x:y, x:y-note; Each with bracket, slur and none. Finally, non-standard 4:3 and 17:2 tuplets are given.




.. image:: usersGuide_90_musicxmlTest_60_1.png



.. code:: python

    s('23c') # failing


.. parsed-literal::
   :class: ipython-result

    23c-Tuplet-Display-NonStandard.xml
    
    Displaying tuplet note types, that might not coincide with the displayed note. The first two tuplets take the type from the note, the second two from the <time-modification> element, the remaining pair of tuplets from the <tuplet> notation element. The tuplets in measure 3 specify both a number of notes and a type inside the <tuplet-actual> and <tuplet-normal> elements, the ones in measure 4 specify only a note type (but no number), and the ones in measure 5 specify only a number of tuplet-notes (but no type, which is deduced from the note's type). The first tuplet of measures 3-5 uses 'display-type="actual"', the second one 'display-type="both"'. FIXME: The tuplet-normal should coincide with the real notes!




.. image:: usersGuide_90_musicxmlTest_61_1.png



.. code:: python

    s('23d') # failing -- no nested tuplets yet.


.. parsed-literal::
   :class: ipython-result

    23d-Tuplets-Nested.xml
    
    Tuplets can be nested. Here there is a 5:2 tuplet inside a 3:2 tuple (all consisting of written eighth notes).




.. image:: usersGuide_90_musicxmlTest_62_1.png



.. code:: python

    s('23e') # working?


.. parsed-literal::
   :class: ipython-result

    23e-Tuplets-Tremolo.xml
    
    Tremolo tuplets are tuplets on single notes with a tremolo ornament. The application shall correctly import these notes with 2/3 or their time...




.. image:: usersGuide_90_musicxmlTest_63_1.png



.. code:: python

    s('23f') # failing brackets shown


.. parsed-literal::
   :class: ipython-result

    23f-Tuplets-DurationButNoBracket.xml
    
    Some "triplets" on the end of the first and in the second staff, using only <time-modification>, but not explicit tuplet bracket. Thus, the duration of the notes in the second staff should be scaled properly in comparison to staff 1, but no visual indication about the tuplets is given.




.. image:: usersGuide_90_musicxmlTest_64_1.png



24 ... Grace notes
------------------

.. code:: python

    s('24a') # are slurs default?


.. parsed-literal::
   :class: ipython-result

    24a-GraceNotes.xml
    
    Different kinds of grace notes: acciaccatura, appoggiatura; beamed grace notes; grace notes with accidentals; different durations of the grace notes.




.. image:: usersGuide_90_musicxmlTest_66_1.png



.. code:: python

    s('24b')


.. parsed-literal::
   :class: ipython-result

    24b-ChordAsGraceNote.xml
    
    Chords as grace notes.




.. image:: usersGuide_90_musicxmlTest_67_1.png



.. code:: python

    s('24c')


.. parsed-literal::
   :class: ipython-result

    24c-GraceNote-MeasureEnd.xml
    
    A grace note that appears at the measure end (without any steal-from-* attribute set). Some applications need to convert this into an after-grace.




.. image:: usersGuide_90_musicxmlTest_68_1.png



.. code:: python

    s('24d')


.. parsed-literal::
   :class: ipython-result

    24d-AfterGrace.xml
    
    Some grace notes and after-graces (indicated by steal-time-previous and steal-time-following).




.. image:: usersGuide_90_musicxmlTest_69_1.png



.. code:: python

    s('24e')


.. parsed-literal::
   :class: ipython-result

    24e-GraceNote-StaffChange.xml
    
    A grace note on a different staff than the actual note.




.. image:: usersGuide_90_musicxmlTest_70_1.png



.. code:: python

    s('24f')


.. parsed-literal::
   :class: ipython-result

    24f-GraceNote-Slur.xml
    
    A grace note with a slur to the actual note. This can be interpreted as acciaccatura or appoggiatura, depending on the existence of a slash.




.. image:: usersGuide_90_musicxmlTest_71_1.png



31 ... Dynamics and other single symbols
----------------------------------------

.. code:: python

    s('31a') # todo, split...


.. parsed-literal::
   :class: ipython-result

    31a-Directions.xml
    
    All <direction> elements defined in MusicXML. The lyrics for each note describes the direction element assigned to that note.




.. image:: usersGuide_90_musicxmlTest_73_1.png



.. code:: python

    s('31c') # todo, split


.. parsed-literal::
   :class: ipython-result

    31c-MetronomeMarks.xml
    
    Tempo Markings: note=bpm, text (note=bpm), note=note, (note=note), (note=bpm)




.. image:: usersGuide_90_musicxmlTest_74_1.png



32 ... Notations and Articulations
----------------------------------

.. code:: python

    s('32a') # todo-split


.. parsed-literal::
   :class: ipython-result

    32a-Notations.xml
    
    All <notation> elements defined in MusicXML. The lyrics show the notation assigned to each note.




.. image:: usersGuide_90_musicxmlTest_76_1.png



.. code:: python

    s('32b') # todo split


.. parsed-literal::
   :class: ipython-result

    32b-Articulations-Texts.xml
    
    Text markup: different font sizes, weights and colors.




.. image:: usersGuide_90_musicxmlTest_77_1.png



.. code:: python

    s('32c') # failing first note


.. parsed-literal::
   :class: ipython-result

    32c-MultipleNotationChildren.xml
    
     It should not make any difference whether two articulations are given inside two different notation elements, inside two different articulations children of the same notation element or inside the same articulations element. Thus, all three notes should have a staccato and an accent. 




.. image:: usersGuide_90_musicxmlTest_78_1.png



.. code:: python

    s('32d') # not supported


.. parsed-literal::
   :class: ipython-result

    32d-Arpeggio.xml
    
    Different Arpeggio directions (normal, up, down, non-arpeggiate)




.. image:: usersGuide_90_musicxmlTest_79_1.png



33 ... Spanners
---------------

.. code:: python

    s('33a')


.. parsed-literal::
   :class: ipython-result

    33a-Spanners.xml
    
    Several spanners defined in MusicXML: tuplet, slur (solid, dashed), tie, wedge (cresc, dim), tr + wavy-line, single-note trill spanner, octave-shift (8va,15mb), bracket (solid down/down, dashed down/down, solid none/down, dashed none/up, solid none/none), dashes, glissando (wavy), bend-alter, slide (solid), grouping, two-note tremolo, hammer-on, pull-off, pedal (down, change, up).




.. image:: usersGuide_90_musicxmlTest_81_1.png



.. code:: python

    s('33b') # not necessarily a spanner except in Lilypond


.. parsed-literal::
   :class: ipython-result

    33b-Spanners-Tie.xml
    
    Two simple tied whole notes




.. image:: usersGuide_90_musicxmlTest_82_1.png



.. code:: python

    s('33c')


.. parsed-literal::
   :class: ipython-result

    33c-Spanners-Slurs.xml
    
    A note can be the end of one slur and the start of a new slur. Also, in MusicXML, nested slurs are possible like in the second measure where one slur goes over all four notes, and another slur goes from the second to the third note.




.. image:: usersGuide_90_musicxmlTest_83_1.png



.. code:: python

    s('33d') # overinterpreting.


.. parsed-literal::
   :class: ipython-result

    33d-Spanners-OctaveShifts.xml
    
    All types of octave shifts (15ma, 15mb, 8va, 8vb)




.. image:: usersGuide_90_musicxmlTest_84_1.png



.. code:: python

    s('33e') # check if actually invalid


.. parsed-literal::
   :class: ipython-result

    33e-Spanners-OctaveShifts-InvalidSize.xml
    
    Invalid octave-shifts: 27 down, 11 up.




.. image:: usersGuide_90_musicxmlTest_85_1.png



.. code:: python

    s('33f') # blocking: MuseScore, I think...


.. parsed-literal::
   :class: ipython-result

    33f-Trill-EndingOnGraceNote.xml
    
    A trill spanner that spans a grace note and ends on an after-grace note at the end of the measure.




.. image:: usersGuide_90_musicxmlTest_86_1.png



.. code:: python

    s('33g')


.. parsed-literal::
   :class: ipython-result

    33g-Slur-ChordedNotes.xml
    
    Slurs on chorded notes: Only the first note of the chord should get the slur notation. Some applications print out the slur for all notes -- these should be ignored. Edited by MSC to not reuse the same slur number in generating the overlapping slurs. 




.. image:: usersGuide_90_musicxmlTest_87_1.png



.. code:: python

    s('33h')


.. parsed-literal::
   :class: ipython-result

    33h-Spanners-Glissando.xml
    
    All different types of glissando defined in MusicXML




.. image:: usersGuide_90_musicxmlTest_88_1.png



.. code:: python

    s('33i')


.. parsed-literal::
   :class: ipython-result

    33i-Ties-NotEnded.xml
    
    Several ties that have their end tag missing.




.. image:: usersGuide_90_musicxmlTest_89_1.png



41 ... Multiple parts (staves)
------------------------------

.. code:: python

    s('41a')


.. parsed-literal::
   :class: ipython-result

    41a-MultiParts-Partorder.xml
    
    A piece with four parts (P0, P1, P2, P3; different from what Finale creates!). Are they converted in the correct order?




.. image:: usersGuide_90_musicxmlTest_91_1.png



.. code:: python

    s('41b') # blocking: MuseScore? needs instruments?


.. parsed-literal::
   :class: ipython-result

    41b-MultiParts-MoreThan10.xml
    
    A piece with 20 parts to check whether an application supports that many parts and whether they are correctly sorted.




.. image:: usersGuide_90_musicxmlTest_92_1.png



.. code:: python

    s('41c')


.. parsed-literal::
   :class: ipython-result

    41c-StaffGroups.xml
    
    A huge orchestra score with 28 parts and different kinds of nested bracketed groups. Each part/group is assigned a name and an abbreviation to be shown before the staff. Also, most of the groups show unbroken barlines, while the barlines are broken between the groups.




.. image:: usersGuide_90_musicxmlTest_93_1.png



.. code:: python

    s('41d')


.. parsed-literal::
   :class: ipython-result

    41d-StaffGroups-Nested.xml
    
    Two properly nested part groups: One group (with a square bracket) goes from staff 2 to 4) and another group (with a curly bracket) goes from staff 3 to 4.




.. image:: usersGuide_90_musicxmlTest_94_1.png



.. code:: python

    s('41e')


.. parsed-literal::
   :class: ipython-result

    41e-StaffGroups-InstrumentNames-Linebroken.xml
    
    Part names and abbreviations can contain line breaks.




.. image:: usersGuide_90_musicxmlTest_95_1.png



.. code:: python

    s('41f')


.. parsed-literal::
   :class: ipython-result

    41f-StaffGroups-Overlapping.xml
    
    MusicXML allows for overlapping part-groups, while many applications do not allow overlapping groups, but require them to be properly nested. In this case, one group (with a square bracket) goes from staff 2 to 4) and another group (with a curly bracket) goes from staff 3 to 5.




.. image:: usersGuide_90_musicxmlTest_96_1.png



.. code:: python

    s('41g')


.. parsed-literal::
   :class: ipython-result

    41g-PartNoId.xml
    
    A part with no id attribute. Since this piece has only one part, it is clear which part is described by the one part element.




.. image:: usersGuide_90_musicxmlTest_97_1.png



.. code:: python

    s('41h')


.. parsed-literal::
   :class: ipython-result

    musicxml.xmlToM21: WARNING: Cannot find info for part with name P3, skipping the part
    musicxml.xmlToM21: WARNING: Cannot find info for part with name P4, skipping the part


.. parsed-literal::
   :class: ipython-result

    41h-TooManyParts.xml
    
    This piece has more part elements than the part-list section gives. One can either convert all the parts present, but not listed in the part-list, or simply not import / ignore them.




.. image:: usersGuide_90_musicxmlTest_98_2.png



.. code:: python

    s('41i')


.. parsed-literal::
   :class: ipython-result

    41i-PartNameDisplay-Override.xml
    
    MusicXML allows part-name and part-name-display in the score-part element. If part-name-display is given, it overrides the part-name for display. The first staff uses only part-name, while the second one (same part-name) overrides it with a custom text. Similar for the part-abbreviation used in subsequent staves. 




.. image:: usersGuide_90_musicxmlTest_99_1.png



42 ... Multiple voices per staff
--------------------------------

.. code:: python

    s('42a')


.. parsed-literal::
   :class: ipython-result

    42a-MultiVoice-TwoVoicesOnStaff-Lyrics.xml
    
    Two voices share one staff. Each voice is assigned some lyrics.




.. image:: usersGuide_90_musicxmlTest_101_1.png



.. code:: python

    s('42b')


.. parsed-literal::
   :class: ipython-result

    42b-MultiVoice-MidMeasureClefChange.xml
    
    A multi-voice / multi-staff part with a clef change in the middle of a measure and a <backward> for voice 2 jumping back beyond that clef change.




.. image:: usersGuide_90_musicxmlTest_102_1.png



43 ... One part on multiple staves
----------------------------------

.. code:: python

    s('43a')


.. parsed-literal::
   :class: ipython-result

    43a-PianoStaff.xml
    
    A simple piano staff




.. image:: usersGuide_90_musicxmlTest_104_1.png



.. code:: python

    s('43b')


.. parsed-literal::
   :class: ipython-result

    43b-MultiStaff-DifferentKeys.xml
    
    A piano staff with different keys and clefs for each of its staves. The keys and clefs for both staves are given at the very beginning of the measure.




.. image:: usersGuide_90_musicxmlTest_105_1.png



.. code:: python

    s('43c')


.. parsed-literal::
   :class: ipython-result

    43c-MultiStaff-DifferentKeysAfterBackup.xml
    
    A piano staff with different keys and clefs for each of its staves. The key and clef for the second staff is given only after a backward, just before the first note of the second staff is given, but after the whole measure for staff 1 has been given.




.. image:: usersGuide_90_musicxmlTest_106_1.png



.. code:: python

    s('43d')


.. parsed-literal::
   :class: ipython-result

    43d-MultiStaff-StaffChange.xml
    
    Staff changes in a piano staff. The voice from the second staff has some notes/chords on the first staff. The final two chords have some notes on the first, some on the second staff.




.. image:: usersGuide_90_musicxmlTest_107_1.png



.. code:: python

    s('43e')


.. parsed-literal::
   :class: ipython-result

    43e-Multistaff-ClefDynamics.xml
    
    A piano staff with dynamics and clef changes, where each element (ffff, wedge and clef changes) applies only to one voice or one staff, respectively.




.. image:: usersGuide_90_musicxmlTest_108_1.png



45 ... Repeats
--------------

.. code:: python

    s('45a')


.. parsed-literal::
   :class: ipython-result

    45a-SimpleRepeat.xml
    
    A simple, repeated measure (repeated 5 times)




.. image:: usersGuide_90_musicxmlTest_110_1.png



.. code:: python

    s('45b')


.. parsed-literal::
   :class: ipython-result

    45b-RepeatWithAlternatives.xml
    
    A simple repeat with two alternative endings (volta brackets).




.. image:: usersGuide_90_musicxmlTest_111_1.png



.. code:: python

    s('45c')


.. parsed-literal::
   :class: ipython-result

    45c-RepeatMultipleTimes.xml
    
    Repeats can also be nested.




.. image:: usersGuide_90_musicxmlTest_112_1.png



.. code:: python

    print(musicxmlOut['45c'])


.. parsed-literal::
   :class: ipython-result

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE score-partwise
      PUBLIC '-//Recordare//DTD MusicXML 2.0 Partwise//EN'
      'http://www.musicxml.org/dtds/partwise.dtd'>
    <score-partwise>
      <work>
        <work-title>45c-RepeatMultipleTimes.xml</work-title>
      </work>
      <movement-title>45c-RepeatMultipleTimes.xml</movement-title>
      <identification>
        <creator type="composer">Music21</creator>
        <encoding>
          <encoding-date>2016-08-13</encoding-date>
          <software>Music21</software>
        </encoding>
      </identification>
      <defaults>
        <scaling>
          <millimeters>7</millimeters>
          <tenths>40</tenths>
        </scaling>
      </defaults>
      <part-list>
        <score-part id="P1">
          <part-name>MusicXML Part</part-name>
        </score-part>
      </part-list>
      <part id="P1">
        <measure number="1">
          <attributes>
            <divisions>10080</divisions>
            <key>
              <fifths>0</fifths>
              <mode>major</mode>
            </key>
            <time symbol="common">
              <beats>4</beats>
              <beat-type>4</beat-type>
            </time>
            <clef>
              <sign>G</sign>
              <line>2</line>
            </clef>
          </attributes>
          <note>
            <rest measure="yes" />
            <duration>40320</duration>
          </note>
        </measure>
        <measure number="2">
          <attributes>
            <divisions>10080</divisions>
          </attributes>
          <barline location="left">
            <repeat direction="forward" />
          </barline>
          <note>
            <rest measure="yes" />
            <duration>40320</duration>
          </note>
        </measure>
        <measure number="3">
          <attributes>
            <divisions>10080</divisions>
          </attributes>
          <note>
            <rest measure="yes" />
            <duration>40320</duration>
          </note>
          <barline location="right">
            <repeat direction="backward" times="5" />
          </barline>
        </measure>
        <measure number="4">
          <attributes>
            <divisions>10080</divisions>
          </attributes>
          <note>
            <rest measure="yes" />
            <duration>40320</duration>
          </note>
        </measure>
        <measure number="5">
          <attributes>
            <divisions>10080</divisions>
          </attributes>
          <note>
            <rest measure="yes" />
            <duration>40320</duration>
          </note>
        </measure>
        <measure number="6">
          <attributes>
            <divisions>10080</divisions>
          </attributes>
          <note>
            <rest measure="yes" />
            <duration>40320</duration>
          </note>
        </measure>
        <measure number="7">
          <attributes>
            <divisions>10080</divisions>
          </attributes>
          <note>
            <rest measure="yes" />
            <duration>40320</duration>
          </note>
          <barline location="right">
            <repeat direction="backward" times="3" />
          </barline>
        </measure>
        <measure number="8">
          <attributes>
            <divisions>10080</divisions>
          </attributes>
          <note>
            <rest measure="yes" />
            <duration>40320</duration>
          </note>
          <barline location="right">
            <bar-style>light-heavy</bar-style>
          </barline>
        </measure>
      </part>
    </score-partwise>
    


.. code:: python

    s('45d')


.. parsed-literal::
   :class: ipython-result

    45d-Repeats-Nested-Alternatives.xml
    
    Nested repeats, each with alternative endings.




.. image:: usersGuide_90_musicxmlTest_114_1.png



.. code:: python

    s('45e')


.. parsed-literal::
   :class: ipython-result

    45e-Repeats-Nested-Alternatives.xml
    
    Some more nested repeats with alternatives. The barline between measure 7 and 8 will probably be messed up! (Should be a repeat on both sides!)




.. image:: usersGuide_90_musicxmlTest_115_1.png



.. code:: python

    s('45f')


.. parsed-literal::
   :class: ipython-result

    45f-Repeats-InvalidEndings.xml
    
    Some more nested repeats with alternatives, where the MusicXML file does not make sense in the first place. How well are applications able to cope with improper repeats and alternatives?




.. image:: usersGuide_90_musicxmlTest_116_1.png



.. code:: python

    s('45g')


.. parsed-literal::
   :class: ipython-result

    45g-Repeats-NotEnded.xml
    
    A forward-repeating bar line without an ending repeat bar.




.. image:: usersGuide_90_musicxmlTest_117_1.png



46 ... Barlines, Measures
-------------------------

.. code:: python

    s('46a')


.. parsed-literal::
   :class: ipython-result

    46a-Barlines.xml
    
    Different types of (non-repeat) barlines: default (no setting), regular, dotted, dashed, heavy, light-light, light-heavy, heavy-light, heavy-heavy, tick, short, none.




.. image:: usersGuide_90_musicxmlTest_119_1.png



.. code:: python

    s('46b')


.. parsed-literal::
   :class: ipython-result

    46b-MidmeasureBarline.xml
    
    Barlines can appear at mid-measure positions, without using an implicit measure!




.. image:: usersGuide_90_musicxmlTest_120_1.png



.. code:: python

    s('46c')


.. parsed-literal::
   :class: ipython-result

    46c-Midmeasure-Clef.xml
    
    A clef change in the middle of a measure, using either an implicit measure or simply placing the attributes in the middle of the measure.




.. image:: usersGuide_90_musicxmlTest_121_1.png



.. code:: python

    s('46d')


.. parsed-literal::
   :class: ipython-result

    46d-PickupMeasure-ImplicitMeasures.xml
    
    A 3/8 pickup measure, a measure that is split into one (incomplete, only 2/4) measure and an implicit measure, and an incomplete measure (containg 3/4).




.. image:: usersGuide_90_musicxmlTest_122_1.png



.. code:: python

    s('46e')


.. parsed-literal::
   :class: ipython-result

    46e-PickupMeasure-SecondVoiceStartsLater.xml
    
    Voice 2 should start at 2nd beat of first full measure.




.. image:: usersGuide_90_musicxmlTest_123_1.png



.. code:: python

    s('46f')


.. parsed-literal::
   :class: ipython-result

    46f-IncompleteMeasures.xml
    
    Measures can contain less notes than the time signature says. Here, the first and third measures contain only two quarters instead of four.




.. image:: usersGuide_90_musicxmlTest_124_1.png



.. code:: python

    s('46g')


.. parsed-literal::
   :class: ipython-result

    46g-PickupMeasure-Chordnames-FiguredBass.xml
    
    Pickup measure with chord names and figured bass.




.. image:: usersGuide_90_musicxmlTest_125_1.png



51 ... Header information
-------------------------

.. code:: python

    s('51b')


.. parsed-literal::
   :class: ipython-result

    51b-Header-Quotes.xml
    
    Several header fields and part names can contain quotes ("). This test checks whether they are converted/imported without problems (i.e. whether they are correctly escaped when converting).




.. image:: usersGuide_90_musicxmlTest_127_1.png



.. code:: python

    s('51c')


.. parsed-literal::
   :class: ipython-result

    51c-MultipleRights.xml
    
    There can be multiple <rights> tags in the identification element of the score. The conversion shall still work, ideally using both of them.




.. image:: usersGuide_90_musicxmlTest_128_1.png



.. code:: python

    s('51d')


.. parsed-literal::
   :class: ipython-result

    51d-EmptyTitle.xml
    
    A piece with an empty (but existing) work-title, but a non-empty movement-title. In this case the movement-title should be chosen, even though the work-title exists.




.. image:: usersGuide_90_musicxmlTest_129_1.png



52 ... Page layout
------------------

.. code:: python

    s('52a') # block: ipython21 -- only gives first png image.


.. parsed-literal::
   :class: ipython-result

    52a-PageLayout.xml
    
    Several page layout settings: paper size, margins, system margins and distances, different fonts, etc.




.. image:: usersGuide_90_musicxmlTest_131_1.png



.. code:: python

    s('52b') # block: ipython21 -- only gives first png image.


.. parsed-literal::
   :class: ipython-result

    52b-Breaks.xml
    
    System and page breaks, given in a <print> element




.. image:: usersGuide_90_musicxmlTest_132_1.png



61 ... Lyrics
-------------

.. code:: python

    s('61a')


.. parsed-literal::
   :class: ipython-result

    61a-Lyrics.xml
    
    Some notes with simple lyrics: Syllables, notes without a syllable, syllable spanners.




.. image:: usersGuide_90_musicxmlTest_134_1.png



.. code:: python

    s('61b')


.. parsed-literal::
   :class: ipython-result

    61b-MultipleLyrics.xml
    
    Multiple (simple) lyrics. The order of the exported stanzas is relevant (identified by the number attribute in this test case)




.. image:: usersGuide_90_musicxmlTest_135_1.png



.. code:: python

    s('61c')


.. parsed-literal::
   :class: ipython-result

    61c-Lyrics-Pianostaff.xml
    
    Lyrics assigned to the voices of a piano staff containing two simple staves. Each staff is assigned exactly one lyrics line.




.. image:: usersGuide_90_musicxmlTest_136_1.png



.. code:: python

    s('61d')


.. parsed-literal::
   :class: ipython-result

    61d-Lyrics-Melisma.xml
    
    How to treat lyrics and slurred notes. Normally, a slurred group of notes is assigned only one lyrics syllable.




.. image:: usersGuide_90_musicxmlTest_137_1.png



.. code:: python

    s('61e')


.. parsed-literal::
   :class: ipython-result

    61e-Lyrics-Chords.xml
    
    Assigning lyrics to chorded notes.




.. image:: usersGuide_90_musicxmlTest_138_1.png



.. code:: python

    s('61f')


.. parsed-literal::
   :class: ipython-result

    61f-Lyrics-GracedNotes.xml
    
    Grace notes shall not mess up the lyrics, and they shall not be assigned a syllable.




.. image:: usersGuide_90_musicxmlTest_139_1.png



.. code:: python

    s('61g')


.. parsed-literal::
   :class: ipython-result

    61g-Lyrics-NameNumber.xml
    
    A lyrics syllable can have both a number and a name attribute. The question is: What should be used to put syllables of the same voice together. This example uses different number/name combinations to check how different applications handle this unspecified case (The advice on the MusicXML mailing list was "there is no correct way, each application can do what it thinks is best").




.. image:: usersGuide_90_musicxmlTest_140_1.png



.. code:: python

    s('61h')


.. parsed-literal::
   :class: ipython-result

    61h-Lyrics-BeamsMelismata.xml
    
    Beaming or slurs can indicate melismata for lyrics. Also make sure that notes without an explicit syllable are treated as if they were part of a melisma.




.. image:: usersGuide_90_musicxmlTest_141_1.png



.. code:: python

    s('61i')


.. parsed-literal::
   :class: ipython-result

    61i-Lyrics-Chords.xml
    
    Each note of a chord can have some lyrics attached. In this case, each note of the chord has lyrics of the form "Lyrics [123]" attached, where each lyrics has a different number attribute to distinguish them. These syllables should be imported into three different stanzas and the timing should be correct.




.. image:: usersGuide_90_musicxmlTest_142_1.png



.. code:: python

    s('61j')


.. parsed-literal::
   :class: ipython-result

    61j-Lyrics-Elisions.xml
    
    Multiple lyrics syllables assigned to a single note are implemented either using a space in the lyrics or by using the <elision> lyrics element. This testcase checks both of them. First, a note with on syllable is given, then a note with two syllables separated by a spcae and finally a note with two and one with three syllables implemented using <elision> is given.




.. image:: usersGuide_90_musicxmlTest_143_1.png



.. code:: python

    s('61k')


.. parsed-literal::
   :class: ipython-result

    61k-Lyrics-SpannersExtenders.xml
    
    Lyrics spanners: continued syllables and extenders, possibly spanning multiple notes. The intermediate notes do not have any <lyric> element.




.. image:: usersGuide_90_musicxmlTest_144_1.png



71 ... Guitar notation
----------------------

.. code:: python

    s('71a')


.. parsed-literal::
   :class: ipython-result

    71a-Chordnames.xml
    
    A normal staff with several (complex) chord names displayed.




.. image:: usersGuide_90_musicxmlTest_146_1.png



.. code:: python

    s('71c')


.. parsed-literal::
   :class: ipython-result

    71c-ChordsFrets.xml
    
    A staff with chord names and some fretboards shown. The fretboards can have an arbitrary number of frets/strings, can start at an arbitrary fret and can even contain fingering information.




.. image:: usersGuide_90_musicxmlTest_147_1.png



.. code:: python

    s('71d')


.. parsed-literal::
   :class: ipython-result

    71d-ChordsFrets-Multistaff.xml
    
    Chords and fretboards assigned to the voices in a multi-voice, multi-staff part. There should be fret diagrams above each of the two staves.




.. image:: usersGuide_90_musicxmlTest_148_1.png



.. code:: python

    s('71e')


.. parsed-literal::
   :class: ipython-result

    71e-TabStaves.xml
    
    Some tablature staves, with explicit fingering information and different string tunings given in the MusicXML file.




.. image:: usersGuide_90_musicxmlTest_149_1.png



.. code:: python

    s('71f')


.. parsed-literal::
   :class: ipython-result

    71f-AllChordTypes.xml
    
    All chord types defined in MusicXML. The staff will only contain one c' note (NO chord) for all of them, but the chord names should be properly printed.




.. image:: usersGuide_90_musicxmlTest_150_1.png



.. code:: python

    s('71g')


.. parsed-literal::
   :class: ipython-result

    71g-MultipleChordnames.xml
    
    There can be multiple subsequent harmony elements, indicating a harmony change during a note




.. image:: usersGuide_90_musicxmlTest_151_1.png



72 ... Transposing instruments
------------------------------

.. code:: python

    s('72a')


.. parsed-literal::
   :class: ipython-result

    72a-TransposingInstruments.xml
    
    Transposing instruments: Trumpet in Bb, Horn in Eb, Piano; All of them show the C major scale (the trumpet with 2 sharp, the horn with 3 sharp).




.. image:: usersGuide_90_musicxmlTest_153_1.png



.. code:: python

    s('72b')


.. parsed-literal::
   :class: ipython-result

    72b-TransposingInstruments-Full.xml
    
    Various transposition. Each part plays a c'', just displayed in different display pitches. The second-to-last staff uses a transposition where the displayed c' is an actual f''' concert pitch. The final staff is an untransposed instrument.




.. image:: usersGuide_90_musicxmlTest_154_1.png



.. code:: python

    s('72c')


.. parsed-literal::
   :class: ipython-result

    72c-TransposingInstruments-Change.xml
    
    An instrument change from one transposition (Clarinet in Eb) to another transposing instrument (Clarinet in Bb). The displayed instrument name should also be updated. The whole piece is in Bb major (sounding), so first the key signature should be one flat, after the change it should have no accidentals. 




.. image:: usersGuide_90_musicxmlTest_155_1.png



73 ... Percussion
-----------------

.. code:: python

    s('73a')


.. parsed-literal::
   :class: ipython-result

    73a-Percussion.xml
    
    Three types of percussion staves: A five-line staff with bass clef for Timpani, a five-line staff with percussion clef, and a one-line percussion staff with only unpitched notes.




.. image:: usersGuide_90_musicxmlTest_157_1.png



74 ... Figured bass
-------------------

.. code:: python

    s('74a')


.. parsed-literal::
   :class: ipython-result

    74a-FiguredBass.xml
    
    Some figured bass containing alterated figures, bracketed figures and slashed figures. The last note contains an empty <figured-bass> element, which is invalid MusicXML, to check how well applications cope with malformed files. Note that this file does not contain any extenders!




.. image:: usersGuide_90_musicxmlTest_159_1.png



75 ... Other instrumental notation
----------------------------------

.. code:: python

    s('75a')


.. parsed-literal::
   :class: ipython-result

    75a-AccordionRegistrations.xml
    
    All possible accordion registrations.




.. image:: usersGuide_90_musicxmlTest_161_1.png



90 ... Compressed MusicXML files
--------------------------------

.. code:: python

    s('90a')


.. parsed-literal::
   :class: ipython-result

    90a-Compressed-MusicXML.mxl
    
    A compressed MusicXML file, containing a simple MusicXML score and the corresponding .pdf output for reference.




.. image:: usersGuide_90_musicxmlTest_163_1.png



99 ... Compatibility with broken MusicXML
-----------------------------------------

.. code:: python

    s('99a')


.. parsed-literal::
   :class: ipython-result

    99a-Sibelius5-IgnoreBeaming.xml
    
    Dolet 3 for Sibelius (5.1) did not print out any closing beam tags, only starting and continuing beam tags. For such files, one either needs to ignore all beaming information or close all beams 




.. image:: usersGuide_90_musicxmlTest_165_1.png



.. code:: python

    s('99b')


.. parsed-literal::
   :class: ipython-result

    99b-Lyrics-BeamsMelismata-IgnoreBeams.xml
    
    If we properly ignore all beaming information from the Dolet 3 for Sibelius export file, make sure that the lyrics syllables are still assigned to the correct notes.




.. image:: usersGuide_90_musicxmlTest_166_1.png



.. code:: python

    untested




.. parsed-literal::
   :class: ipython-result

    []


