diff --git a/music21/scale/intervalNetwork.py b/music21/scale/intervalNetwork.py index d7e97b2ad..ee2ee0ef3 100644 --- a/music21/scale/intervalNetwork.py +++ b/music21/scale/intervalNetwork.py @@ -5,7 +5,7 @@ # Authors: Christopher Ariza # Michael Scott Asato Cuthbert # -# Copyright: Copyright © 2010-2023 Michael Scott Asato Cuthbert +# Copyright: Copyright © 2010-2026 Michael Scott Asato Cuthbert # License: BSD, see license.txt # ------------------------------------------------------------------------------ ''' @@ -1739,16 +1739,16 @@ def realizeDescending( while True: appendPitch = False if (minPitchObj is not None - and _gte(p.ps, minPitchObj.ps) + and _gte(pCollect.ps, minPitchObj.ps) and maxPitchObj is not None - and _lte(p.ps, maxPitchObj.ps)): + and _lte(pCollect.ps, maxPitchObj.ps)): appendPitch = True elif (minPitchObj is not None - and _gte(p.ps, minPitchObj.ps) + and _gte(pCollect.ps, minPitchObj.ps) and maxPitchObj is None): appendPitch = True elif (maxPitchObj is not None - and _lte(p.ps, maxPitchObj.ps) + and _lte(pCollect.ps, maxPitchObj.ps) and minPitchObj is None): appendPitch = True elif minPitchObj is None and maxPitchObj is None: diff --git a/music21/scale/test_scale_main.py b/music21/scale/test_scale_main.py index ded1bd6d9..457801de2 100644 --- a/music21/scale/test_scale_main.py +++ b/music21/scale/test_scale_main.py @@ -5,7 +5,7 @@ # Authors: Christopher Ariza # Michael Scott Asato Cuthbert # -# Copyright: Copyright © 2010-2024 Michael Scott Asato Cuthbert +# Copyright: Copyright © 2010-2026 Michael Scott Asato Cuthbert # License: BSD, see license.txt # ------------------------------------------------------------------------------ from __future__ import annotations @@ -272,6 +272,15 @@ def testCyclicalScales(self): sc2 = scale.CyclicalScale() self.assertEqual(self.pitchOut(sc2.getPitches()), '[C4, D-4]') + def testHarmonicMinorDescendingRange(self): + sc = scale.HarmonicMinorScale('c4') + descending = sc.getPitches('b2', 'e3', direction=Direction.DESCENDING) + self.assertEqual(self.pitchOut(descending), '[E-3, D3, C3, B2]') + + sc = scale.HarmonicMinorScale('b-3') + descending = sc.getPitches('c#4', 'g#4', direction=Direction.DESCENDING) + self.assertEqual(self.pitchOut(descending), '[G-4, F4, E-4, D-4]') + def testDeriveByDegree(self): sc1 = scale.MajorScale() self.assertEqual(str(sc1.deriveByDegree(7, 'G#')),