]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git://git.sv.gnu.org/lilypond
authorGraham Percival <graham@percival-music.ca>
Tue, 25 Mar 2008 07:15:38 +0000 (00:15 -0700)
committerGraham Percival <graham@percival-music.ca>
Tue, 25 Mar 2008 07:15:38 +0000 (00:15 -0700)
13 files changed:
.gitignore
buildscripts/add_html_footer.py
buildscripts/generate_intervals.py [deleted file]
buildscripts/generate_keys.py [deleted file]
buildscripts/generate_timesignatures.py [deleted file]
buildscripts/musicxml_generate_intervals.py [new file with mode: 0755]
buildscripts/musicxml_generate_keys.py [new file with mode: 0755]
buildscripts/musicxml_generate_timesignatures.py [new file with mode: 0755]
make/lilypond-vars.make
python/musicexp.py
scripts/lilypond-book.py
scripts/midi2ly.py
scripts/musicxml2ly.py

index 014cbcf08c8def43529e5d3365ab55d26903733f..ad4f7605c342ed3d5ba1c2b541989653db523a74 100644 (file)
@@ -64,6 +64,7 @@ configure
 gcstat*.scm
 lily-[0-9a-f][0-9a-f][0-9a-f]*
 nohup.out
+out
 out-cov
 out-scons
 out-test
index 7f30c94edca2ae4555372b7875a9906f6f71926d..47589baeeab4dc0536392a72039c4ff75e416228 100644 (file)
@@ -69,7 +69,7 @@ html_re = re.compile ('(.*?)(?:[.]([^/.]*))?[.]html$')
 pages_dict = {}
 
 def build_pages_dict (filelist):
-    """Build dictionnary of available translations of each page"""
+    """Build dictionary of available translations of each page"""
     global pages_dict
     for f in filelist:
         m = html_re.match (f)
