MusicXML (Scales)

For educational purposes, Let’s create a MusicXML file that represents a D major scale (starting on D4 (near middle C), go up two octaves and then back down two octaves), put a “repeat” symbol at the end, and then use the lyrics from the “Star Spangled Banner” as insert capability for the <lyric> element.   After that, a short term-description list for each of the XML element names using common musicology terms.  

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE score-partwise PUBLIC
    "-//Recordare//DTD MusicXML 3.1 Partwise//EN"
    "http://www.musicxml.org/dtds/partwise.dtd">
<score-partwise version="3.1">
  <work>
    <work-title>D Major Scale with Lyrics Example</work-title>
  </work>

  <part-list>
    <score-part id="P1">
      <part-name>Voice</part-name>
    </score-part>
  </part-list>

  <part id="P1">

    <measure number="1">
      <attributes>
        <divisions>1</divisions>
        <key>
          <fifths>2</fifths>
        </key>
        <time>
          <beats>4</beats>
          <beat-type>4</beat-type>
        </time>
        <clef>
          <sign>G</sign>
          <line>2</line>
        </clef>
      </attributes>

      <note>
        <pitch><step>D</step><octave>4</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
        <lyric><text>Oh</text></lyric>
      </note>

      <note>
        <pitch><step>E</step><octave>4</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
        <lyric><text>say</text></lyric>
      </note>

      <note>
        <pitch><step>F</step><alter>1</alter><octave>4</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
        <lyric><text>can</text></lyric>
      </note>

      <note>
        <pitch><step>G</step><octave>4</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
        <lyric><text>you</text></lyric>
      </note>
    </measure>

    <measure number="2">
      <note>
        <pitch><step>A</step><octave>4</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
        <lyric><text>see</text></lyric>
      </note>

      <note>
        <pitch><step>B</step><octave>4</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
        <lyric><text>by</text></lyric>
      </note>

      <note>
        <pitch><step>C</step><alter>1</alter><octave>5</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
        <lyric><text>the</text></lyric>
      </note>

      <note>
        <pitch><step>D</step><octave>5</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
        <lyric><text>dawn's</text></lyric>
      </note>
    </measure>

    <measure number="3">
      <note>
        <pitch><step>E</step><octave>5</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
        <lyric><text>ear</text></lyric>
      </note>

      <note>
        <pitch><step>F</step><alter>1</alter><octave>5</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
        <lyric><text>ly</text></lyric>
      </note>

      <note>
        <pitch><step>G</step><octave>5</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
      </note>

      <note>
        <pitch><step>A</step><octave>5</octave></pitch>
        <duration>1</duration>
        <type>quarter</type>
      </note>
    </measure>

    <measure number="4">
      <note><pitch><step>B</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>C</step><alter>1</alter><octave>6</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>D</step><octave>6</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>C</step><alter>1</alter><octave>6</octave></pitch><duration>1</duration><type>quarter</type></note>
    </measure>

    <measure number="5">
      <note><pitch><step>B</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>A</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>G</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>F</step><alter>1</alter><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
    </measure>

    <measure number="6">
      <note><pitch><step>E</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>D</step><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>C</step><alter>1</alter><octave>5</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>B</step><octave>4</octave></pitch><duration>1</duration><type>quarter</type></note>
    </measure>

    <measure number="7">
      <note><pitch><step>A</step><octave>4</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>G</step><octave>4</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>F</step><alter>1</alter><octave>4</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><pitch><step>E</step><octave>4</octave></pitch><duration>1</duration><type>quarter</type></note>
    </measure>

    <measure number="8">
      <note><pitch><step>D</step><octave>4</octave></pitch><duration>1</duration><type>quarter</type></note>
      <note><rest/><duration>1</duration><type>quarter</type></note>
      <note><rest/><duration>1</duration><type>quarter</type></note>
      <note><rest/><duration>1</duration><type>quarter</type></note>
      <barline location="right">
        <repeat direction="backward"/>
      </barline>
    </measure>

  </part>
</score-partwise>

Now, a short term–description list mapping the main MusicXML element names to common musicology concepts. This is intentionally concise and pedagogical.

• score-partwise — The full musical score, organized measure-by-measure across parts (analogous to a conductor’s score layout).

• part-list — The roster of performing forces (instruments or voices).

• score-part — A single notated part or instrument.

• part — The actual musical content for one instrument or voice.

• measure — A bar; a unit of musical time defined by the meter.

• attributes — Notational parameters that establish musical context (key, meter, clef).

• divisions — The rhythmic resolution; how note durations are subdivided.

• key — The key signature, defining the tonal center and accidentals.

• fifths — Number of sharps or flats in the key signature, measured along the circle of fifths.

• time — The meter, specifying beats per measure and beat unit.

• clef — The reference point for pitch placement on the staff.

• note — A single musical event with pitch and duration.

• pitch — The notated pitch, composed of step, alteration, and octave.

• step — The diatonic pitch class (A–G).

• alter — Chromatic alteration (−1 flat, +1 sharp, etc.).

• octave — The pitch register.

• duration — The temporal length of the note in divisions.

• type — The conventional note value (quarter, half, etc.).

• rest — A silence of specified duration.

• barline — A structural boundary between measures.

• repeat — A directive indicating repeated playback of a musical section