]> git.donarmstrong.com Git - lilypond.git/commitdiff
musicxml2ly: Fix title, chord symbol and midi bugs.
authorPatrick Schmidt <ptrcklschmdt@gmail.com>
Fri, 22 Jun 2012 09:45:04 +0000 (05:45 -0400)
committerJulien Rioux <jrioux@physics.utoronto.ca>
Wed, 27 Jun 2012 14:07:44 +0000 (10:07 -0400)
Fix for several musicxml2ly bugs:

Titles and headers can now contain single words followed by a
punctuation mark (.,!:).  See issue 1983.

Chord symbols are now placed above staffs instead of below.
See issue 2537.

musicxml2ly now includes an out-commented midi-block in every .ly-file.

Docs: Added command line options -m and --midi to Usage

Documentation/usage/external.itely
python/musicexp.py
python/musicxml.py
scripts/musicxml2ly.py

index 1668953b1ffad9690aa3e7600abf05b55de61c89..eba0be3f1b69e3b61cadc3f35410ead7f498fa17 100644 (file)
@@ -436,7 +436,10 @@ Set the output verbosity to @var{loglevel}. Possible values are @code{NONE},
 @item --lxml
 use the lxml.etree Python package for XML-parsing; uses less memory and cpu time.
 
-@item --nd --no-articulation-directions
+@item -m, --midi
+activate midi-block.
+
+@item -nd --no-articulation-directions
 do not convert directions (@code{^}, @code{_} or @code{-}) for
 articulations, dynamics, etc.
 
@@ -679,7 +682,7 @@ explicit tempo markings, and the notes and durations themselves
 are produced in the output.
 
 The @emph{articulate} project is one attempt to get more of the
-information in the score into he MIDI.  It works by shortening
+information in the score into MIDI.  It works by shortening
 notes not under slurs, to @q{articulate} the notes.  The amount of
 shortening depends on any articulation markings attached to a
 note: staccato halves the note value, tenuto gives a note its full
index 8610f8aa44f138886c5a1bed5cb4963a3f43a34f..ea2525d866e4085e3adb90de929a7ebd91ac4f53 100644 (file)
@@ -1807,7 +1807,18 @@ class StaffGroup:
                 printer.dump (m)
             printer.dump ("}")
 
+    def print_ly_chords (self,printer):
+        try:
+            for [staff_id, voices] in self.part_information:
+                for [v, lyrics, figuredbass, chordnames] in voices:
+                    if chordnames:
+                        printer ('\context ChordNames = "%s" \\%s' % (chordnames, chordnames))
+                        printer.newline ()
+        except TypeError:
+            return
+
     def print_ly (self, printer):
+        self.print_ly_chords (printer)
         if self.stafftype:
             printer.dump ("\\new %s" % self.stafftype)
         self.print_ly_overrides (printer)
@@ -1848,12 +1859,6 @@ class Staff (StaffGroup):
             sub_staff_type = self.stafftype
 
         for [staff_id, voices] in self.part_information:
-            # Chord names need to come before the staff itself!
-            for [v, lyrics, figuredbass, chordnames] in voices:
-                if chordnames:
-                    printer ('\context ChordNames = "%s" \\%s' % (chordnames, chordnames))
-
-            # now comes the real staff definition:
             if staff_id:
                 printer ('\\context %s = "%s" << ' % (sub_staff_type, staff_id))
             else:
index d03d116de7607718b2b0fa9c8a79a0d403d8339a..6eb3b45aba21ca1aa89a0fc7fdf96373b649d4aa 100644 (file)
@@ -12,7 +12,7 @@ _ = ly._
 
 def escape_ly_output_string (input_string):
     return_string = input_string
-    needs_quotes = not re.match (u"^[a-zA-ZäöüÜÄÖß,\.!:ñ]*$", return_string);
+    needs_quotes = not re.match (u"^[a-zA-ZäöüÜÄÖßñ]*$", return_string);
     if needs_quotes:
         return_string = "\"" + string.replace (return_string, "\"", "\\\"") + "\""
     return return_string
index a898e64a71622535e9306c5021362ccc169f55b6..8738b2a073bc591281882f3a82cbe861636be311 100644 (file)
@@ -22,7 +22,7 @@ import musicexp
 
 from rational import Rational
 
-# Store command-line options in a global variable, so we can access them everythwere
+# Store command-line options in a global variable, so we can access them everywhere
 options = None
 
 class Conversion_Settings:
@@ -474,8 +474,6 @@ def extract_score_structure (part_list, staffinfo):
                 group_starts.append (pos)
         pos += 1
 
-    if len (staves) == 1:
-        return staves[0]
     for i in staves:
         structure.append_staff (i)
     return score
@@ -533,7 +531,7 @@ def musicxml_partial_to_lily (partial_len):
         p.partial = rational_to_lily_duration (partial_len)
         return p
     else:
-        return Null
+        return None
 
 # Detect repeats and alternative endings in the chord event list (music_list)
 # and convert them to the corresponding musicexp objects, containing nested
@@ -2669,7 +2667,7 @@ information.""") % 'lilypond')
                   action = "store_true",
                   default = False,
                   dest = "midi",
-                  help = _("add midi-block to .ly file"))
+                  help = _("activate midi-block"))
 
     p.add_option_group ('',
                         description = (