diff --git a/buildscripts/generate_intervals.py b/buildscripts/generate_intervals.py
deleted file mode 100755 (executable)
index dbde2bc..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-
-notes = "CDEFGAB"
-alterations = [-1, 0, 1]
-
-def print_note (octave, note, alteration):
-    print "      <note>\n        <pitch>\n          <step>%s</step>" % notes[note]
-    if alteration <> 0:
-        print "          <alter>%s</alter>" % alteration
-    print "          <octave>%s</octave>\n        </pitch>\n        <duration>1</duration>\n        <voice>1</voice>\n        <type>quarter</type>\n      </note>" % octave
-
-
-print """<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
-                                "http://www.musicxml.org/dtds/partwise.dtd">
-<score-partwise>
-  <movement-title>Various piches and interval sizes</movement-title>
-  <part-list>
-    <score-part id="P1">
-      <part-name>MusicXML Part</part-name>
-    </score-part>
-  </part-list>
-  <!--=========================================================-->
-  <part id="P1">
-    <measure number="1">
-      <attributes>
-        <divisions>1</divisions>
-        <key>
-          <fifths>0</fifths>
-          <mode>major</mode>
-        </key>
-        <time symbol="common">
-          <beats>2</beats>
-          <beat-type>4</beat-type>
-        </time>
-        <clef>
-          <sign>G</sign>
-          <line>2</line>
-        </clef>
-      </attributes>
-"""
-
-start_octave = 5
-
-for octave in (start_octave, start_octave+1):
-    for note in (0,1,2,3,4,5,6):
-        for alteration in alterations:
-            if octave == start_octave and note == 0 and alteration == -1:
-                continue
-            print_note (octave, note, alteration)
-#             if octave == start_octave and note == 0 and alteration == 0:
-#                 continue
-            print_note (start_octave-(octave-start_octave)-(1-(7-note)/7), (7-note)%7, -alteration)
-
-print """    </measure>
-  </part>
-</score-partwise>
-"""
\ No newline at end of file
diff --git a/buildscripts/generate_keys.py b/buildscripts/generate_keys.py
deleted file mode 100755 (executable)
index cd0f995..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-
-notes = "CDEFGAB"
-alterations = [-1, 0, 1]
-
-def print_measure (nr, fifth, mode, atts = "", final = ""):
-    print """    <measure number="%s">
-      <attributes>
-%s        <key>
-          <fifths>%s</fifths>
-          <mode>%s</mode>
-        </key>
-      </attributes>
-      <note>
-        <pitch>
-          <step>C</step>
-          <octave>4</octave>
-        </pitch>
-        <duration>2</duration>
-        <voice>1</voice>
-        <type>half</type>
-      </note>
-%s    </measure>""" % (nr, atts,  fifth, mode, final)
-
-first_atts = """        <divisions>1</divisions>
-        <time symbol="common">
-          <beats>2</beats>
-          <beat-type>4</beat-type>
-        </time>
-        <clef>
-          <sign>G</sign>
-          <line>2</line>
-        </clef>
-"""
-
-final_barline = """      <barline location="right">
-        <bar-style>light-heavy</bar-style>
-      </barline>
-"""
-
-print """<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
-                                "http://www.musicxml.org/dtds/partwise.dtd">
-<score-partwise>
-  <movement-title>Different Key signatures</movement-title>
-  <part-list>
-    <score-part id="P1">
-      <part-name>MusicXML Part</part-name>
-    </score-part>
-  </part-list>
-  <!--=========================================================-->
-  <part id="P1">
-"""
-
-max_range = 11
-measure = 0
-for fifth in range(-max_range, max_range+1):
-    measure += 1
-    if fifth == -max_range:
-        print_measure (measure, fifth, "major", first_atts)
-    else:
-        print_measure (measure, fifth, "major")
-    measure += 1
-    if fifth == max_range:
-        print_measure (measure, fifth, "minor", "", final_barline)
-    else:
-        print_measure (measure, fifth, "minor")
-    
-
-print """  </part>
-</score-partwise>
-"""
\ No newline at end of file
diff --git a/buildscripts/generate_timesignatures.py b/buildscripts/generate_timesignatures.py
deleted file mode 100755 (executable)
index 9844f3d..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/env python
-
-notes = "CDEFGAB"
-alterations = [-1, 0, 1]
-
-def print_measure (nr, beats, type, params = "", attr = "", barline = ""):
-    print """    <measure number="%s">
-      <attributes>
-%s        <time %s>
-          <beats>%s</beats>
-          <beat-type>%s</beat-type>
-        </time>
-      </attributes>
-      <note>
-        <pitch>
-          <step>C</step>
-          <octave>5</octave>
-        </pitch>
-        <duration>1</duration>
-        <voice>1</voice>
-        <type>quarter</type>
-      </note>
-%s    </measure>""" % (nr, attr, params, beats, type, barline)
-
-first_atts = """        <divisions>1</divisions>
-        <key>
-          <fifths>0</fifths>
-          <mode>major</mode>
-        </key>
-        <time symbol="common">
-          <beats>2</beats>
-          <beat-type>4</beat-type>
-        </time>
-        <clef>
-          <sign>G</sign>
-          <line>2</line>
-        </clef>
-"""
-
-final_barline = """      <barline location="right">
-        <bar-style>light-heavy</bar-style>
-      </barline>
-"""
-
-print """<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
-                                "http://www.musicxml.org/dtds/partwise.dtd">
-<score-partwise>
-  <movement-title>Different time signatures</movement-title>
-  <part-list>
-    <score-part id="P1">
-      <part-name>MusicXML Part</part-name>
-    </score-part>
-  </part-list>
-  <!--=========================================================-->
-  <part id="P1">
-"""
-
-measure = 1
-
-print_measure (measure, 2, 2, " symbol=\"common\"", first_atts)
-measure += 1
-
-print_measure (measure, 4, 4, " symbol=\"common\"")
-measure += 1
-
-print_measure (measure, 2, 2)
-measure += 1
-
-print_measure (measure, 3, 2)
-measure += 1
-
-print_measure (measure, 2, 4)
-measure += 1
-
-print_measure (measure, 3, 4)
-measure += 1
-
-print_measure (measure, 4, 4)
-measure += 1
-
-print_measure (measure, 5, 4)
-measure += 1
-
-print_measure (measure, 3, 8)
-measure += 1
-
-print_measure (measure, 6, 8)
-measure += 1
-
-print_measure (measure, 12, 8, "", "", final_barline)
-measure += 1
-
-print """  </part>
-</score-partwise>
-"""
\ No newline at end of file
diff --git a/buildscripts/musicxml_generate_intervals.py b/buildscripts/musicxml_generate_intervals.py
new file mode 100755 (executable)
index 0000000..dbde2bc
--- /dev/null
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+
+notes = "CDEFGAB"
+alterations = [-1, 0, 1]
+
+def print_note (octave, note, alteration):
+    print "      <note>\n        <pitch>\n          <step>%s</step>" % notes[note]
+    if alteration <> 0:
+        print "          <alter>%s</alter>" % alteration
+    print "          <octave>%s</octave>\n        </pitch>\n        <duration>1</duration>\n        <voice>1</voice>\n        <type>quarter</type>\n      </note>" % octave
+
+
+print """<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
+                                "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise>
+  <movement-title>Various piches and interval sizes</movement-title>
+  <part-list>
+    <score-part id="P1">
+      <part-name>MusicXML Part</part-name>
+    </score-part>
+  </part-list>
+  <!--=========================================================-->
+  <part id="P1">
+    <measure number="1">
+      <attributes>
+        <divisions>1</divisions>
+        <key>
+          <fifths>0</fifths>
+          <mode>major</mode>
+        </key>
+        <time symbol="common">
+          <beats>2</beats>
+          <beat-type>4</beat-type>
+        </time>
+        <clef>
+          <sign>G</sign>
+          <line>2</line>
+        </clef>
+      </attributes>
+"""
+
+start_octave = 5
+
+for octave in (start_octave, start_octave+1):
+    for note in (0,1,2,3,4,5,6):
+        for alteration in alterations:
+            if octave == start_octave and note == 0 and alteration == -1:
+                continue
+            print_note (octave, note, alteration)
+#             if octave == start_octave and note == 0 and alteration == 0:
+#                 continue
+            print_note (start_octave-(octave-start_octave)-(1-(7-note)/7), (7-note)%7, -alteration)
+
+print """    </measure>
+  </part>
+</score-partwise>
+"""
\ No newline at end of file
diff --git a/buildscripts/musicxml_generate_keys.py b/buildscripts/musicxml_generate_keys.py
new file mode 100755 (executable)
index 0000000..cd0f995
--- /dev/null
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+
+notes = "CDEFGAB"
+alterations = [-1, 0, 1]
+
+def print_measure (nr, fifth, mode, atts = "", final = ""):
+    print """    <measure number="%s">
+      <attributes>
+%s        <key>
+          <fifths>%s</fifths>
+          <mode>%s</mode>
+        </key>
+      </attributes>
+      <note>
+        <pitch>
+          <step>C</step>
+          <octave>4</octave>
+        </pitch>
+        <duration>2</duration>
+        <voice>1</voice>
+        <type>half</type>
+      </note>
+%s    </measure>""" % (nr, atts,  fifth, mode, final)
+
+first_atts = """        <divisions>1</divisions>
+        <time symbol="common">
+          <beats>2</beats>
+          <beat-type>4</beat-type>
+        </time>
+        <clef>
+          <sign>G</sign>
+          <line>2</line>
+        </clef>
+"""
+
+final_barline = """      <barline location="right">
+        <bar-style>light-heavy</bar-style>
+      </barline>
+"""
+
+print """<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
+                                "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise>
+  <movement-title>Different Key signatures</movement-title>
+  <part-list>
+    <score-part id="P1">
+      <part-name>MusicXML Part</part-name>
+    </score-part>
+  </part-list>
+  <!--=========================================================-->
+  <part id="P1">
+"""
+
+max_range = 11
+measure = 0
+for fifth in range(-max_range, max_range+1):
+    measure += 1
+    if fifth == -max_range:
+        print_measure (measure, fifth, "major", first_atts)
+    else:
+        print_measure (measure, fifth, "major")
+    measure += 1
+    if fifth == max_range:
+        print_measure (measure, fifth, "minor", "", final_barline)
+    else:
+        print_measure (measure, fifth, "minor")
+    
+
+print """  </part>
+</score-partwise>
+"""
\ No newline at end of file
diff --git a/buildscripts/musicxml_generate_timesignatures.py b/buildscripts/musicxml_generate_timesignatures.py
new file mode 100755 (executable)
index 0000000..9844f3d
--- /dev/null
@@ -0,0 +1,96 @@
+#!/usr/bin/env python
+
+notes = "CDEFGAB"
+alterations = [-1, 0, 1]
+
+def print_measure (nr, beats, type, params = "", attr = "", barline = ""):
+    print """    <measure number="%s">
+      <attributes>
+%s        <time %s>
+          <beats>%s</beats>
+          <beat-type>%s</beat-type>
+        </time>
+      </attributes>
+      <note>
+        <pitch>
+          <step>C</step>
+          <octave>5</octave>
+        </pitch>
+        <duration>1</duration>
+        <voice>1</voice>
+        <type>quarter</type>
+      </note>
+%s    </measure>""" % (nr, attr, params, beats, type, barline)
+
+first_atts = """        <divisions>1</divisions>
+        <key>
+          <fifths>0</fifths>
+          <mode>major</mode>
+        </key>
+        <time symbol="common">
+          <beats>2</beats>
+          <beat-type>4</beat-type>
+        </time>
+        <clef>
+          <sign>G</sign>
+          <line>2</line>
+        </clef>
+"""
+
+final_barline = """      <barline location="right">
+        <bar-style>light-heavy</bar-style>
+      </barline>
+"""
+
+print """<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"
+                                "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise>
+  <movement-title>Different time signatures</movement-title>
+  <part-list>
+    <score-part id="P1">
+      <part-name>MusicXML Part</part-name>
+    </score-part>
+  </part-list>
+  <!--=========================================================-->
+  <part id="P1">
+"""
+
+measure = 1
+
+print_measure (measure, 2, 2, " symbol=\"common\"", first_atts)
+measure += 1
+
+print_measure (measure, 4, 4, " symbol=\"common\"")
+measure += 1
+
+print_measure (measure, 2, 2)
+measure += 1
+
+print_measure (measure, 3, 2)
+measure += 1
+
+print_measure (measure, 2, 4)
+measure += 1
+
+print_measure (measure, 3, 4)
+measure += 1
+
+print_measure (measure, 4, 4)
+measure += 1
+
+print_measure (measure, 5, 4)
+measure += 1
+
+print_measure (measure, 3, 8)
+measure += 1
+
+print_measure (measure, 6, 8)
+measure += 1
+
+print_measure (measure, 12, 8, "", "", final_barline)
+measure += 1
+
+print """  </part>
+</score-partwise>
+"""
\ No newline at end of file
index e6f12ba7b03d7ef295ea6db3258217caeba05560..5cbd5537cbe6df52998f95d5ca452ad711197d83 100644 (file)
@@ -37,9 +37,13 @@ LILYPOND_BOOK_FLAGS = $(LILYPOND_BOOK_VERBOSE) $(LILYPOND_BOOK_INFO_IMAGES_DIR)
 
 ifeq ($(out),)
 LILYPOND_BOOK_PROCESS = true
