@@ -2415,7 +2415,7 @@ def __init__(
2415
2415
2416
2416
# immediately fix low-preference figures
2417
2417
if isinstance (figure , str ):
2418
- figure = figure . replace ( ' 0' , 'o' ) # viio7
2418
+ figure = re . sub ( r'(?<!\d) 0' , 'o' , figure ) # viio7 (but don't alter 10.)
2419
2419
figure = figure .replace ('º' , 'o' )
2420
2420
figure = figure .replace ('°' , 'o' )
2421
2421
# /o is just a shorthand for ø -- so it should not be stored.
@@ -4349,6 +4349,10 @@ def testZeroForDiminished(self):
4349
4349
self .assertEqual ([p .name for p in rn .pitches ], ['B' , 'D' , 'F' , 'A-' ])
4350
4350
rn = roman .RomanNumeral ('vii/07' , 'c' )
4351
4351
self .assertEqual ([p .name for p in rn .pitches ], ['B' , 'D' , 'F' , 'A' ])
4352
+ # However, when there is a '10' somewhere in the figure, don't replace
4353
+ # the 0 (this occurs in DCML corpora)
4354
+ rn = roman .RomanNumeral ('V7[add10]' , 'c' )
4355
+ self .assertEqual ([p .name for p in rn .pitches ], ['G' , 'B-' , 'B' , 'D' , 'F' ])
4352
4356
4353
4357
def testIII7 (self ):
4354
4358
c = chord .Chord (['E4' , 'G4' , 'B4' , 'D5' ])
0 commit comments