diff --git a/bwwtolily.py b/bwwtolily.py index f31287f..adae9f2 100755 --- a/bwwtolily.py +++ b/bwwtolily.py @@ -7,400 +7,403 @@ GPL v3 from optparse import OptionParser import sys,os,re,subprocess -version = "0.4.0" +version = "0.4.1" + +#make a print function to handle various version of python +def do_print(string): + try: + eval("print "+string) + except: + print(string) #define the class that will convert a bww file to a lilypond file class bwwtolily : + def __init__(self,addmidi=False): + self.tune_elements = [] + self.most_recent_note = 0 + self.in_note_group=False + self.slur_tie_pending = False + self.last_group_close=0 + '''compile a few regex queries''' + #make a regex to determine if something is a lilypond note + self.regex_lilynote= re.compile("[abcdefgAG][0-9]*") + #try to determine the time signature + self.sig_regex = re.compile("([0-9])_([0-9])") + #a regex to find notes + self.regex_note_info=re.compile("(?P[A-Z]+)(?P[a-z]*)_(?P