X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fabc2ly.py;h=73f59b3be4708f617563818e304bf54293862b52;hb=89fe8aa667033477fdfb5ecbd176da47aa2c8521;hp=eac86759a21c1cfda5e4d0129734ab6553de4d9a;hpb=d9b43b93f2c885409bafdb157138158f65cc49aa;p=lilypond.git diff --git a/scripts/abc2ly.py b/scripts/abc2ly.py index eac86759a2..73f59b3be4 100644 --- a/scripts/abc2ly.py +++ b/scripts/abc2ly.py @@ -49,8 +49,11 @@ #TODO: +# +# Convert to new chord styles. +# # UNDEF -> None - +# program_name = 'abc2ly' @@ -177,7 +180,10 @@ def dump_lyrics (outf): outf.write(" >\n \\paper{}\n}\n") def dump_default_bar (outf): - outf.write ("\n\\property Score.defaultBarType=\"empty\"\n") + """ + Nowadays abc2ly outputs explicits barlines (?) + """ + outf.write ("\n\\property Score.defaultBarType=\"empty\"\n") def dump_slyrics (outf): @@ -924,7 +930,6 @@ def try_parse_note (str, parser_state): (str, num,den,current_dots) = parse_duration (str, parser_state) - if re.match('[ \t]*\)', str): str = string.lstrip (str) @@ -934,9 +939,6 @@ def try_parse_note (str, parser_state): str = str[1:] - if slur_end: - voices_append ('%s' % ')' *slur_end ) - bar_acc = get_bar_acc(notename, octave, parser_state) pit = pitch_to_lilypond_name(notename, acc, bar_acc, global_key[notename]) oct = octave_to_lilypond_quotes (octave) @@ -960,7 +962,10 @@ def try_parse_note (str, parser_state): if not parser_state.parsing_tuplet: voices_append ("}") if slur_begin: - voices_append ('%s' % '(' * slur_begin ) + voices_append ('-(' * slur_begin ) + if slur_end: + voices_append ('-)' *slur_end ) + return str @@ -1262,19 +1267,19 @@ Convert ABC to lilypond. Usage: abc2ly [OPTIONS]... ABC-FILE Options: - -h, --help this help + -h, --help print this help -o, --output=FILE set output filename to FILE - -v, --version version information - -s, --strict be strict about succes. + -v, --version show version information + -s, --strict be strict about succes This program converts ABC music files (see -http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt) To LilyPond input. +http://www.gre.ac.uk/~c.walshaw/abc2mtex/abc.txt) to LilyPond input. -Report bugs to bug-lilypond@gnu.org +Report bugs to bug-lilypond@gnu.org. Written by Han-Wen Nienhuys , Laura Conrad -, Roy Rankin +, Roy Rankin . """ def print_version ():