diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 5149f08b6d..20d680fb6c 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -49,6 +49,15 @@ + + + diff --git a/music21/pitch.py b/music21/pitch.py index e998751426..69b3b24063 100644 --- a/music21/pitch.py +++ b/music21/pitch.py @@ -565,6 +565,8 @@ def _dissonanceScore(pitches, smallPythagoreanRatio=True, accidentalPenalty=True score_ratio = 0.0 score_triad = 0.0 + intervals: list[interval.Interval] = [] + if not pitches: return 0.0 @@ -1159,7 +1161,7 @@ def listNames(cls): 'one-and-a-half-flat', 'one-and-a-half-sharp', 'quadruple-flat', 'quadruple-sharp', 'sharp', 'triple-flat', 'triple-sharp'] ''' - return sorted(accidentalNameToModifier.keys(), key=str.lower) + return sorted(a.lower() for a in accidentalNameToModifier) # PUBLIC METHODS # @@ -3209,7 +3211,7 @@ def implicitOctave(self) -> int: else: return self.octave - # noinspection SpellCheckingInspection + # noinspection SpellCheckingInspection,GrazieInspection @property def german(self) -> str: ''' @@ -3274,7 +3276,7 @@ def german(self) -> str: # noinspection SpellCheckingInspection @property def italian(self) -> str: - # noinspection SpellCheckingInspection + # noinspection SpellCheckingInspection,GrazieInspection ''' Read-only attribute. Returns the name of a Pitch in the Italian system @@ -3357,7 +3359,7 @@ def _getSpanishCardinal(self) -> str: 'G': 'sol', } - # noinspection SpellCheckingInspection + # noinspection SpellCheckingInspection,GrazieInspection @property def spanish(self) -> str: ''' @@ -3731,10 +3733,6 @@ def harmonicFromFundamental(self, # 'target', target]) if distanceLower <= distanceHigher: - # pd = 'distanceLower (%s); distanceHigher (%s); distance lower ' + - # 'is closer to target: %s' - # environLocal.printDebug(['harmonicFromFundamental():', - # pd % (candidateLower, candidateHigher, target)]) # the lower is closer, thus we need to raise gap match = candidateLower gap = -abs(distanceLower) @@ -4253,6 +4251,7 @@ def simplifyEnharmonic( return returnObj def getEnharmonic(self: PitchType, *, inPlace=False) -> PitchType|None: + # noinspection GrazieInspection ''' Returns a new Pitch that is the(/an) enharmonic equivalent of this Pitch. Can be thought of as flipEnharmonic or something like that. @@ -5055,7 +5054,7 @@ def set_displayStatus(newDisplayStatus: bool): set_displayStatus(True) return - # no pitches in past... + # no pitches in the past list... if not pitchPastAll: # if we have no past, we show the accidental if this pitch name # is not in the alteredPitches list, or for naturals: if the diff --git a/music21/tinyNotation.py b/music21/tinyNotation.py index c180abc486..224e3702fb 100644 --- a/music21/tinyNotation.py +++ b/music21/tinyNotation.py @@ -872,6 +872,7 @@ def _getDefaultTokenMap() -> list[tuple[str, type[Token]]]: } class Converter: + # noinspection GrazieInspection ''' Main conversion object for TinyNotation. @@ -1405,7 +1406,7 @@ def postParse(self): ''' Called after all the tokens have been run. - Currently runs `.makeMeasures` on `.stream` unless `.makeNotation` is `False`. + It currently runs `.makeMeasures()` on `.stream` unless `.makeNotation` is `False`. ''' if self.makeNotation is not False: self.stream.makeMeasures(inPlace=True)