# page-number CDATA #IMPLIED
# >
elts = []
- if (hasattr (el, "new-system")):
+ if (hasattr (el, "new-system") and conversion_settings.convert_page_layout):
val = getattr (el, "new-system")
if (val == "yes"):
elts.append (musicexp.Break ("break"))
- if (hasattr (el, "new-page")):
+ if (hasattr (el, "new-page") and conversion_settings.convert_page_layout):
val = getattr (el, "new-page")
if (val == "yes"):
elts.append (musicexp.Break ("pageBreak"))
voice_builder.set_measure_length (current_measure_length)
for n in voice._elements:
+ tie_started = False
if n.get_name () == 'forward':
continue
staff = n.get_maybe_exist_named_child ('staff')
if mxl_tie and mxl_tie.type == 'start':
ev_chord.append (musicexp.TieEvent ())
is_tied = True
+ tie_started = True
else:
is_tied = False
if not lnr in note_lyrics_processed:
lyrics[lnr].append ("\skip4")
- ## force trailing mm rests to be written out.
+ # Assume that a <tie> element only lasts for one note.
+ # This might not be correct MusicXML interpretation, but works for
+ # most cases and fixes broken files, which have the end tag missing
+ if is_tied and not tie_started:
+ is_tied = False
+
+ ## force trailing mm rests to be written out.
voice_builder.add_music (musicexp.ChordEvent (), Rational (0))
ly_voice = group_tuplets (voice_builder.elements, tuplet_events)
dest = "convert_rest_positions",
help = _ ("do not convert exact vertical positions of rests"))
+ p.add_option ('--npl', '--no-page-layout',
+ action = "store_false",
+ default = True,
+ dest = "convert_page_layout",
+ help = _ ("do not convert the exact page layout and breaks"))
+
p.add_option ('--no-beaming',
action = "store_false",
default = True,
print_ly_additional_definitions (printer, filename)
if score_information:
score_information.print_ly (printer)
- if paper_information:
+ if paper_information and conversion_settings.convert_page_layout:
paper_information.print_ly (printer)
if layout_information:
layout_information.print_ly (printer)
needed_additional_definitions.append (options.language)
additional_definitions[options.language] = "\\include \"%s.ly\"\n" % options.language
conversion_settings.ignore_beaming = not options.convert_beaming
+ conversion_settings.convert_page_layout = options.convert_page_layout
# Allow the user to leave out the .xml or xml on the filename
basefilename = args[0].decode('utf-8')