+LILYPOND_BOOK_FLAGS += --no-lily-run
 else
 LILYPOND_BOOK_PROCESS = $(LILYPOND_BINARY)
 endif
+ifeq ($(out),test)
+LILYPOND_BOOK_FLAGS += --skip-png-check
+endif
 
 TEXINPUTS=$(top-src-dir)/tex/::
 export TEXINPUTS
index 862b5d8c4f70f5148c0a5b1899588b1859014c59..2ae8a6784f3ea480f3343d6539323fd79ec706d0 100644 (file)
@@ -859,9 +859,17 @@ class TextSpannerEvent (SpanEvent):
             1:'\\stopTextSpan'}.get (self.span_direction, '')
 
 class BracketSpannerEvent (SpanEvent):
+    # Ligature brackets use prefix-notation!!!
+    def print_before_note (self, printer):
+        if self.span_direction == -1:
+            printer.dump ('\[')
+    # the the bracket after the last note
+    def print_after_note (self, printer):
+        if self.span_direction == 1:
+            printer.dump ('\]')
+    # we're printing everything in print_(before|after)_note...
     def ly_expression (self):
-        return {-1: '\\startGroup',
-            1:'\\stopGroup'}.get (self.span_direction, '')
+        return '';
 
 
 class OctaveShiftEvent (SpanEvent):
index e24045f983147fa60d6508b40f690a03f2554f04..553bbed1ffe433c712cee93ffbccf80f249127ee 100644 (file)
@@ -146,6 +146,18 @@ def get_option_parser ():
                   action='store', dest='output_dir',
                   default='')
     
+    p.add_option ('--skip-lily-check',
+                  help=_ ("do not fail if no lilypond output is found."),
+                  metavar=_ ("DIR"),
+                  action='store_true', dest='skip_lilypond_run',
+                  default=False)
+
+    p.add_option ('--skip-png-check',
+                  help=_ ("do not fail if no PNG images are found for EPS files"),
+                  metavar=_ ("DIR"),
+                  action='store_true', dest='skip_png_check',
+                  default=False)
+    
     p.add_option ('--lily-output-dir',
                   help=_ ("write lily-XXX files to DIR, link into --output dir."),
                   metavar=_ ("DIR"),
@@ -1116,7 +1128,10 @@ class LilypondSnippet (Snippet):
         return re.sub (r'\\(version|sourcefileline|sourcefilename)[^\n]*\n', '', ly)
 
     def link_all_output_files (self, output_dir, output_dir_files, destination):
-        existing = self.all_output_files (output_dir, output_dir_files)
+        existing, missing = self.all_output_files (output_dir, output_dir_files)
+        if missing:
+            print '\nMissing', missing
+            raise CompileError(self.basename())
         for name in existing:
             try:
                 os.unlink (os.path.join (destination, name))
@@ -1133,61 +1148,64 @@ class LilypondSnippet (Snippet):
 
         output_dir_files is the list of files in the output directory.
         """
-        class Missing(Exception):
-            pass
-        
-        result = set()
+        result = set ()
+        missing = set ()
         base = self.basename()
         full = os.path.join (output_dir, base)
         def consider_file (name):
             if name in output_dir_files:
                 result.add (name)
-
+             
         def require_file (name):
-            if name not in output_dir_files:
-                raise Missing
-            result.add (name)
-
-        try:
-            for required in [base + '.ly',
-                             base + '.txt',
-                             base + '-systems.count']:
-                require_file (required)
-
-            map (consider_file, [base + '.tex',
-                                 base + '.eps',
-                                 base + '.texidoc',
-                                 base + '-systems.texi',
-                                 base + '-systems.tex',
-                                 base + '-systems.pdftexi'])
-
-            if base + '.eps' in result and self.format in (HTML, TEXINFO):
-                page_count = ps_page_count (full + '.eps')
-                if page_count <= 1:
-                    require_file (base + '.png')
-                else:
-                    for page in range (1, page_count + 1):
-                        require_file (base + '-page%d.png' % page)
+            if name in output_dir_files:
+                result.add (name)
+            else:
+                missing.add (name)
+
+        # UGH - junk global_options
+        skip_lily = global_options.skip_lilypond_run
+        for required in [base + '.ly',
+                         base + '.txt']:
+            require_file (required)
+        if not skip_lily:
+            require_file (base + '-systems.count')
+
+        map (consider_file, [base + '.tex',
+                             base + '.eps',
+                             base + '.texidoc',
+                             base + '-systems.texi',
+                             base + '-systems.tex',
+                             base + '-systems.pdftexi'])
+
+        # UGH - junk global_options
+        if (base + '.eps' in result and self.format in (HTML, TEXINFO)
+            and not global_options.skip_png_check):
+            page_count = ps_page_count (full + '.eps')
+            if page_count <= 1:
+                require_file (base + '.png')
+            else:
+                for page in range (1, page_count + 1):
+                    require_file (base + '-page%d.png' % page)
 
+        system_count = 0
+        if not skip_lily and not missing:
             system_count = int(file (full + '-systems.count').read())
-            for number in range(1, system_count + 1):
-                systemfile = '%s-%d' % (base, number)
-                require_file (systemfile + '.eps')
-                consider_file (systemfile + '.pdf')
-        except Missing:
-            return None
+        for number in range(1, system_count + 1):
+            systemfile = '%s-%d' % (base, number)
+            require_file (systemfile + '.eps')
+            consider_file (systemfile + '.pdf')
         
-        return result
+        return (result, missing)
     
     def is_outdated (self, output_dir, current_files):
-        return self.all_output_files (output_dir, current_files) is None
+        found, missing = self.all_output_files (output_dir, current_files)
+        return missing
     
     def filter_text (self):
         """Run snippet bodies through a command (say: convert-ly).
 
         This functionality is rarely used, and this code must have bitrot.
         """
-        
         code = self.substring ('code')
         s = filter_pipe (code, global_options.filter_cmd)
         d = {
@@ -1378,7 +1396,7 @@ def find_linestarts (s):
 def find_toplevel_snippets (input_string, format, types):
     res = {}
     for t in types:
-        res[t] = ly.re.compile (snippet_res[format][t])
+        res[t] = re.compile (snippet_res[format][t])
 
     snippets = []
     index = 0
index 810b9108c6ef6102cae9b75b09a43e8aa561043d..6fb037092cb168dcfc46bd6f3f073cddb2bb1677 100644 (file)
@@ -39,10 +39,9 @@ global _;_=ly._
 
 output_name = ''
 LINE_BELL = 60
-scale_steps = [0,2,4,5,7,9,11]
+scale_steps = [0, 2, 4, 5, 7, 9, 11]
 global_options = None
 
-
 clocks_per_1 = 1536
 clocks_per_4 = 0
 
@@ -100,7 +99,6 @@ def strip_extension (f, ext):
     return p + e
 
 
-
 class Duration:
     allowed_durs = (1, 2, 4, 8, 16, 32, 64, 128)
     def __init__ (self, clocks):
index f808a8325b5a67655ac0cd3ffce223258a332150..a429b752510dbcb104937f080be03548f4493572 100644 (file)
@@ -727,15 +727,10 @@ def musicxml_barline_to_lily (barline):
 
     return retval.values ()
 
-# Brackets need a special engraver added the Staff context!
-def musicxml_bracket_to_ly ():
-    layout_information.set_context_item ('Staff', '\consists "Horizontal_bracket_engraver"  % for \\startGroup and \\stopGroup brackets')
-    return musicexp.BracketSpannerEvent ()
-
 spanner_event_dict = {
     'beam' : musicexp.BeamEvent,
     'dashes' : musicexp.TextSpannerEvent,
-    'bracket' : musicxml_bracket_to_ly,
+    'bracket' : musicexp.BracketSpannerEvent,
     'glissando' : musicexp.GlissandoEvent,
     'octave-shift' : musicexp.OctaveShiftEvent,
     'pedal' : musicexp.PedalEvent,
@@ -1653,7 +1648,13 @@ def musicxml_voice_to_lily_voice (voice):
                 ev = musicxml_spanner_to_lily_event (a)
                 if ev:
                     ev_chord.append (ev)
-                
+
+            # accidental-marks are direct children of <notation>!
+            for a in notations.get_named_children ('accidental-mark'):
+                ev = musicxml_articulation_to_lily_event (a)
+                if ev:
+                    ev_chord.append (ev)
+
             # Articulations can contain the following child elements:
             #         accent | strong-accent | staccato | tenuto |
             #         detached-legato | staccatissimo | spiccato |