1:'\\stopGroup'}.get (self.span_direction, '')
-# type==-1 means octave up, type==-2 means octave down
class OctaveShiftEvent (SpanEvent):
def wait_for_note (self):
return False
return self.get_encoding_information ('encoder')
def get_encoding_description (self):
return self.get_encoding_information ('encoding-description')
+
+ def get_encoding_software_list (self):
+ enc = self.get_named_children ('encoding')
+ software = []
+ for e in enc:
+ softwares = e.get_named_children ('software')
+ for s in softwares:
+ software.append (s.get_text ())
+ return software
+
class Duration (Music_xml_node):
# Store command-line options in a global variable, so we can access them everythwere
options = None
+class Conversion_Settings:
+ def __init__(self):
+ self.ignore_beaming = False
+
+conversion_settings = Conversion_Settings ()
+
def progress (str):
ly.stderr_write (str + '\n')
sys.stderr.flush ()
set_if_exists ('encoder', ids.get_encoding_person ())
set_if_exists ('encodingdescription', ids.get_encoding_description ())
+ # Finally, apply the required compatibility modes
+ # Some applications created wrong MusicXML files, so we need to
+ # apply some compatibility mode, e.g. ignoring some features/tags
+ # in those files
+ software = ids.get_encoding_software_list ()
+ global conversion_settings
+
+ # Case 1: "Sibelius 5.1" with the "Dolet 3.4 for Sibelius" plugin
+ # is missing all beam ends => ignore all beaming information
+ if "Dolet 3.4 for Sibelius" in software:
+ conversion_settings.ignore_beaming = True
+ # TODO: Check for other unsupported features
+
return header
class PartGroupInfo:
mxl_beams = [b for b in n.get_named_children ('beam')
if (b.get_type () in ('begin', 'end')
and b.is_primary ())]
- if mxl_beams:
+ if mxl_beams and not conversion_settings.ignore_beaming:
beam_ev = musicxml_spanner_to_lily_event (mxl_beams[0])
if beam_ev:
ev_chord.append (beam_ev)