diff --git a/music21/figuredBass/realizer.py b/music21/figuredBass/realizer.py index 7edc05bfca..6d06038c05 100644 --- a/music21/figuredBass/realizer.py +++ b/music21/figuredBass/realizer.py @@ -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:]: @@ -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