|
@ -10,13 +10,13 @@ def parseFingering(fingering, instrument): |
|
|
if len(fingering) == numStrings: # if the fingering is entered in concise format e.g. xx4455 |
|
|
if len(fingering) == numStrings: # if the fingering is entered in concise format e.g. xx4455 |
|
|
output = list(fingering) |
|
|
output = list(fingering) |
|
|
else: # if entered in long format e.g. x,x,10,10,11,11 |
|
|
else: # if entered in long format e.g. x,x,10,10,11,11 |
|
|
output = fingering.split(",") |
|
|
|
|
|
|
|
|
output = fingering.split(",").strip() |
|
|
if len(output) == numStrings: |
|
|
if len(output) == numStrings: |
|
|
return output |
|
|
return output |
|
|
else: |
|
|
else: |
|
|
raise Exception("Voicing <{}> is malformed.".format(fingering)) |
|
|
raise Exception("Voicing <{}> is malformed.".format(fingering)) |
|
|
elif instrument == 'piano': |
|
|
elif instrument == 'piano': |
|
|
return [parseName(note).upper() for note in fingering.split(",")] |
|
|
|
|
|
|
|
|
return [parseName(note).upper().strip() for note in fingering.split(",")] |
|
|
else: |
|
|
else: |
|
|
return [fingering] |
|
|
return [fingering] |
|
|
|
|
|
|
|
|