From b29a4fd5d941b98e45157a099479faca93a8efdf Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Mon, 28 Jan 2019 01:13:19 +0100 Subject: [PATCH] Read (cut) common time signature if no time signature found, try to find a (cut) common time signature. default to 4/4. --- bwwtolily.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bwwtolily.py b/bwwtolily.py index 8cfd8bc..5648212 100755 --- a/bwwtolily.py +++ b/bwwtolily.py @@ -29,7 +29,9 @@ class bwwtolily : #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