--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.1 Partwise//EN"
+ "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise>
+ <identification>
+ <miscellaneous>
+ <miscellaneous-field name="description">System and page breaks, given in
+ a <print> element</miscellaneous-field>
+ </miscellaneous>
+ </identification>
+ <part-list>
+ <score-part id="P1">
+ <part-name print-object="no">MusicXML Part</part-name>
+ </score-part>
+ </part-list>
+ <!--=========================================================-->
+ <part id="P1">
+ <measure number="1">
+ <attributes>
+ <divisions>1</divisions>
+ <time symbol="common">
+ <beats>4</beats>
+ <beat-type>4</beat-type>
+ </time>
+ </attributes>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ </note>
+ </measure>
+ <!--=======================================================-->
+ <measure number="2">
+ <print new-system="yes"/>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ </note>
+ </measure>
+ <!--=======================================================-->
+ <measure number="3">
+ <print new-page="yes"/>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ </note>
+ </measure>
+ </part>
+ <!--=========================================================-->
+</score-partwise>
return 'R%s' % self.duration.ly_expression ()
+class Break (Music):
+ def __init__ (self, tp="break"):
+ Music.__init__ (self)
+ self.type = tp
+ def print_ly (self, printer):
+ if self.type:
+ printer.dump ("\\%s" % self.type)
+
class StaffGroup:
def __init__ (self, command = "StaffGroup"):
self.stafftype = command
if not (isinstance (n, Note) or isinstance (n, Attributes) or
isinstance (n, Direction) or isinstance (n, Partial) or
isinstance (n, Barline) or isinstance (n, Harmony) or
- isinstance (n, FiguredBass) ):
+ isinstance (n, FiguredBass) or isinstance (n, Print)):
continue
if isinstance (n, Attributes) and not start_attr:
voices[v].add_element (staff_attributes)
continue
- if isinstance (n, Partial) or isinstance (n, Barline):
+ if isinstance (n, Partial) or isinstance (n, Barline) or isinstance (n, Print):
for v in voices.keys ():
voices[v].add_element (n)
continue
class PerMinute (Music_xml_node):
pass
+class Print (Music_xml_node):
+ pass
+
## need this, not all classes are instantiated
'pedal': Pedal,
'per-minute': PerMinute,
'pitch': Pitch,
+ 'print': Print,
'rest': Rest,
'root': Root,
'score-part': Score_part,
elts.append (ev)
return elts
+
+def musicxml_print_to_lily (el):
+ # TODO: Implement other print attributes
+ # <!ELEMENT print (page-layout?, system-layout?, staff-layout*,
+ # measure-layout?, measure-numbering?, part-name-display?,
+ # part-abbreviation-display?)>
+ # <!ATTLIST print
+ # staff-spacing %tenths; #IMPLIED
+ # new-system %yes-no; #IMPLIED
+ # new-page %yes-no-number; #IMPLIED
+ # blank-page NMTOKEN #IMPLIED
+ # page-number CDATA #IMPLIED
+ # >
+ elts = []
+ if (hasattr (el, "new-system")):
+ val = getattr (el, "new-system")
+ if (val == "yes"):
+ elts.append (musicexp.Break ("break"))
+ if (hasattr (el, "new-page")):
+ val = getattr (el, "new-page")
+ if (val == "yes"):
+ elts.append (musicexp.Break ("pageBreak"))
+ return elts
+
class Marker (musicexp.Music):
def __init__ (self):
chordnames_builder.add_barline (a, False)
continue
+
+ if isinstance (n, musicxml.Print):
+ for a in musicxml_print_to_lily (n):
+ voice_builder.add_command (a, False)
+ continue
+
# Continue any multimeasure-rests before trying to add bar checks!
# Don't handle new MM rests yet, because for them we want bar checks!
rest = n.get_maybe_exist_typed_child (musicxml.Rest)