If lyrics syllables contain parentheses ( or ), we also need to wrap that
syllables in quotes.
It seems that some scanning applications write out some notes without a
<duration> child element. Work around this case and use a default value
instead of crashing. The user has to adjust the .ly file anyway.
def escape_ly_output_string (input_string):
return_string = input_string
def escape_ly_output_string (input_string):
return_string = input_string
- needs_quotes = re.search ("[0-9\" ,._-]", return_string);
+ needs_quotes = re.search ("[-0-9\" ,._()]", return_string);
return_string = string.replace (return_string, "\"", "\\\"")
if needs_quotes:
return_string = "\"" + return_string + "\""
return_string = string.replace (return_string, "\"", "\\\"")
if needs_quotes:
return_string = "\"" + return_string + "\""
def musicxml_duration_to_lily (mxl_note):
d = musicexp.Duration ()
if mxl_note.get_maybe_exist_typed_child (musicxml.Type):
def musicxml_duration_to_lily (mxl_note):
d = musicexp.Duration ()
if mxl_note.get_maybe_exist_typed_child (musicxml.Type):
- d.duration_log = mxl_note.get_duration_log ()
+ duration_log = mxl_note.get_duration_log ()
+ if duration_log:
+ d.duration_log = mxl_note.get_duration_log ()
+ else:
+ d.duration_log = 0