]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of ssh://kainhofer@git.sv.gnu.org/srv/git/lilypond into kainhofer
authorReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 26 Oct 2007 16:18:01 +0000 (18:18 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 26 Oct 2007 16:18:01 +0000 (18:18 +0200)
input/regression/musicxml/11a-RestDurations-Finale.xml
input/regression/musicxml/17a-Chords-Finale.xml [new file with mode: 0644]
input/regression/musicxml/17b-Fretboards-Finale.xml [new file with mode: 0644]
input/regression/musicxml/17c-ChordsFrets-Finale.xml [new file with mode: 0644]
input/regression/musicxml/17d-ChordsFretsOnMultistaff-Finale.xml [new file with mode: 0644]
python/musicexp.py
python/musicxml.py
scripts/musicxml2ly.py

index 65d09ab907d245d104875ffab6cfeb64a0a220d9..1d942f528e557c906b4952ca5aa3ffbb785bd960 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
-                                "http://www.musicxml.org/dtds/partwise.dtd">
-<score-partwise>
-  <movement-title>Rest unit test</movement-title>
-  <identification>
-    <creator type="composer">Reinhold Kainhofer</creator>
-    <rights>Public Domain</rights>
-    <encoding>
-      <software>Finale 2007 for Windows</software>
-      <software>Dolet Light for Finale 2007</software>
-      <encoding-date>2007-09-14</encoding-date>
-    </encoding>
-  </identification>
-  <part-list>
-    <score-part id="P1">
-      <part-name>MusicXML Part</part-name>
-      <score-instrument id="P1-I1">
-        <instrument-name>Grand Piano</instrument-name>
-      </score-instrument>
-      <midi-instrument id="P1-I1">
-        <midi-channel>1</midi-channel>
-        <midi-program>1</midi-program>
-      </midi-instrument>
-    </score-part>
-  </part-list>
-  <!--=========================================================-->
-  <part id="P1">
-    <measure number="1">
-      <attributes>
-        <divisions>32</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>
-      <sound tempo="120"/>
-      <note>
-        <rest/>
-        <duration>128</duration>
-        <voice>1</voice>
-        <type>whole</type>
-      </note>
-    </measure>
-    <!--=======================================================-->
-    <measure number="2">
-      <note>
-        <rest/>
-        <duration>128</duration>
-        <voice>1</voice>
-        <type>whole</type>
-      </note>
-    </measure>
-    <!--=======================================================-->
-    <measure number="3">
-      <note>
-        <rest/>
-        <duration>128</duration>
-        <voice>1</voice>
-        <type>whole</type>
-      </note>
-    </measure>
-    <!--=======================================================-->
-    <measure number="4">
-      <note>
-        <rest/>
-        <duration>64</duration>
-        <voice>1</voice>
-        <type>half</type>
-      </note>
-      <note>
-        <rest/>
-        <duration>32</duration>
-        <voice>1</voice>
-        <type>quarter</type>
-      </note>
-      <note>
-        <rest/>
-        <duration>16</duration>
-        <voice>1</voice>
-        <type>eighth</type>
-      </note>
-      <note>
-        <rest/>
-        <duration>8</duration>
-        <voice>1</voice>
-        <type>16th</type>
-      </note>
-      <note>
-        <rest/>
-        <duration>4</duration>
-        <voice>1</voice>
-        <type>32nd</type>
-      </note>
-      <note>
-        <rest/>
-        <duration>2</duration>
-        <voice>1</voice>
-        <type>64th</type>
-      </note>
-      <note>
-        <rest/>
-        <duration>1</duration>
-        <voice>1</voice>
-        <type>128th</type>
-      </note>
-      <note>
-        <rest/>
-        <duration>1</duration>
-        <voice>1</voice>
-        <type>128th</type>
-      </note>
-    </measure>
-    <!--=======================================================-->
-    <measure number="5">
-      <note>
-        <rest/>
-        <duration>96</duration>
-        <voice>1</voice>
-        <type>half</type>
-        <dot/>
-      </note>
-      <note>
-        <rest/>
-        <duration>32</duration>
-        <voice>1</voice>
-        <type>quarter</type>
-      </note>
-    </measure>
-    <!--=======================================================-->
-    <measure number="6">
-      <print new-system="yes"/>
-      <note>
-        <rest/>
-        <duration>48</duration>
-        <voice>1</voice>
-        <type>quarter</type>
-        <dot/>
-      </note>
-      <note>
-        <rest/>
-        <duration>24</duration>
-        <voice>1</voice>
-        <type>eighth</type>
-        <dot/>
-      </note>
-      <note>
-        <rest/>
-        <duration>12</duration>
-        <voice>1</voice>
-        <type>16th</type>
-        <dot/>
-      </note>
-      <note>
-        <rest/>
-        <duration>6</duration>
-        <voice>1</voice>
-        <type>32nd</type>
-        <dot/>
-      </note>
-      <note>
-        <rest/>
-        <duration>3</duration>
-        <voice>1</voice>
-        <type>64th</type>
-        <dot/>
-      </note>
-      <note>
-        <rest/>
-        <duration>2</duration>
-        <voice>1</voice>
-        <type>128th</type>
-        <dot/>
-      </note>
-    </measure>
-    <!--=======================================================-->
-    <measure number="7">
-      <note>
-        <rest/>
-        <duration>128</duration>
-        <voice>1</voice>
-      </note>
-      <barline location="right">
-        <bar-style>light-heavy</bar-style>
-      </barline>
-    </measure>
-  </part>
-  <!--=========================================================-->
-</score-partwise>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"\r
+                                "http://www.musicxml.org/dtds/partwise.dtd">\r
+<score-partwise>\r
+  <movement-title>Rest unit test</movement-title>\r
+  <identification>\r
+    <creator type="composer">Reinhold Kainhofer</creator>\r
+    <rights>Public Domain</rights>\r
+    <encoding>\r
+      <software>Finale 2007 for Windows</software>\r
+      <software>Dolet Light for Finale 2007</software>\r
+      <encoding-date>2007-10-26</encoding-date>\r
+    </encoding>\r
+  </identification>\r
+  <part-list>\r
+    <score-part id="P1">\r
+      <part-name>MusicXML Part</part-name>\r
+      <score-instrument id="P1-I1">\r
+        <instrument-name>Grand Piano</instrument-name>\r
+      </score-instrument>\r
+      <midi-instrument id="P1-I1">\r
+        <midi-channel>1</midi-channel>\r
+        <midi-program>1</midi-program>\r
+      </midi-instrument>\r
+    </score-part>\r
+  </part-list>\r
+  <!--=========================================================-->\r
+  <part id="P1">\r
+    <measure number="1">\r
+      <attributes>\r
+        <divisions>32</divisions>\r
+        <key>\r
+          <fifths>0</fifths>\r
+          <mode>major</mode>\r
+        </key>\r
+        <time symbol="common">\r
+          <beats>4</beats>\r
+          <beat-type>4</beat-type>\r
+        </time>\r
+        <clef>\r
+          <sign>G</sign>\r
+          <line>2</line>\r
+        </clef>\r
+        <measure-style>\r
+          <multiple-rest>2</multiple-rest>\r
+        </measure-style>\r
+      </attributes>\r
+      <sound tempo="120"/>\r
+      <note>\r
+        <rest/>\r
+        <duration>128</duration>\r
+        <voice>1</voice>\r
+      </note>\r
+    </measure>\r
+    <!--=======================================================-->\r
+    <measure number="2">\r
+      <note>\r
+        <rest/>\r
+        <duration>128</duration>\r
+        <voice>1</voice>\r
+      </note>\r
+    </measure>\r
+    <!--=======================================================-->\r
+    <measure number="3">\r
+      <note>\r
+        <rest/>\r
+        <duration>128</duration>\r
+        <voice>1</voice>\r
+        <type>whole</type>\r
+      </note>\r
+    </measure>\r
+    <!--=======================================================-->\r
+    <measure number="4">\r
+      <note>\r
+        <rest/>\r
+        <duration>64</duration>\r
+        <voice>1</voice>\r
+        <type>half</type>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>32</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>16</duration>\r
+        <voice>1</voice>\r
+        <type>eighth</type>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>8</duration>\r
+        <voice>1</voice>\r
+        <type>16th</type>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>4</duration>\r
+        <voice>1</voice>\r
+        <type>32nd</type>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>2</duration>\r
+        <voice>1</voice>\r
+        <type>64th</type>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>128th</type>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>128th</type>\r
+      </note>\r
+    </measure>\r
+    <!--=======================================================-->\r
+    <measure number="5">\r
+      <note>\r
+        <rest/>\r
+        <duration>96</duration>\r
+        <voice>1</voice>\r
+        <type>half</type>\r
+        <dot/>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>32</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+      </note>\r
+    </measure>\r
+    <!--=======================================================-->\r
+    <measure number="6">\r
+      <note>\r
+        <rest/>\r
+        <duration>48</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <dot/>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>24</duration>\r
+        <voice>1</voice>\r
+        <type>eighth</type>\r
+        <dot/>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>12</duration>\r
+        <voice>1</voice>\r
+        <type>16th</type>\r
+        <dot/>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>6</duration>\r
+        <voice>1</voice>\r
+        <type>32nd</type>\r
+        <dot/>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>3</duration>\r
+        <voice>1</voice>\r
+        <type>64th</type>\r
+        <dot/>\r
+      </note>\r
+      <note>\r
+        <rest/>\r
+        <duration>2</duration>\r
+        <voice>1</voice>\r
+        <type>128th</type>\r
+        <dot/>\r
+      </note>\r
+      <barline location="right">\r
+        <bar-style>light-heavy</bar-style>\r
+      </barline>\r
+    </measure>\r
+  </part>\r
+  <!--=========================================================-->\r
+</score-partwise>\r
diff --git a/input/regression/musicxml/17a-Chords-Finale.xml b/input/regression/musicxml/17a-Chords-Finale.xml
new file mode 100644 (file)
index 0000000..fa5ed50
--- /dev/null
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"\r
+                                "http://www.musicxml.org/dtds/partwise.dtd">\r
+<score-partwise>\r
+  <movement-title>Chords example</movement-title>\r
+  <identification>\r
+    <encoding>\r
+      <software>Finale 2007 for Windows</software>\r
+      <software>Dolet Light for Finale 2007</software>\r
+      <encoding-date>2007-10-25</encoding-date>\r
+    </encoding>\r
+  </identification>\r
+  <part-list>\r
+    <score-part id="P1">\r
+      <part-name>MusicXML Part</part-name>\r
+      <score-instrument id="P1-I1">\r
+        <instrument-name>Acoustic Grand Piano</instrument-name>\r
+      </score-instrument>\r
+      <midi-instrument id="P1-I1">\r
+        <midi-channel>1</midi-channel>\r
+        <midi-program>1</midi-program>\r
+      </midi-instrument>\r
+    </score-part>\r
+  </part-list>\r
+  <!--=========================================================-->\r
+  <part id="P1">\r
+    <measure number="1">\r
+      <attributes>\r
+        <divisions>1</divisions>\r
+        <key>\r
+          <fifths>0</fifths>\r
+          <mode>major</mode>\r
+        </key>\r
+        <time symbol="common">\r
+          <beats>4</beats>\r
+          <beat-type>4</beat-type>\r
+        </time>\r
+        <clef>\r
+          <sign>G</sign>\r
+          <line>2</line>\r
+        </clef>\r
+      </attributes>\r
+      <sound tempo="120"/>\r
+      <harmony default-y="40">\r
+        <root>\r
+          <root-step>C</root-step>\r
+        </root>\r
+        <kind>major</kind>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="40">\r
+        <root>\r
+          <root-step>C</root-step>\r
+        </root>\r
+        <kind>major-seventh</kind>\r
+        <degree>\r
+          <degree-value>11</degree-value>\r
+          <degree-alter>1</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="40">\r
+        <root>\r
+          <root-step>B</root-step>\r
+        </root>\r
+        <kind>dominant</kind>\r
+        <degree>\r
+          <degree-value>5</degree-value>\r
+          <degree-alter>1</degree-alter>\r
+          <degree-type>alter</degree-type>\r
+        </degree>\r
+        <degree>\r
+          <degree-value>9</degree-value>\r
+          <degree-alter>1</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="40">\r
+        <root>\r
+          <root-step>E</root-step>\r
+          <root-alter>-1</root-alter>\r
+        </root>\r
+        <kind>major</kind>\r
+        <degree>\r
+          <degree-value>2</degree-value>\r
+          <degree-alter>0</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+    </measure>\r
+    <!--=======================================================-->\r
+    <measure number="2">\r
+      <harmony default-y="40">\r
+        <root>\r
+          <root-step>G</root-step>\r
+        </root>\r
+        <kind>minor</kind>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="40">\r
+        <root>\r
+          <root-step>D</root-step>\r
+          <root-alter>1</root-alter>\r
+        </root>\r
+        <kind>major-seventh</kind>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="40">\r
+        <root>\r
+          <root-step>A</root-step>\r
+        </root>\r
+        <kind>diminished-seventh</kind>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="40">\r
+        <root>\r
+          <root-step>A</root-step>\r
+        </root>\r
+        <kind>augmented</kind>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <barline location="right">\r
+        <bar-style>light-heavy</bar-style>\r
+      </barline>\r
+    </measure>\r
+  </part>\r
+  <!--=========================================================-->\r
+</score-partwise>\r
diff --git a/input/regression/musicxml/17b-Fretboards-Finale.xml b/input/regression/musicxml/17b-Fretboards-Finale.xml
new file mode 100644 (file)
index 0000000..bfd24c5
--- /dev/null
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"\r
+                                "http://www.musicxml.org/dtds/partwise.dtd">\r
+<score-partwise>\r
+  <movement-title>Fretboards</movement-title>\r
+  <identification>\r
+    <encoding>\r
+      <software>Finale 2007 for Windows</software>\r
+      <software>Dolet Light for Finale 2007</software>\r
+      <encoding-date>2007-10-25</encoding-date>\r
+    </encoding>\r
+  </identification>\r
+  <part-list>\r
+    <score-part id="P1">\r
+      <part-name>MusicXML Part</part-name>\r
+      <score-instrument id="P1-I1">\r
+        <instrument-name>Acoustic Grand Piano</instrument-name>\r
+      </score-instrument>\r
+      <midi-instrument id="P1-I1">\r
+        <midi-channel>1</midi-channel>\r
+        <midi-program>1</midi-program>\r
+      </midi-instrument>\r
+    </score-part>\r
+  </part-list>\r
+  <!--=========================================================-->\r
+  <part id="P1">\r
+    <measure number="1">\r
+      <attributes>\r
+        <divisions>1</divisions>\r
+        <key>\r
+          <fifths>0</fifths>\r
+          <mode>major</mode>\r
+        </key>\r
+        <time symbol="common">\r
+          <beats>4</beats>\r
+          <beat-type>4</beat-type>\r
+        </time>\r
+        <clef>\r
+          <sign>G</sign>\r
+          <line>2</line>\r
+        </clef>\r
+      </attributes>\r
+      <sound tempo="120"/>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>D</root-step>\r
+        </root>\r
+        <kind>major</kind>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>C</root-step>\r
+        </root>\r
+        <kind>dominant</kind>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>1</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>C</root-step>\r
+        </root>\r
+        <kind>minor-seventh</kind>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <first-fret>3</first-fret>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>5</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>4</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>C</root-step>\r
+        </root>\r
+        <kind>dominant</kind>\r
+        <degree>\r
+          <degree-value>13</degree-value>\r
+          <degree-alter>-1</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <first-fret>8</first-fret>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>8</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>8</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>9</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>9</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <barline location="right">\r
+        <bar-style>light-heavy</bar-style>\r
+      </barline>\r
+    </measure>\r
+  </part>\r
+  <!--=========================================================-->\r
+</score-partwise>\r
diff --git a/input/regression/musicxml/17c-ChordsFrets-Finale.xml b/input/regression/musicxml/17c-ChordsFrets-Finale.xml
new file mode 100644 (file)
index 0000000..8a5de44
--- /dev/null
@@ -0,0 +1,441 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"\r
+                                "http://www.musicxml.org/dtds/partwise.dtd">\r
+<score-partwise>\r
+  <movement-title>Chords and fretboards example</movement-title>\r
+  <identification>\r
+    <encoding>\r
+      <software>Finale 2007 for Windows</software>\r
+      <software>Dolet Light for Finale 2007</software>\r
+      <encoding-date>2007-10-26</encoding-date>\r
+    </encoding>\r
+  </identification>\r
+  <part-list>\r
+    <score-part id="P1">\r
+      <part-name>MusicXML Part</part-name>\r
+      <score-instrument id="P1-I1">\r
+        <instrument-name>Acoustic Grand Piano</instrument-name>\r
+      </score-instrument>\r
+      <midi-instrument id="P1-I1">\r
+        <midi-channel>1</midi-channel>\r
+        <midi-program>1</midi-program>\r
+      </midi-instrument>\r
+    </score-part>\r
+  </part-list>\r
+  <!--=========================================================-->\r
+  <part id="P1">\r
+    <measure number="1">\r
+      <attributes>\r
+        <divisions>1</divisions>\r
+        <key>\r
+          <fifths>0</fifths>\r
+          <mode>major</mode>\r
+        </key>\r
+        <time symbol="common">\r
+          <beats>4</beats>\r
+          <beat-type>4</beat-type>\r
+        </time>\r
+        <clef>\r
+          <sign>G</sign>\r
+          <line>2</line>\r
+        </clef>\r
+      </attributes>\r
+      <sound tempo="120"/>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>C</root-step>\r
+        </root>\r
+        <kind>major</kind>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>1</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>C</root-step>\r
+        </root>\r
+        <kind>major-seventh</kind>\r
+        <degree>\r
+          <degree-value>11</degree-value>\r
+          <degree-alter>1</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <first-fret>2</first-fret>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>5</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>4</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>5</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>B</root-step>\r
+        </root>\r
+        <kind>dominant</kind>\r
+        <degree>\r
+          <degree-value>5</degree-value>\r
+          <degree-alter>1</degree-alter>\r
+          <degree-type>alter</degree-type>\r
+        </degree>\r
+        <degree>\r
+          <degree-value>9</degree-value>\r
+          <degree-alter>1</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>1</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>E</root-step>\r
+          <root-alter>-1</root-alter>\r
+        </root>\r
+        <kind>major</kind>\r
+        <degree>\r
+          <degree-value>2</degree-value>\r
+          <degree-alter>0</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>5</frame-frets>\r
+          <first-fret>11</first-fret>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>11</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>13</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>15</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>12</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>11</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>11</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+    </measure>\r
+    <!--=======================================================-->\r
+    <measure number="2">\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>G</root-step>\r
+        </root>\r
+        <kind>minor</kind>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <first-fret>3</first-fret>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>5</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>5</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>D</root-step>\r
+          <root-alter>1</root-alter>\r
+        </root>\r
+        <kind>major-seventh</kind>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>1</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>A</root-step>\r
+        </root>\r
+        <kind>diminished-seventh</kind>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>1</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>1</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>C</root-step>\r
+        </root>\r
+        <kind>major</kind>\r
+        <frame>\r
+          <frame-strings>10</frame-strings>\r
+          <frame-frets>3</frame-frets>\r
+          <frame-note>\r
+            <string>10</string>\r
+            <fret>1</fret>\r
+            <fingering>2</fingering>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>9</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>7</string>\r
+            <fret>1</fret>\r
+            <fingering>4</fingering>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>1</fret>\r
+            <fingering>5</fingering>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>A</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+      </note>\r
+      <barline location="right">\r
+        <bar-style>light-heavy</bar-style>\r
+      </barline>\r
+    </measure>\r
+  </part>\r
+  <!--=========================================================-->\r
+</score-partwise>\r
diff --git a/input/regression/musicxml/17d-ChordsFretsOnMultistaff-Finale.xml b/input/regression/musicxml/17d-ChordsFretsOnMultistaff-Finale.xml
new file mode 100644 (file)
index 0000000..c96217b
--- /dev/null
@@ -0,0 +1,619 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"\r
+                                "http://www.musicxml.org/dtds/partwise.dtd">\r
+<score-partwise>\r
+  <movement-title>Chords and fretboards on multi-staff, multi-voice piece</movement-title>\r
+  <identification>\r
+    <encoding>\r
+      <software>Finale 2007 for Windows</software>\r
+      <software>Dolet Light for Finale 2007</software>\r
+      <encoding-date>2007-10-26</encoding-date>\r
+    </encoding>\r
+  </identification>\r
+  <part-list>\r
+    <score-part id="P1">\r
+      <part-name>Piano</part-name>\r
+      <score-instrument id="P1-I1">\r
+        <instrument-name>Piano</instrument-name>\r
+      </score-instrument>\r
+      <midi-instrument id="P1-I1">\r
+        <midi-channel>1</midi-channel>\r
+        <midi-program>1</midi-program>\r
+      </midi-instrument>\r
+    </score-part>\r
+  </part-list>\r
+  <!--=========================================================-->\r
+  <part id="P1">\r
+    <measure number="1">\r
+      <attributes>\r
+        <divisions>1</divisions>\r
+        <key>\r
+          <fifths>0</fifths>\r
+          <mode>major</mode>\r
+        </key>\r
+        <time symbol="common">\r
+          <beats>4</beats>\r
+          <beat-type>4</beat-type>\r
+        </time>\r
+        <staves>2</staves>\r
+        <clef number="1">\r
+          <sign>G</sign>\r
+          <line>2</line>\r
+        </clef>\r
+        <clef number="2">\r
+          <sign>F</sign>\r
+          <line>4</line>\r
+        </clef>\r
+      </attributes>\r
+      <sound tempo="120"/>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>5</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>5</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>E</root-step>\r
+          <root-alter>-1</root-alter>\r
+        </root>\r
+        <kind>minor-ninth</kind>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <first-fret>4</first-fret>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>6</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>4</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>6</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>6</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>5</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>5</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <backup>\r
+        <duration>4</duration>\r
+      </backup>\r
+      <note>\r
+        <pitch>\r
+          <step>F</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>2</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>F</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>2</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>F</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>2</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>F</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>2</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <backup>\r
+        <duration>4</duration>\r
+      </backup>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>C</root-step>\r
+        </root>\r
+        <kind>major</kind>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>1</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>3</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>3</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>D</root-step>\r
+        </root>\r
+        <kind>dominant</kind>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>1</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>2</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>3</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>3</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>3</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>3</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>C</root-step>\r
+        </root>\r
+        <kind>minor-seventh</kind>\r
+        <degree>\r
+          <degree-value>11</degree-value>\r
+          <degree-alter>0</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>0</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>5</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>1</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>3</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>1</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>1</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>3</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>3</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <backup>\r
+        <duration>4</duration>\r
+      </backup>\r
+      <note>\r
+        <pitch>\r
+          <step>B</step>\r
+          <octave>2</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>4</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>B</step>\r
+          <octave>2</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>4</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>B</step>\r
+          <octave>2</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>4</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>B</step>\r
+          <octave>2</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>4</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+    </measure>\r
+    <!--=======================================================-->\r
+    <measure number="2">\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>5</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>5</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>5</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>5</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>1</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <backup>\r
+        <duration>4</duration>\r
+      </backup>\r
+      <note>\r
+        <pitch>\r
+          <step>F</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>2</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>F</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>2</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>F</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>2</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>F</step>\r
+          <octave>4</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>2</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>1</staff>\r
+      </note>\r
+      <backup>\r
+        <duration>4</duration>\r
+      </backup>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>3</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>3</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>3</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>3</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <harmony default-y="100">\r
+        <root>\r
+          <root-step>G</root-step>\r
+          <root-alter>1</root-alter>\r
+        </root>\r
+        <kind>suspended-fourth</kind>\r
+        <degree>\r
+          <degree-value>7</degree-value>\r
+          <degree-alter>0</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+        <degree>\r
+          <degree-value>9</degree-value>\r
+          <degree-alter>-1</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+        <degree>\r
+          <degree-value>11</degree-value>\r
+          <degree-alter>0</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+        <degree>\r
+          <degree-value>13</degree-value>\r
+          <degree-alter>0</degree-alter>\r
+          <degree-type>add</degree-type>\r
+        </degree>\r
+        <frame>\r
+          <frame-strings>6</frame-strings>\r
+          <frame-frets>4</frame-frets>\r
+          <first-fret>4</first-fret>\r
+          <frame-note>\r
+            <string>6</string>\r
+            <fret>4</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>4</string>\r
+            <fret>4</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>3</string>\r
+            <fret>6</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>2</string>\r
+            <fret>6</fret>\r
+          </frame-note>\r
+          <frame-note>\r
+            <string>1</string>\r
+            <fret>5</fret>\r
+          </frame-note>\r
+        </frame>\r
+      </harmony>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>3</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>3</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>D</step>\r
+          <octave>3</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>3</voice>\r
+        <type>quarter</type>\r
+        <stem>up</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <backup>\r
+        <duration>4</duration>\r
+      </backup>\r
+      <note>\r
+        <pitch>\r
+          <step>B</step>\r
+          <octave>2</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>4</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>B</step>\r
+          <octave>2</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>4</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>B</step>\r
+          <octave>2</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>4</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <note>\r
+        <pitch>\r
+          <step>B</step>\r
+          <octave>2</octave>\r
+        </pitch>\r
+        <duration>1</duration>\r
+        <voice>4</voice>\r
+        <type>quarter</type>\r
+        <stem>down</stem>\r
+        <staff>2</staff>\r
+      </note>\r
+      <barline location="right">\r
+        <bar-style>light-heavy</bar-style>\r
+      </barline>\r
+    </measure>\r
+  </part>\r
+  <!--=========================================================-->\r
+</score-partwise>\r
index c4ef903a32e0a863616203ee89614da4f23854c8..ef896f9e53752ec80ab325e8966225865dc6ae23 100644 (file)
@@ -761,6 +761,8 @@ class ArticulationEvent (Event):
     def __init__ (self):
         self.type = None
         self.force_direction = None
+    def wait_for_note (self):
+        return True;
 
     def direction_mod (self):
         return { 1: '^', -1: '_', 0: '-' }.get (self.force_direction, '')
@@ -786,6 +788,39 @@ class MarkupEvent (ShortArticulationEvent):
     def ly_expression (self):
         if self.contents:
             return "%s\\markup { %s }" % (self.direction_mod (), self.contents)
+        else:
+            return ''
+
+class FretEvent (MarkupEvent):
+    def __init__ (self):
+        MarkupEvent.__init__ (self)
+        self.force_direction = 1
+        self.strings = 6
+        self.frets = 4
+        self.barre = None
+        self.elements = []
+    def ly_expression (self):
+        val = ""
+        if self.strings <> 6:
+            val += "w:%s;" % self.strings
+        if self.frets <> 4:
+            val += "h:%s;" % self.frets
+        if self.barre and len (self.barre) >= 3:
+            val += "c:%s-%s-%s;" % (self.barre[0], self.barre[1], self.barre[2])
+        have_fingering = False
+        for i in self.elements:
+            if len (i) > 1:
+                val += "%s-%s" % (i[0], i[1])
+            if len (i) > 2:
+                have_fingering = True
+                val += "-%s" % i[2]
+            val += ";"
+        if have_fingering:
+            val = "f:1;" + val
+        if val:
+            return "%s\\markup { \\fret-diagram #\"%s\" }" % (self.direction_mod (), val)
+        else:
+            return ''
 
 class TremoloEvent (ArticulationEvent):
     def __init__ (self):
index 86eca63bf7b267985a5db85089a2c7f7253de8c2..a251afa5f313427575a4a80defcac1b87b9fb7ed 100644 (file)
@@ -89,6 +89,14 @@ class Xml_node:
 
        return cn[0]
 
+    def get_named_child_value_number (self, name, default):
+        n = self.get_maybe_exist_named_child (name)
+        if n:
+            return string.atoi (n.get_text())
+        else:
+            return default
+
+
 class Music_xml_node (Xml_node):
     def __init__ (self):
        Xml_node.__init__ (self)
@@ -605,12 +613,14 @@ class Part (Music_xml_node):
 
 
        start_attr = None
+        assign_to_next_note = []
+        id = None
        for n in elements:
            voice_id = n.get_maybe_exist_typed_child (get_class ('voice'))
 
            if not (voice_id or isinstance (n, Attributes) or
                     isinstance (n, Direction) or isinstance (n, Partial) or
-                    isinstance (n, Barline) ):
+                    isinstance (n, Barline) or isinstance (n, Harmony) ):
                continue
 
            if isinstance (n, Attributes) and not start_attr:
