Skip to content

Commit

Permalink
Merge pull request cuthbertLab#1140 from cuthbertLab/follow-on-figure…
Browse files Browse the repository at this point in the history
…d-bass
  • Loading branch information
mscuthbert authored Sep 23, 2021
2 parents 3d3bee6 + 6453846 commit 7d0e45b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion music21/figuredBass/realizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,13 @@ def updateAnnotationString(annotationString: str, inputText: str) -> str:
'''
# "64" and "#6#42" but not necessarily "4-3" or "sus4"
stop_index_exclusive: int = 0
if inputText[0] in '#-' and len(inputText) > 1 and inputText[1].isnumeric():
if inputText[0] in '+#bn' and len(inputText) > 1 and inputText[1].isnumeric():
stop_index_exclusive = 2
elif inputText[0].isnumeric():
stop_index_exclusive = 1
else:
# quit
stop_index_exclusive = 1000
annotationString += inputText[:stop_index_exclusive]
# Is there more?
if inputText[stop_index_exclusive:]:
Expand Down Expand Up @@ -848,6 +851,13 @@ def testMultipleFiguresInLyric(self):
unused_fb = figuredBassFromStream(s)
self.assertEqual(third_note.notationString, '6, 4')

# single accidental
for single_symbol in '+#bn':
with self.subTest(single_symbol=single_symbol):
third_note.lyric = single_symbol
unused_fb = figuredBassFromStream(s)
self.assertEqual(third_note.notationString, single_symbol)


if __name__ == '__main__':
import music21
Expand Down

0 comments on commit 7d0e45b

Please sign in to comment.