1
0
Fork 0
mirror of https://github.com/kastdeur/bwwtolily.git synced 2024-11-22 11:53:32 +01:00

Added echos for low A,G

This commit is contained in:
Eric Teunis de Boone 2016-10-30 17:47:39 +01:00
parent de90d424ed
commit 9f696d8f77

View file

@ -4,10 +4,10 @@
#copyright: 2008 Jezra Lickter #copyright: 2008 Jezra Lickter
#GPL v3 #GPL v3
from optparse import OptionParser from argparse import ArgumentParser
import sys,os,re,subprocess import sys,os,re,subprocess
version = "0.4.2" version = "0.5.2"
#make a print function to handle various version of python #make a print function to handle various version of python
def do_print(string): def do_print(string):
@ -74,7 +74,9 @@ class bwwtolily :
"tar":"\\taor", "tar":"\\taor",
"gstd":"\\slurd", "gstd":"\\slurd",
"tdbf":"\\tdblf", "tdbf":"\\tdblf",
"rodin":"\\bgrip" "rodin":"\\bgrip",
"echola":"\\echoA",
"echolg":"\\echolg"
} }
#are we adding midi? #are we adding midi?
if addmidi: if addmidi:
@ -358,31 +360,43 @@ melody = {
#use the bww2lily class #use the bww2lily class
if __name__ == "__main__" : if __name__ == "__main__" :
parser = OptionParser() parser = ArgumentParser()
parser.add_option("-i", "--in", dest="input", parser.add_argument("files", default='', nargs='*')
help="the FILE to convert", metavar="FILE") parser.add_argument("-i", "--in", dest="input",
parser.add_option("-l", "--lilypond", help="the FILE to convert", metavar="FILE",
)
parser.add_argument("-l", "--lilypond",
action="store_true", dest="runlilypond",default=False, action="store_true", dest="runlilypond",default=False,
help="run lilypond after converting the file") help="run lilypond after converting the file")
parser.add_option("-m", "--midi", parser.add_argument("-m", "--midi",
action="store_true", dest="addmidi",default=False, action="store_true", dest="addmidi",default=False,
help="add midi output to the lilypond file") help="add midi output to the lilypond file")
parser.add_option("-v","--version",dest='version',default=False, parser.add_argument("-v","--version",dest='version',default=False,
action="store_true",help="print version information and quit") action="store_true",help="print version information and quit")
#parse the args #parse the args
(options, args) = parser.parse_args() args = parser.parse_args()
if options.version: if args.version:
do_print( "bwwtolily: "+version) do_print( "bwwtolily: "+version)
sys.exit() sys.exit()
if options.input!=None: if args.input!=None:
b2l = bwwtolily(options.addmidi) b2l = bwwtolily(args.addmidi)
b2l.set_file(options.input) b2l.set_file(args.input)
b2l.parse() b2l.parse()
new_file = b2l.create_output_file() new_file = b2l.create_output_file()
#are we running lilypond? #are we running lilypond?
if options.runlilypond: if args.runlilypond:
#try to run lilypond as a subprocess
subprocess.check_call("lilypond \""+new_file+"\"",shell=True)
elif args.files:
for f in args.files:
b2l = bwwtolily(args.addmidi)
b2l.set_file(f)
b2l.parse()
new_file = b2l.create_output_file()
#are we running lilypond?
if args.runlilypond:
#try to run lilypond as a subprocess #try to run lilypond as a subprocess
subprocess.check_call("lilypond \""+new_file+"\"",shell=True) subprocess.check_call("lilypond \""+new_file+"\"",shell=True)
else: else: