Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1685: Harmony parsing errors with doubled characters #1688

Merged
merged 2 commits into from
Mar 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion music21/harmony.py
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,7 @@ def _getKindFromShortHand(self, sH):
for charString in getAbbreviationListGivenChordType(chordKind):
if sH == charString:
self.chordKind = chordKind
return originalsH.replace(charString, '')
return originalsH[len(sH):]
return originalsH

def _hasPitchAboveC4(self, pitches):
Expand Down Expand Up @@ -3162,6 +3162,12 @@ def testExpressSusUsingAlterations(self):

self.assertEqual(ch1.pitches, ch2.pitches)

def testDoubledCharacters(self):
ch1 = ChordSymbol('Co omit5')
ch2 = ChordSymbol('Cdim omit5')

self.assertEqual(ch1.pitches, ch2.pitches)

def x_testPower(self):
'''
power chords should not have inversions
Expand Down
Loading