Skip to content

Commit

Permalink
Roman Numerals: Don't substitute d for 0 in add10 (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmsailor authored Aug 27, 2023
1 parent 8baa273 commit fdb126c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion music21/roman.py
Original file line number Diff line number Diff line change
Expand Up @@ -2415,7 +2415,7 @@ def __init__(

# immediately fix low-preference figures
if isinstance(figure, str):
figure = figure.replace('0', 'o') # viio7
figure = re.sub(r'(?<!\d)0', 'o', figure) # viio7 (but don't alter 10.)
figure = figure.replace('º', 'o')
figure = figure.replace('°', 'o')
# /o is just a shorthand for ø -- so it should not be stored.
Expand Down Expand Up @@ -4349,6 +4349,10 @@ def testZeroForDiminished(self):
self.assertEqual([p.name for p in rn.pitches], ['B', 'D', 'F', 'A-'])
rn = roman.RomanNumeral('vii/07', 'c')
self.assertEqual([p.name for p in rn.pitches], ['B', 'D', 'F', 'A'])
# However, when there is a '10' somewhere in the figure, don't replace
# the 0 (this occurs in DCML corpora)
rn = roman.RomanNumeral('V7[add10]', 'c')
self.assertEqual([p.name for p in rn.pitches], ['G', 'B-', 'B', 'D', 'F'])

def testIII7(self):
c = chord.Chord(['E4', 'G4', 'B4', 'D5'])
Expand Down

0 comments on commit fdb126c

Please sign in to comment.