diff --git a/README.md b/README.md index 6a51a5e..0528d7f 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,21 @@ -bwwtolily will attempt to convert a .bww or .bmw file to a lilypond -(http://lilypond.org) parsable file. Not all of the embellishments -get converted properly, this is espessially true with piobaireachd, +Convert Bagpipe Reader to Lilypond +================================== + +This is a utility to convert a .bww or .bmw file to a [lilypond](https://lilypond.org) parsable file. +Not all of the embellishments get converted properly, this is espessially true with piobaireachd, and the program will list the embellishments that were not converted. If you recognize an embellishment that isn't being parsed, please -send an email regarding the embellishment to jezra@jezra.net and I -will try to add the embellishment to the application. +create an [issue on github](https://github.com/kastdeur/bwwtolily/issues) usage: ->bwwtolily -i /path/to/a/bww/file +``` +$ bwwtolily /path/to/a/bww/file +``` optionally, using the "-l" flag will try to run lilypond on the created .ly file example: ->bwwtolily -i /path/to/bww/file -l - +``` +$ bwwtolily /path/to/bww/file -l +``` diff --git a/bwwtolily.py b/bwwtolily.py index 8610153..c186018 100755 --- a/bwwtolily.py +++ b/bwwtolily.py @@ -2,12 +2,13 @@ # #bwwtolily: will convert a bww file to a lilypond file #copyright: 2008 Jezra Lickter +#contributions by ET de Boone #GPL v3 from argparse import ArgumentParser import sys,os,re,subprocess -version = "0.5.2" +version = "0.6.3" #make a print function to handle various version of python def do_print(string): @@ -23,12 +24,16 @@ class bwwtolily : self.most_recent_note = 0 self.in_note_group=False self.slur_tie_pending = False + self.tuplet_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])") + self.sig_regex = re.compile("([0-9]{1,2})_([0-9]{1,2})") + #alternative time signature for (cut) common time + self.sig_regex_common = re.compile("C_\W") #a regex to find notes self.regex_note_info=re.compile("(?P[A-Z]+)(?P[a-z]*)_(?P