@@ -642,13 +652,28 @@ class Part (Music_xml_node):
                     voices[v].add_element (n)
                 continue
 
+            if isinstance (n, Harmony):
+                # store the harmony element until we encounter the next note
+                # and assign it only to that one voice.
+                assign_to_next_note.append (n)
+                continue
+
            id = voice_id.get_text ()
             if hasattr (n, 'print-object') and getattr (n, 'print-object') == "no":
                 #Skip this note. 
                 pass
             else:
+                for i in assign_to_next_note:
+                    voices[id].add_element (i)
+                assign_to_next_note = []
                 voices[id].add_element (n)
 
+        # Assign all remaining elements from assign_to_next_note to the voice
+        # of the previous note:
+        for i in assign_to_next_note:
+            voices[id].add_element (i)
+        assign_to_next_note = []
+
        if start_attr:
             for (s, vids) in staff_to_voice_dict.items ():
                 staff_attributes = part.extract_attributes_for_staff (start_attr, s)
@@ -783,6 +808,30 @@ class Bend (Music_xml_node):
 class Words (Music_xml_node):
     pass
 
+class Harmony (Music_xml_node):
+    pass
+
+class Frame (Music_xml_node):
+    def get_frets (self):
+        return self.get_named_child_value_number ('frame-frets', 4)
+    def get_strings (self):
+        return self.get_named_child_value_number ('frame-strings', 6)
+    def get_first_fret (self):
+        return self.get_named_child_value_number ('first-fret', 1)
+class Frame_Note (Music_xml_node):
+    def get_string (self):
+        return self.get_named_child_value_number ('string', 1)
+    def get_fret (self):
+        return self.get_named_child_value_number ('fret', 0)
+    def get_fingering (self):
+        return self.get_named_child_value_number ('fingering', -1)
+    def get_barre (self):
+        n = self.get_maybe_exist_named_child ('barre')
+        if n:
+            return getattr (n, 'type', '')
+        else:
+            return ''
+
 
 ## need this, not all classes are instantiated
 ## for every input file. Only add those classes, that are either directly
@@ -801,8 +850,11 @@ class_dict = {
        'direction': Direction,
         'direction-type': DirType,
        'duration': Duration,
+        'frame': Frame,
+        'frame-note': Frame_Note,
         'glissando': Glissando,
        'grace': Grace,
+        'harmony': Harmony,
         'identification': Identification,
         'lyric': Lyric,
        'measure': Measure,
index 4441f5be682ef9fc24340ea9ced05f945293f0b5..7238230cb74c8915158a166f5d23ed0d62cb091f 100644 (file)
@@ -737,6 +737,40 @@ def musicxml_direction_to_lily (n):
 
     return res
 
+def musicxml_frame_to_lily_event (frame):
+    ev = musicexp.FretEvent ()
+    ev.strings = frame.get_strings ()
+    ev.frets = frame.get_frets ()
+    #offset = frame.get_first_fret () - 1
+    barre = []
+    for fn in frame.get_named_children ('frame-note'):
+        fret = fn.get_fret ()
+        if fret <= 0:
+            fret = "o"
+        el = [ fn.get_string (), fret ]
+        fingering = fn.get_fingering ()
+        if fingering >= 0:
+            el.append (fingering)
+        ev.elements.append (el)
+        b = fn.get_barre ()
+        if b == 'start':
+            barre[0] = el[0] # start string
+            barre[2] = el[1] # fret
+        elif b == 'stop':
+            barre[1] = el[0] # end string
+    if barre:
+        ev.barre = barre
+    return ev
+
+def musicxml_harmony_to_lily (n):
+    res = []
+    for f in n.get_named_children ('frame'):
+        ev = musicxml_frame_to_lily_event (f)
+        if ev:
+            res.append (ev)
+
+    return res
+
 instrument_drumtype_dict = {
     'Acoustic Snare Drum': 'acousticsnare',
     'Side Stick': 'sidestick',
@@ -938,7 +972,15 @@ def musicxml_voice_to_lily_voice (voice):
                 else:
                     voice_builder.add_command (a)
             continue
-        
+
+        if isinstance (n, musicxml.Harmony):
+            for a in musicxml_harmony_to_lily (n):
+                if a.wait_for_note ():
+                    voice_builder.add_dynamics (a)
+                else:
+                    voice_builder.add_command (a)
+            continue
+
         is_chord = n.get_maybe_exist_named_child ('chord')
         if not is_chord:
             try: