diff --git a/ly/musicxml/lymus2musxml.py b/ly/musicxml/lymus2musxml.py index 13dfb733..b14427af 100644 --- a/ly/musicxml/lymus2musxml.py +++ b/ly/musicxml/lymus2musxml.py @@ -331,6 +331,12 @@ def check_tuplet(self): def Duration(self, duration): """A written duration""" + + if isinstance(duration.parent(), ly.music.items.Partial): + # No need to handle the duration element for a \partial element + # unless barcheck should be implemented + return + if self.tempo: self.mediator.new_tempo(duration.token, duration.tokens, *self.tempo) self.tempo = () @@ -550,6 +556,10 @@ def LyricMode(self, lyricmode): r"""A \lyricmode, \lyrics or \addlyrics expression.""" self.alt_mode = 'lyric' + def Partial(self, partial): + r"""A \partial node""" + pass + def Override(self, override): r"""An \override command.""" self.override_key = '' diff --git a/tests/test_xml.py b/tests/test_xml.py index e25f6ae5..e447ffe1 100644 --- a/tests/test_xml.py +++ b/tests/test_xml.py @@ -31,6 +31,10 @@ def test_tuplet(): compare_output('tuplet') +def test_partial(): + compare_output('partial') + + def ly_to_xml(filename): """Read Lilypond file and return XML string.""" writer = ly.musicxml.writer() diff --git a/tests/test_xml_files/partial.ly b/tests/test_xml_files/partial.ly new file mode 100644 index 00000000..057cbf22 --- /dev/null +++ b/tests/test_xml_files/partial.ly @@ -0,0 +1,6 @@ +\score { + \relative c' { + \partial 4 c8 c | d1 | + } + \layout{} +} diff --git a/tests/test_xml_files/partial.xml b/tests/test_xml_files/partial.xml new file mode 100644 index 00000000..646877da --- /dev/null +++ b/tests/test_xml_files/partial.xml @@ -0,0 +1,61 @@ + + + + + + python-ly 0.9.5 + 2017-04-07 + + + + + + + + + + + 2 + + + G + 2 + + + + + C + 4 + + 1 + 1 + eighth + + + + C + 4 + + 1 + 1 + eighth + + + + + + D + 4 + + 8 + 1 + whole + + + + +