]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/abc2ly.py
Changed scripts/* to use sys.argv[0]
[lilypond.git] / scripts / abc2ly.py
index 943cc94b3b821e64192db3c27a9fb34395f961c4..9a076136470334a348cc35afcb98dad881800f8a 100644 (file)
 # UNDEF -> None
 #
   
-  
-program_name = 'abc2ly'
-version = '@TOPLEVEL_VERSION@'
-if version == '@' + 'TOPLEVEL_VERSION' + '@':
-       version = '(unknown version)'           # uGUHGUHGHGUGH
-  
+
 import __main__
 import getopt
 import sys
@@ -79,6 +74,11 @@ import re
 import string
 import os
 
+program_name = sys.argv[0]
+
+version = '@TOPLEVEL_VERSION@'
+if version == '@' + 'TOPLEVEL_VERSION' + '@':
+       version = '(unknown version)'           # uGUHGUHGHGUGH  
 
 UNDEF = 255
 state = UNDEF
@@ -163,10 +163,14 @@ def select_voice (name, rol):
                                        check_clef(value)
                                elif keyword == "name":
                                        value = re.sub ('\\\\','\\\\\\\\', value)
-                                       voices_append ("\\property Staff.instrument = %s\n" % value )
+                                       ## < 2.2
+                                       ##voices_append ("\\property Staff.instrument = %s\n" % value )
+                                       voices_append ("\\set Staff.instrument = %s\n" % value )
+                                       
                                        __main__.part_names = 1
                                elif keyword == "sname" or keyword == "snm":
-                                       voices_append ("\\property Staff.instr = %s\n" % value )
+                                       ##voices_append ("\\property Staff.instr = %s\n" % value )
+                                       voices_append ("\\set Staff.instr = %s\n" % value )
                else:
                        break
 
@@ -191,7 +195,9 @@ def dump_default_bar (outf):
        """
        Nowadays abc2ly outputs explicits barlines (?)
        """
-       outf.write ("\n\\property Score.defaultBarType=\"empty\"\n")
+       ## < 2.2
+       ##outf.write ("\n\\property Score.defaultBarType = \"empty\"\n")
+       outf.write ("\n\\set Score.defaultBarType = \"empty\"\n")
 
 
 def dump_slyrics (outf):
@@ -1184,18 +1190,18 @@ def try_parse_chord_delims (str, state):
                if state.next_bar:
                        voices_append(state.next_bar)
                        state.next_bar = ''
-               voices_append ('<')
+               voices_append ('<<')
 
        if str[:1] == '+':
                str = str[1:]
                if state.plus_chord:
-                       voices_append ('>')
+                       voices_append ('>>')
                        state.plus_chord = 0
                else:
                        if state.next_bar:
                                voices_append(state.next_bar)
                                state.next_bar = ''
-                       voices_append ('<')
+                       voices_append ('<<')
                        state.plus_chord = 1
 
        ch = ''